Connector

Connector #

Work with Connector #

A Connector defines how to access and fetch data from external services such as Google Drive, GitHub, Confluence, databases, and more. Connectors are used by datasources to pull data into Coco Server.

Connector API #

Below is the field description for the connector.

FieldTypeDescription
namestringThe connector’s name.
descriptionstringA brief description of the connector.
categorystringThe category of the connector, e.g., cloud_storage, version_control.
iconstringThe icon representing the connector in the UI.
tagsarrayTags associated with the connector.
urlstringDirect link associated with the connector.
path_hierarchybooleanWhether the connector supports hierarchical path-based access.
assets.iconsobjectMap of icon keys to icon URLs for different connector states/types.
builtinbooleanIndicates whether the connector is built-in (built-in connectors cannot be deleted).
configobjectConnector-specific configuration (varies by connector type).
oauth_connect_implementedbooleanWhether the connector supports OAuth-based connection flow.
processor.enabledbooleanWhether the data processing pipeline is enabled for this connector.
processor.namestringName of the processor to use.
enabledbooleanEnables or disables the connector.

Create a Connector #

//request
curl -H 'Content-Type: application/json' -XPOST http://localhost:9000/connector/ -d'{
  "name": "My GitHub Connector",
  "description": "Connects to GitHub repositories",
  "category": "version_control",
  "icon": "font_github",
  "tags": ["github", "code"],
  "config": {
    "token": "ghp_xxxxxxxxxxxx",
    "repos": ["infinilabs/coco-server"]
  },
  "processor": {
    "enabled": true
  },
  "enabled": true
}'

//response
{
  "_id": "d07abc123def456ghi",
  "result": "created"
}

View a Connector #

//request
curl -XGET http://localhost:9000/connector/d07abc123def456ghi

//response
{
  "_id": "d07abc123def456ghi",
  "_source": {
    "id": "d07abc123def456ghi",
    "created": "2025-01-15T10:00:00+08:00",
    "updated": "2025-01-15T10:00:00+08:00",
    "name": "My GitHub Connector",
    "description": "Connects to GitHub repositories",
    "category": "version_control",
    "icon": "font_github",
    "tags": ["github", "code"],
    "config": {
      "token": "******",
      "repos": ["infinilabs/coco-server"]
    },
    "processor": {
      "enabled": true
    },
    "enabled": true
  },
  "found": true
}

Update a Connector #

//request
curl -H 'Content-Type: application/json' -XPUT http://localhost:9000/connector/d07abc123def456ghi -d'{
  "name": "My GitHub Connector - Updated",
  "description": "Updated connector for GitHub repositories",
  "enabled": true
}'

//response
{
  "_id": "d07abc123def456ghi",
  "result": "updated"
}

By default, the update merges with the existing connector configuration. Use ?replace=true to fully replace the connector configuration instead of merging.

Delete a Connector #

//request
curl -XDELETE http://localhost:9000/connector/d07abc123def456ghi

//response
{
  "_id": "d07abc123def456ghi",
  "result": "deleted"
}

Note: Built-in connectors cannot be deleted. Attempting to delete a built-in connector will return a 403 Forbidden error.

Search Connectors #

//request
curl -XGET http://localhost:9000/connector/_search

//response
{
  "took": 3,
  "hits": {
    "total": { "value": 5, "relation": "eq" },
    "hits": [
      {
        "_id": "d07abc123def456ghi",
        "_source": {
          "id": "d07abc123def456ghi",
          "name": "My GitHub Connector",
          "category": "version_control",
          "icon": "font_github",
          "enabled": true,
          "created": "2025-01-15T10:00:00+08:00"
        }
      }
    ]
  }
}

You can filter connectors by name:

curl -XGET "http://localhost:9000/connector/_search?query=github"

Note: Sensitive fields in connector configurations (such as API keys and tokens) are automatically masked in search results.

For detailed connector-specific configurations, refer to the Connectors Reference.

Edit Edit this page