---
docId: doc_0f857fd26b334ae0b14352b09158d2ee
title: Hand a conversation to your team
sidebarTitle: Hand off to your team
description: "Define when to request human assistance and how to take, annotate and close the case."
---

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

# Hand a conversation to your team

<span id="what-youll-build"></span>

Configure when the agent should ask your team for help. When that rule is triggered, Platica opens a case that a person can take, annotate and close.

An **escalation** defines when to ask a person for help, what data to collect, the priority and who to notify. It also determines whether the agent pauses or keeps replying. When triggered, it opens a **case** with a reference number and history.

## Before you start

You need a [published agent](/guides/create-an-agent), its id in `AGENT_ID` and a team member's email.

To use the platform, see [Human assistance](/help/agents/assistance) and [Handle cases](/help/inbox/cases).

<Steps>
<Steps.Step>

**Create the escalation**

Escalations are stored in the workspace library and can be shared by agents. Check the [list of escalations](/api-reference/escalations/list) before creating another one. ([Create an escalation](/api-reference/escalations/create))

<Ways tabs="api,sdk,asistente">
<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": "When the customer reports a mistake on their invoice.",
    "prefix": "BIL",
    "fields": [{ "key": "order", "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." }
  }'
```

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

```ts
import { Platic } from "platic-sdk";

const platic = new Platic({ apiKey: process.env.PLATIC_API_KEY! });
const agentId = process.env.AGENT_ID!;

const billing = await platic.escalations.create({
  name: "Billing",
  description: "When the customer reports a mistake on their invoice.",
  prefix: "BIL",
  fields: [{ key: "order", 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." },
});
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Create an escalation called Billing for when a customer reports a mistake on their invoice. Ask for the order number first, notify billing@acme.com and pause the agent with the message "I am passing you to billing."

</Ways.Say>

Tool: [`create_escalation`](/mcp/tools#create_escalation).

</Ways.Way>
</Ways>

Keep the response's `id` in `ESCALATION_ID`. `description` is what the agent reads to decide whether to use this escalation: write it as you would explain the situation to a person. `prefix` is 2 to 4 letters and starts the folio (`BIL-0143`). With `keepReplying: false` the agent pauses and the conversation moves to `assistance`; with `true` it keeps answering. `waitMessage` is what it tells the contact when it escalates, and only goes with `keepReplying: false`.

</Steps.Step>
<Steps.Step>

**Let the agent use it**

Turn on assistance in the agent's draft, list the escalation and publish. ([Update the draft](/api-reference/agents/drafts/update), [Publish](/api-reference/agents/publications/publish))

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

```bash
curl -X PATCH https://api.platic.ai/v1/agents/$AGENT_ID/draft \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "assistance": { "enabled": true, "escalations": [{ "escalationId": "'$ESCALATION_ID'", "enabled": true }] } }'

curl -X POST https://api.platic.ai/v1/agents/$AGENT_ID/publication \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

```ts
await platic.agents.draft.update(agentId, {
  assistance: { enabled: true, escalations: [{ escalationId: billing.id, enabled: true }] },
});
await platic.agents.publish(agentId);
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Let the Sales agent escalate with the Billing escalation, and publish it.

</Ways.Say>

Tool: [`update_agent_draft`](/mcp/tools#update_agent_draft) and [`publish_agent_version`](/mcp/tools#publish_agent_version).

</Ways.Way>
</Ways>

<Collapsible summary="Use the shortcut to connect an existing escalation">

Assistance is part of the agent's configuration, so it goes through the draft and a publication. The shortcut [Connect an escalation](/api-reference/agents/escalations/connect) links one that already exists and publishes right away, but it doesn't turn `assistance.enabled` on and it fails with `409 DRAFT_PENDING` if the draft has unpublished changes (`connect_agent_escalation` in MCP).

</Collapsible>

Editing or archiving an escalation later applies right away to the agents that use it, but every open case keeps its own copy.

</Steps.Step>
<Steps.Step>

**Find the case**

A case opens when the agent triggers the escalation. List the open cases. ([List cases](/api-reference/cases/list))

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

```bash
curl "https://api.platic.ai/v1/cases?status=open" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

```ts
const { data: cases } = await platic.cases.list({ status: "open" });
const caseId = cases[0].id;
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Show me the open cases.

</Ways.Say>

Tool: [`list_cases`](/mcp/tools#list_cases). To read one with its log it uses [`get_case`](/mcp/tools#get_case).

</Ways.Way>
</Ways>

Keep the case's `id` in `CASE_ID`. Filters combine: `status`, `escalationId`, `contactId`, `conversationId`, `assigneeId` and `priority`. The list doesn't include the log: read it with [Get a case](/api-reference/cases/get).

To open a case yourself, for example when your own system detects the problem, use [Open a case](/api-reference/cases/open) (`open_case`) with the `escalationId` and the `conversationId`. A customer has at most one open case per escalation.

</Steps.Step>
<Steps.Step>

**Take it and leave a note**

Whoever takes the case is assigned to it, and the conversation moves to `supervised`: a person handles it. With an API key you must say who (`userId`, an id or the email of a member). ([Take a case](/api-reference/cases/take), [Add a note](/api-reference/cases/add-note))

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

```bash
curl -X POST https://api.platic.ai/v1/cases/$CASE_ID/accept \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "userId": "ana@acme.com" }'

curl -X POST https://api.platic.ai/v1/cases/$CASE_ID/notes \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "text": "The charge was checked: it was duplicated." }'
```

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

```ts
await platic.cases.accept(caseId, { userId: "ana@acme.com" });
await platic.cases.addNote(caseId, { text: "The charge was checked: it was duplicated." });
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Take the Billing case for ana@acme.com and add the note "The charge was checked: it was duplicated."

</Ways.Say>

Tool: [`accept_case`](/mcp/tools#accept_case) and [`add_case_note`](/mcp/tools#add_case_note).

</Ways.Way>
</Ways>

Taking the case does not send a message to the customer. `notifyCustomer: true` only records in the response that you want to notify them. Send the message through the conversation yourself ([Send a message](/api-reference/messages/send)).

</Steps.Step>
<Steps.Step>

**Close it and return the conversation to the agent**

Choose `reason`: `resolved` if the issue was resolved, `discarded` if the case didn't apply (declined in the platform), or `unresolved` if it remains unresolved. Include a `note` for `discarded` and `unresolved`. ([Close a case](/api-reference/cases/close))

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

```bash
curl -X POST https://api.platic.ai/v1/cases/$CASE_ID/close \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "resolved", "note": "The invoice was reissued.", "returnToAgent": true }'
```

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

```ts
await platic.cases.close(caseId, { reason: "resolved", note: "The invoice was reissued.", returnToAgent: true });
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Close the Billing case as resolved with the note "The invoice was reissued." and hand the conversation back to the agent.

</Ways.Say>

Tool: [`close_case`](/mcp/tools#close_case).

</Ways.Way>
</Ways>

With `returnToAgent: true`, the agent resumes on the customer's next message if this was the last open case and a person was handling the conversation. It doesn't send an immediate reply. To notify the customer, send a message yourself, or [resume the agent](/api-reference/conversations/resume) with an instruction so it replies now. Closing one case doesn't return the conversation to the agent while other cases remain open.

</Steps.Step>
</Steps>

## Check it worked

Use [Get the case](/api-reference/cases/get) to check the `closed` status and closing note in its log. If it was the last open case and you used `returnToAgent: true` in a supervised conversation, check that the conversation returned to `automatic`.

A closed case is read-only and can't be reopened.

Subscribe a webhook to `case.created`, `case.updated`, `case.assigned`, `case.note.created` and `case.closed` to follow cases from your own system: see [Receive webhooks](/guides/webhooks).

<span id="take-over-a-conversation"></span>

## Take over a conversation without a case

Your team can also take a conversation from the agent at any moment, with no escalation, and hand it back later. Use the conversation's `id`.

| Action | What happens |
|---|---|
| [Pause](/api-reference/conversations/pause) | The team takes over: the conversation becomes `supervised` and a reply the agent is writing stops. |
| [Resume](/api-reference/conversations/resume) | Back to the agent (`automatic`), which replies to the contact **now**, following the optional `instruction`. On a conversation that is already automatic it changes nothing. |
| [Wait](/api-reference/conversations/wait) | Back to the agent **without replying now**. The `instruction` is stored and the agent reads it when the contact writes next. |

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

```bash
curl -X POST https://api.platic.ai/v2/conversations/$CONVERSATION_ID/pause \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

curl -X POST https://api.platic.ai/v2/conversations/$CONVERSATION_ID/resume \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "instruction": "Apologize for the delay and confirm the refund date." }'
```

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

```ts
const conversationId = process.env.CONVERSATION_ID!;

await platic.conversations.pause(conversationId);

// The agent replies now, following the instruction.
await platic.conversations.resume(conversationId, {
  instruction: "Apologize for the delay and confirm the refund date.",
});

// Or: hand it back without replying now; the agent reads the note on the contact's next message.
await platic.conversations.wait(conversationId, {
  instruction: "The refund was approved on Monday; confirm it if they ask.",
});
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Pause the agent in Ana's conversation. When I say so, hand it back and have it apologize for the delay and confirm the refund date.

</Ways.Say>

Tool: [`pause_conversation_v2`](/mcp/tools#pause_conversation_v2) and [`resume_conversation_v2`](/mcp/tools#resume_conversation_v2). To hand it back without a reply, [`wait_conversation_v2`](/mcp/tools#wait_conversation_v2).

</Ways.Way>
</Ways>

Each answer is the conversation afterwards, with `meta.changed`: pausing a conversation that is already supervised answers `changed: false` and does nothing. Send an `Idempotency-Key` on `resume`: without it, a retry after a lost answer could make the agent reply twice. The SDK sends one for you. To find the conversations your team is handling, [list conversations](/api-reference/conversations/list) with `operation=supervised`, or [assign them](/api-reference/conversations/assignees) to a member.

## Next steps

- [Receive webhooks](/guides/webhooks) to learn about every new case right away.
- [Test it before you publish](/guides/evals): a scenario can check that the agent escalates when it should.
- [Escalations](/api-reference/escalations) and [Cases](/api-reference/cases): every field, limit and lifecycle rule.
- [Conversations](/api-reference/conversations): pause, resume, wait, assign, tag and archive.
