---
docId: doc_a2c6b05c97934940b20fcd8a907d999b
title: Connect an escalation
description: Connects an escalation from the workspace library to an agent, or turns one it already has on or off. It creates a version and publishes it immediately.
api:
  group: agentes/escalaciones
  auth: bearer
  operations:
    - operationId: connectAgentEscalation
      method: PUT
      path: '/v1/agents/{agentId}/escalations/{escalationId}'
      postmanName: Connect an escalation
---

<script>
  import { Ways, Note } from '$lib/components';
</script>

# Connect an escalation

Connect an escalation to an agent or change whether it is active with `enabled`. If anything changes, **a version is created from the published version and published immediately**. Other settings are preserved.

To review it before applying it, edit `assistance.escalations` in the [draft](/api-reference/agents/drafts/update) and publish it later. Each publication appears in the [history](/api-reference/agents/publications/list).

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PUT https://api.platic.ai/v1/agents/$AGENT_ID/escalations/$ESCALATION_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.escalations.connect("agent_123", "escalation_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent id | ✓ |
| `escalationId` | string | [Escalation](/api-reference/escalations/list) id | ✓ |

## Request body

Optional. Without a body, a new escalation is connected and active. To connect it turned off, or to turn off one that is already connected:

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `enabled` | boolean | `true`: the agent uses this escalation. `false`: it stays connected, but the agent doesn't use it. Defaults to `true` when connecting it; on one already connected, it only changes if you send it | - |

```json
{ "enabled": false }
```

## Response

`200 OK` with the agent's escalations after the change, the new version and the publication.

```json
{
  "status": "success",
  "data": {
    "changed": true,
    "items": [
      { "escalationId": "Et2pL8kN4mQ6rS1v", "enabled": false },
      { "escalationId": "Et7hQ2mVx9LpRk3s", "enabled": true }
    ],
    "version": {
      "versionId": "v8",
      "number": 8,
      "basedOnVersionId": "v7",
      "restoredFromVersionId": null,
      "copiedFrom": null,
      "createdAt": "2026-11-12T17:05:00.000Z",
      "createdBy": { "kind": "api_key", "keyId": "Ak7Pz2Lm9Qx4Wc6e" },
      "source": "api",
      "via": null,
      "note": ""
    },
    "publication": {
      "agentId": "Ag6bV8nM1qW3eR5t",
      "publication": { "versionId": "v8", "number": 8 },
      "last": {
        "publicationId": "p5",
        "action": "publish",
        "versionId": "v8",
        "previousVersionId": "v7",
        "createdAt": "2026-11-12T17:05:00.000Z",
        "createdBy": { "kind": "api_key", "keyId": "Ak7Pz2Lm9Qx4Wc6e" },
        "source": "api",
        "via": null,
        "note": ""
      }
    }
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `changed` | boolean | `false` if the escalation was already like that: no version is created or published |
| `items` | array | The agent's escalations after the change, with the fields from [List agent escalations](/api-reference/agents/escalations/list#response). A new escalation goes at the end |
| `version` | object | The created version, with the fields from [List versions](/api-reference/agents/versions/list#response-fields). With `changed: false`, the published version |
| `publication` | object | What is published now, with the fields from [Get the publication](/api-reference/agents/publications/get#response-fields) |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | `enabled` isn't a boolean or the body includes another field |
| `403` | `FORBIDDEN` | The credential can't edit this agent |
| `404` | `AGENT_NOT_FOUND` | The agent doesn't exist in the workspace or was deleted |
| `409` | `DRAFT_PENDING` | The agent's draft has unpublished changes. [Publish it](/api-reference/agents/publications/publish) first, or make the change in `assistance.escalations` of the [draft](/api-reference/agents/drafts/update) and publish it with the rest |
| `409` | `COPY_INCOMPLETE` | The agent is a copy whose files didn't finish connecting. See [Copy an agent](/api-reference/agents/copy#copy-the-files-too) |
| `409` | `CONFLICT` | Someone else changed the agent at the same time. Try again |
| `422` | `INVALID_ESCALATION` | The escalation doesn't exist in the workspace or is archived. `details.escalations` lists each one with `reason`: `not_found` or `archived` |
| `422` | `INVALID_CONFIG` | The agent would go over 20 connected escalations |
| `503` | `SUPPORT_SERVICE_UNAVAILABLE` | The escalation couldn't be checked. Nothing was published; try again |

The format and codes for the rest of the API are in [Errors](/api-reference/errors).

## Notes

- It needs the Agents permission and being able to edit the agent.
- Connecting an escalation doesn't copy it: if you [edit the escalation](/api-reference/escalations/update), the change applies on all the agents that have it.
- Connecting an escalation doesn't turn assistance on. If `assistanceEnabled` is `false`, the agent doesn't escalate: turn it on with `assistance.enabled` in the [draft](/api-reference/agents/drafts/update) and publish. The complete steps are in [Leave an agent escalating](/api-reference/escalations#set-up-an-agent-to-escalate-step-by-step).
- From an AI agent, the tool is [`connect_agent_escalation`](/mcp/tools#escalations).
