---
docId: doc_ca42336948344aa5b5c50737d9816734
title: Escalations
description: Define when an agent escalates a conversation to your team, what data it collects and who the case is assigned to.
---

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

# Escalations

Define when an agent should ask your team for help, what data it must collect and whether it keeps replying while someone handles the case. [Find an escalation](/api-reference/escalations/list) that already covers the situation or [create one](/api-reference/escalations/create), then connect it to the agent.

Agents can share the same workspace escalation. Each time it is triggered, it opens a [case](/api-reference/cases) with a case number and a log. The API uses `clients` for contacts.

## Example

<span id="set-up-an-agent-to-escalate-step-by-step"></span>

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

```bash
# 1. Create the escalation in the library
curl -X POST https://api.platic.ai/v1/escalations \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Billing",
    "description": "When the customer reports an error on their invoice.",
    "prefix": "BIL",
    "fields": [{ "key": "order_number", "label": "Order number", "kind": "text", "required": true }],
    "agent": { "keepReplying": false, "waitMessage": "I am passing you to billing." }
  }'

# 2. Connect it to an agent that is already published (no pending changes in the draft)
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
// 1. Create the escalation in the library
const billing = await platic.escalations.create({
  name: "Billing",
  description: "When the customer reports an error on their invoice.",
  prefix: "BIL",
  fields: [{ key: "order_number", label: "Order number", kind: "text", required: true }],
  assignment: { mode: "contact_owner", userIds: ["billing@acme.com"] },
  agent: { keepReplying: false, waitMessage: "I am passing you to billing." },
});

// 2. Connect it to the agent (publishes right away) and turn on assistance if it was off
await platic.agents.draft.update(agentId, {
  assistance: { enabled: true, escalations: [{ escalationId: billing.id, enabled: true }] },
});
await platic.agents.publish(agentId);
```

</Ways.Way>
</Ways>

## What you need to know

- **Reuse first:** check the [list of escalations](/api-reference/escalations/list) before creating another; several agents can share the same escalation.
- **It does not break open cases:** [editing](/api-reference/escalations/update) or [archiving](/api-reference/escalations/archive) an escalation applies right away to the agents, but each open case keeps its own copy (`escalationSnapshot`).
- **Fields linked to the contact:** use `fields[].customFieldId` (from [custom fields](/api-reference/custom-fields/list)) to take data the contact already has and to save back what the agent collects (`sync: "fill_empty"` or `"overwrite"`).
- **Enable assistance:** [create an agent](/api-reference/agents/create) with `assistance` enabled, or [edit its draft](/api-reference/agents/drafts/update) and [publish](/api-reference/agents/publications/publish) to enable it.
- **Connect an escalation:** [Connect an escalation](/api-reference/agents/escalations/connect) links an escalation and publishes immediately. It returns `409 DRAFT_PENDING` if the draft has unpublished changes; it does not enable `assistance.enabled`.
- **Permissions:** requires the **Conversations** module (creating, editing and archiving require the owner or administrator role on OAuth; an API key always can). Connecting to an agent requires the **Agents** permission.

## Endpoints

| Method | Endpoint | What it does |
|--------|----------|--------------|
| `GET` | [`/v1/escalations`](/api-reference/escalations/list) | List the workspace's escalations |
| `POST` | [`/v1/escalations`](/api-reference/escalations/create) | Create an escalation |
| `GET` | [`/v1/escalations/{escalationId}`](/api-reference/escalations/get) | Get an escalation |
| `PATCH` | [`/v1/escalations/{escalationId}`](/api-reference/escalations/update) | Edit an escalation |
| `POST` | [`/v1/escalations/{escalationId}/archive`](/api-reference/escalations/archive) | Archive an escalation |

Connect escalations to each agent in [Agent escalations](/api-reference/agents/escalations/list), manage open cases in [Cases](/api-reference/cases), check codes in [Errors](/api-reference/errors#cases-and-escalations) and use it from AI in [Escalations MCP](/mcp/tools#escalations).
