Hand a conversation to your team
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, its id in AGENT_ID and a team member's email.
To use the platform, see Human assistance and Handle cases.
Create the escalation
Escalations are stored in the workspace library and can be shared by agents. Check the list of escalations before creating another one. (Create an escalation)
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." } }'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." }, });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."
Tool:
create_escalation.Keep the response's
idinESCALATION_ID.descriptionis what the agent reads to decide whether to use this escalation: write it as you would explain the situation to a person.prefixis 2 to 4 letters and starts the folio (BIL-0143). WithkeepReplying: falsethe agent pauses and the conversation moves toassistance; withtrueit keeps answering.waitMessageis what it tells the contact when it escalates, and only goes withkeepReplying: false.Let the agent use it
Turn on assistance in the agent's draft, list the escalation and publish. (Update the draft, Publish)
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"await platic.agents.draft.update(agentId, { assistance: { enabled: true, escalations: [{ escalationId: billing.id, enabled: true }] }, }); await platic.agents.publish(agentId);Let the Sales agent escalate with the Billing escalation, and publish it.
Tool:
update_agent_draftandpublish_agent_version.Assistance is part of the agent's configuration, so it goes through the draft and a publication. The shortcut Connect an escalation links one that already exists and publishes right away, but it doesn't turn
assistance.enabledon and it fails with409 DRAFT_PENDINGif the draft has unpublished changes (connect_agent_escalationin MCP).Editing or archiving an escalation later applies right away to the agents that use it, but every open case keeps its own copy.
Find the case
A case opens when the agent triggers the escalation. List the open cases. (List cases)
curl "https://api.platic.ai/v1/cases?status=open" \ -H "Authorization: Bearer $PLATIC_API_KEY"const { data: cases } = await platic.cases.list({ status: "open" }); const caseId = cases[0].id;Show me the open cases.
Tool:
list_cases. To read one with its log it usesget_case.Keep the case's
idinCASE_ID. Filters combine:status,escalationId,contactId,conversationId,assigneeIdandpriority. The list doesn't include the log: read it with Get a case.To open a case yourself, for example when your own system detects the problem, use Open a case (
open_case) with theescalationIdand theconversationId. A customer has at most one open case per escalation.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, Add a note)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." }'await platic.cases.accept(caseId, { userId: "ana@acme.com" }); await platic.cases.addNote(caseId, { text: "The charge was checked: it was duplicated." });Take the Billing case for ana@acme.com and add the note "The charge was checked: it was duplicated."
Tool:
accept_caseandadd_case_note.Taking the case does not send a message to the customer.
notifyCustomer: trueonly records in the response that you want to notify them. Send the message through the conversation yourself (Send a message).Close it and return the conversation to the agent
Choose
reason:resolvedif the issue was resolved,discardedif the case didn't apply (declined in the platform), orunresolvedif it remains unresolved. Include anotefordiscardedandunresolved. (Close a case)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 }'await platic.cases.close(caseId, { reason: "resolved", note: "The invoice was reissued.", returnToAgent: true });Close the Billing case as resolved with the note "The invoice was reissued." and hand the conversation back to the agent.
Tool:
close_case.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 with an instruction so it replies now. Closing one case doesn't return the conversation to the agent while other cases remain open.
Check it worked
Use Get the case 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.
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 | The team takes over: the conversation becomes supervised and a reply the agent is writing stops. |
| 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 | Back to the agent without replying now. The instruction is stored and the agent reads it when the contact writes next. |
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." }' 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.",
}); 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.
Tool: pause_conversation_v2 and resume_conversation_v2. To hand it back without a reply, wait_conversation_v2.
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 with operation=supervised, or assign them to a member.
Next steps
- Receive webhooks to learn about every new case right away.
- Test it before you publish: a scenario can check that the agent escalates when it should.
- Escalations and Cases: every field, limit and lifecycle rule.
- Conversations: pause, resume, wait, assign, tag and archive.