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

# Manage connectors

> Learn how to list, attach, update, and remove connectors using the connector sub-resource endpoints.

This guide shows you how to manage connectors attached to an agent using the connector sub-resource endpoints. You will learn about the full connector CRUD lifecycle and JSON Merge Patch semantics.

## Prerequisites

* An existing agent (see [Create an agent](/agentic/guides/create-agent))
* Understanding of [connectors](/agentic/connectors) and the five connector types

## Two ways to manage connectors

You can manage connectors in two ways:

1. **Via the agent's `connectors` array**: When you PATCH an agent, the `connectors` array is replaced wholesale. This is good for bulk changes.
2. **Via the connector sub-resource**: Attach, update, remove, or list individual connectors without rewriting the full agent. This is good for incremental changes.

This guide focuses on the sub-resource approach.

## List connectors

```bash theme={null}
# Replace these with your values
AGENT_ID="<your-agent-id>"
ENVIRONMENT="<eu-or-us>"
TENANT="<your-tenant-name>"
TOKEN="<your-access-token>"

curl "https://api.${ENVIRONMENT}.corti.app/v2/agentic/agents/${AGENT_ID}/connectors" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Tenant-Name: ${TENANT}"
```

The response is a JSON object with a `connectors` array, each discriminated by `type`:

```json theme={null}
{
  "connectors": [
    {"type": "registry", "id": "con.0192f4c8-...", "name": "coding-expert"},
    {"type": "mcp", "id": "con.0192f4c8-...", "name": "policybot", "url": "https://mcp.example.com"}
  ]
}
```

## Attach a connector

```bash theme={null}
curl -X POST "https://api.${ENVIRONMENT}.corti.app/v2/agentic/agents/${AGENT_ID}/connectors" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Tenant-Name: ${TENANT}" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "registry",
    "name": "coding-expert",
    "config": {"codingSystem": "icd-10"}
  }'
```

Each connector type has different required fields. See [Connectors](/agentic/connectors) for the full schema of each type.

### Attach an MCP connector

```bash theme={null}
curl -X POST "https://api.${ENVIRONMENT}.corti.app/v2/agentic/agents/${AGENT_ID}/connectors" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Tenant-Name: ${TENANT}" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "mcp",
    "name": "policybot",
    "url": "https://mcp.example.com",
    "auth": {"type": "bearer"}
  }'
```

### Attach a schema connector

```bash theme={null}
curl -X POST "https://api.${ENVIRONMENT}.corti.app/v2/agentic/agents/${AGENT_ID}/connectors" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Tenant-Name: ${TENANT}" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "schema",
    "name": "submit_code",
    "description": "Submit the final ICD-10 code.",
    "transition": "complete",
    "schema": {
      "type": "object",
      "properties": {"code": {"type": "string"}},
      "required": ["code"]
    }
  }'
```

## Get a connector

```bash theme={null}
CONNECTOR_ID="<your-connector-id>"

curl "https://api.${ENVIRONMENT}.corti.app/v2/agentic/agents/${AGENT_ID}/connectors/${CONNECTOR_ID}" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Tenant-Name: ${TENANT}"
```

## Update a connector

<Warning>The connector PATCH endpoint is in private preview and returns HTTP 501. To change a connector, remove it and attach a new one.</Warning>

Use JSON Merge Patch to update a connector. The `type` field is immutable:

```bash theme={null}
curl -X PATCH "https://api.${ENVIRONMENT}.corti.app/v2/agentic/agents/${AGENT_ID}/connectors/${CONNECTOR_ID}" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Tenant-Name: ${TENANT}" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{
    "enabled": false,
    "name": "policybot-v2",
    "url": "https://mcp.example.com/v2"
  }'
```

| Field     | Patch behavior                                        |
| --------- | ----------------------------------------------------- |
| `enabled` | Omit to keep; set to toggle                           |
| `name`    | Omit to keep; `null` has no effect (name is required) |
| `url`     | Omit to keep; `null` clears it                        |
| `config`  | Omit to keep; `null` clears it                        |
| `auth`    | Omit to keep; `null` clears it                        |

## Remove a connector

```bash theme={null}
curl -X DELETE "https://api.${ENVIRONMENT}.corti.app/v2/agentic/agents/${AGENT_ID}/connectors/${CONNECTOR_ID}" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Tenant-Name: ${TENANT}"
```

## Next steps

* Read about [connector auth](/agentic/guides/connector-auth) for outbound connectors
* Browse [registry connectors](/agentic/guides/use-registry) for pre-built options
* Learn about the [connectors concept](/agentic/connectors) for the full type reference
