---
docId: doc_e38c9712ce524f9997233e8cb05c60a3
title: Create an escalation
description: Create an escalation in the workspace library. Then connect it to the agents that can use it.
api:
  group: escalaciones
  auth: bearer
  operations:
    - operationId: createEscalation
      method: POST
      path: /v1/escalations
      postmanName: Create an Escalation
---

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

# Create an escalation

Create a rule for requesting help by sending `name`, `description` and `prefix`. Use `description` to explain when the agent should use it. Then [connect it to the agent](/api-reference/agents/escalations/connect) so it can use the rule.

You can open cases through the API as soon as it exists, unless `allowManual` is `false`.

## Example

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

```bash
curl https://api.platic.ai/v1/escalations \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Billing",
    "description": "The customer disputes a charge",
    "prefix": "BIL"
  }'
```

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

```ts
await platic.escalations.create({
  name: "Billing",
  description: "The customer disputes a charge",
  prefix: "BIL",
});
```

</Ways.Way>
</Ways>

## Request body

```json
{
  "name": "Invoice error",
  "description": "The customer says their invoice has a wrong detail (tax ID, company name or amount) and asks to fix it.",
  "prefix": "INV",
  "color": "#2563EB",
  "fields": [
    { "key": "order_number", "label": "Order number", "kind": "text", "required": true },
    { "key": "tax_id", "label": "Correct tax ID", "kind": "text", "required": true },
    { "key": "email", "label": "Email for the invoice", "kind": "email", "customFieldId": "billing_email" }
  ],
  "assignment": { "mode": "contact_owner", "userIds": ["billing@acme.com"] },
  "agent": {
    "keepReplying": false,
    "waitMessage": "I passed your case to the billing team. They will write to you as soon as they can."
  }
}
```

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | ✓ | Name of the escalation, from 1 to 80 characters |
| `description` | string | ✓ | When it is escalated, from 1 to 2,000 characters. The agent reads it to decide whether to use this escalation: write it as you would explain the situation to a person |
| `prefix` | string | ✓ | 2 to 4 letters. It is saved in uppercase and goes at the start of the case number (`INV-0143`) |
| `color` | string | - | Color in `#RRGGBB`. Default, `#64748B` |
| `fields` | array | - | Up to 20 data points to collect before opening the case. See below. Default, none |
| `defaultPriority` | string | - | `low`, `normal`, `high` or `urgent`. Default, `normal` |
| `assignment` | object | - | Who handles the case. The case always goes to the contact's owners (the owners of the conversation, the contact and the agent); the escalation only adds people. Default, `{ "mode": "contact_owner" }` |
| `assignment.mode` | string | ✓ | `contact_owner`: the contact's owners plus the people in `userIds`. `fixed` is deprecated: it is accepted for compatibility, requires at least one person in `userIds` and assigns the same as `contact_owner` |
| `assignment.userIds` | array | - | Up to 50 people the escalation adds to the contact's owners: user id or email of a member. Default, none |
| `agent` | object | - | What the agent does while the case is open |
| `agent.keepReplying` | boolean | - | `true`: it keeps answering. `false`: it pauses and the conversation moves to `assistance`. Default, `true` |
| `agent.canClose` | boolean | - | `true`: the agent can close the case, only as `resolved`. Default, `false` |
| `agent.waitMessage` | string \| null | - | Only with `keepReplying: false`: what the agent tells the contact when escalating with this escalation, up to 500 characters. Without `keepReplying: false` it answers `400` |
| `lifecycle` | object | - | Deadlines for closing or discarding cases |
| `lifecycle.inactivityCloseHours` | number \| null | - | From 1 to 720 hours without activity (neither on the case nor on the conversation) after which it closes on its own as `expired`. Default, `null` (off) |
| `lifecycle.maxOpenDays` | number | - | From 1 to 90 days. When they pass it closes on its own as `expired`. Default, `14` |
| `lifecycle.untakenDiscardHours` | number \| null | - | Period to discard the case automatically if nobody takes it: `24`, `48`, `72` (3 days, default) or `168` (7 days). Halfway through the period the owners are warned. `null` turns it off |
| `allowManual` | boolean | - | `true`: a person or the API can also open cases of this escalation by hand. `false`: only the agent uses it, and [open a case](/api-reference/cases/open#response) answers `manual_not_allowed`. Default, `true` |

Each element of `fields`:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `key` | string | ✓ | Key of the data point in `snake_case`: starts with a lowercase letter, up to 40 characters. It does not repeat within the escalation |
| `label` | string | ✓ | What the data point is called, from 1 to 80 characters. It is what the agent asks for |
| `kind` | string | ✓ | `text`, `email`, `number`, `phone` or `date` |
| `required` | boolean | - | `true`: the case is not opened without this data point. Default, `false` |
| `customFieldId` | string \| null | - | The `id` of a contact [custom field](/api-reference/custom-fields/list). If the contact already has it, the data point is filled in with that value and not asked for again; what is collected is saved on the contact according to `sync`. Without it, the data point is not linked |
| `sync` | string | - | With `customFieldId`: `fill_empty` saves the data on the contact only if its field is empty; `overwrite` always replaces it. Default, `fill_empty` |

<Note type="tip">

The type of each data point (`kind`) tells the agent what to ask for. Opening a case checks that required data is present, without validating its format.

</Note>

## Response

`201 Created` with the escalation, its defaults already set.

```json
{
  "status": "success",
  "data": {
    "id": "Et7hQ2mVx9LpRk3s",
    "workspaceId": "Wk5rT8yUi2OpAs4d",
    "name": "Invoice error",
    "description": "The customer says their invoice has a wrong detail (tax ID, company name or amount) and asks to fix it.",
    "prefix": "INV",
    "color": "#2563EB",
    "fields": [
      {"key": "order_number", "label": "Order number", "kind": "text", "required": true, "customFieldId": null, "sync": "fill_empty"},
      {"key": "tax_id", "label": "Correct tax ID", "kind": "text", "required": true, "customFieldId": null, "sync": "fill_empty"},
      {"key": "email", "label": "Email for the invoice", "kind": "email", "required": false, "customFieldId": "billing_email", "sync": "fill_empty"}
    ],
    "defaultPriority": "normal",
    "assignment": {
      "mode": "contact_owner",
      "userIds": ["Us9fG3hJ6kL2mN8b"],
      "userEmails": ["billing@acme.com"]
    },
    "agent": {
      "keepReplying": false,
      "canClose": false,
      "waitMessage": "I passed your case to the billing team. They will write to you as soon as they can."
    },
    "lifecycle": {"inactivityCloseHours": null, "maxOpenDays": 14, "untakenDiscardHours": 72},
    "allowManual": true,
    "status": "active",
    "createdAt": "2026-11-10T16:20:00.000Z",
    "createdBy": {"kind": "api", "id": "Ak7Pz2Lm9Qx4Wc6e"},
    "updatedAt": "2026-11-10T16:20:00.000Z",
    "updatedBy": {"kind": "api", "id": "Ak7Pz2Lm9Qx4Wc6e"},
    "archivedAt": null
  }
}
```

`data` is the escalation, with the fields in [get an escalation](/api-reference/escalations/get#response).

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | A required field is missing, one is not valid or the body has an unknown one. Also: a repeated `key`, a person who is not a member of the workspace or `agent.waitMessage` without `agent.keepReplying: false`. `details.issues` says what |
| `400` | `CUSTOM_FIELD_NOT_FOUND` | A data point has a `customFieldId` that does not exist in the workspace. `details.issues` says which |
| `400` | `CUSTOM_FIELD_INCOMPATIBLE` | The data point's `kind` does not match the custom field's type: for example, an `email` data point linked to a `number` field. `details.issues` says which |
| `403` | `FORBIDDEN` | With an OAuth token, the person is not an owner or administrator of the workspace |

The errors that come up on any operation are in the [cases introduction](/api-reference/cases#common-errors).

## Notes

- Before creating one, check the [library](/api-reference/escalations/list): escalations belong to the workspace and agents share them, so reuse the one that already covers the situation.
- For an agent to use it, [connect it](/api-reference/agents/escalations/connect). The complete steps are in [set up an agent to escalate](/api-reference/escalations#set-up-an-agent-to-escalate-step-by-step).
- From an AI agent, the tool is [`create_escalation`](/mcp/tools#escalations).
