> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcollate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Context Plugins

> Manage external context source connectors for Collate AI Chat through the Collate REST API

# Context Plugins

A Context Plugin connects an external source (Confluence, Notion, GitHub, or a custom MCP server) as additional context for Collate AI Chat. It's a standard catalog entity, so it supports the usual list, retrieve, create, patch, delete, version, and follower operations.

| Method | Endpoint | Description |
| - | - | - |
| `GET` | `/v1/ai/contextPlugins` | List Context Plugins. |
| `GET` | `/v1/ai/contextPlugins/{id}` | Retrieve a Context Plugin by ID. |
| `GET` | `/v1/ai/contextPlugins/name/{fqn}` | Retrieve a Context Plugin by fully qualified name. |
| `GET` | `/v1/ai/contextPlugins/{id}/versions` | List all versions of a Context Plugin. |
| `GET` | `/v1/ai/contextPlugins/{id}/versions/{version}` | Retrieve a specific version. |
| `POST` | `/v1/ai/contextPlugins` | Create a Context Plugin. |
| `PUT` | `/v1/ai/contextPlugins` | Create or update a Context Plugin, identified by name. |
| `PATCH` | `/v1/ai/contextPlugins/{id}` | Update a Context Plugin with a JSON Patch. |
| `DELETE` | `/v1/ai/contextPlugins/{id}` | Delete a Context Plugin by ID. |
| `DELETE` | `/v1/ai/contextPlugins/name/{fqn}` | Delete a Context Plugin by fully qualified name. |
| `POST` | `/v1/ai/contextPlugins/{id}/testConnection` | Validate the plugin's connection configuration. |
| `PUT` | `/v1/ai/contextPlugins/{id}/followers` | Add the authenticated user as a follower. |
| `DELETE` | `/v1/ai/contextPlugins/{id}/followers/{userId}` | Remove a follower. |
| `PUT` | `/v1/ai/contextPlugins/restore` | Restore a soft-deleted Context Plugin. |

`POST`/`PUT` take a `CreateContextPlugin` body:

* `name` (required)
* `pluginType` (required)
* `provider` (required)
* `connectionConfig`: connection details specific to the plugin type
* `displayName`, `description`, `icon`
* `owners`, `reviewers`, `tags` (defaults to empty)
* `entityStatus`: defaults to `Approved`

Connection credentials in `connectionConfig` are masked in responses to ordinary users. Authorized bot callers can receive decrypted credentials, so treat bot responses as sensitive and avoid logging them.

## Example

The following request creates a Context Plugin.

<RequestExample>
  ```bash Create a Context Plugin theme={null}
  curl -X POST "{base_url}/api/v1/ai/contextPlugins" \
    -H "Authorization: Bearer {access_token}" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "engineering_confluence",
      "pluginType": "confluence",
      "provider": "user",
      "connectionConfig": {
        "type": "Confluence",
        "url": "https://acme.atlassian.net/wiki",
        "email": "reader@example.com",
        "apiToken": "{confluence_api_token}"
      }
    }'
  ```
</RequestExample>
