Chats & Sessions

By Orqestra · Published September 2, 2026

Overview

Read conversations and their message history, manage the agent session attached to a chat, assign a chat to a teammate, and escalate to a human when automation has gone as far as it usefully can.

8 endpoints. Requires chats.view or chats.assign on the token.

MethodPathWhat it does
GET/chatsList chats
GET/chats/{id}Get chat details
POST/chats/{id}/assignAssign or unassign a chat
POST/chats/{id}/de-escalateClear escalation from a chat
POST/chats/{id}/escalateEscalate a chat to human agent
GET/chats/{id}/messagesGet chat message history
GET/chats/sessionGet active session
POST/chats/sessionManage session

Endpoints

GET /chats

List chats

List chats with rich filtering options including escalation status, assigned agent, and channel type. Requires `chats.view` permission.

Requires the chats.view permission.

ParameterInTypeRequiredDescription
waIdquerystringoptionalFilter by contact WhatsApp ID (phone number)
contactIdquerystringoptionalFilter by contact ID
channelIdquerystringoptionalFilter by OrgChannel ID
channelqueryWHATSAPP · INSTAGRAMoptionalFilter by channel type
needsEscalationquerytrue · falseoptionalFilter by escalation status
assigneeIdquerystringoptionalFilter by assigned agent ID
pagequeryintegeroptionalPage number Defaults to 1.
limitqueryintegeroptionalItems per page (max 100) Defaults to 20.

Example

curl -X GET "https://orqestra.id/api/v2/chats" \
  -H "Authorization: Bearer $ORQESTRA_TOKEN"

Responds with 200 · 401 · 403. Try it in the playground →


GET /chats/{id}

Get chat details

Get full chat details including escalation status, active session info, and contact details. Requires `chats.view` permission.

Requires the chats.view permission.

ParameterInTypeRequiredDescription
idpathstringrequiredChat ID (cuid)

Example

curl -X GET "https://orqestra.id/api/v2/chats/$id" \
  -H "Authorization: Bearer $ORQESTRA_TOKEN"

Responds with 200 · 401 · 403 · 404. Try it in the playground →


POST /chats/{id}/assign

Assign or unassign a chat

Assign a chat to an agent, or unassign by passing `agentId: null`. Requires `chats.assign` permission.

Requires the chats.assign permission.

ParameterInTypeRequiredDescription
idpathstringrequiredChat ID (cuid)

Request body

FieldTypeRequiredDescription
agentIdstringrequiredAgent user ID to assign, or null to unassign

Example

curl -X POST "https://orqestra.id/api/v2/chats/$id/assign" \
  -H "Authorization: Bearer $ORQESTRA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "cl9x..."
  }'

Responds with 200 · 400 · 401 · 403 · 404. Try it in the playground →


POST /chats/{id}/de-escalate

Clear escalation from a chat

Remove the escalation flag from a chat. Requires `chats.assign` permission.

Requires the chats.assign permission.

ParameterInTypeRequiredDescription
idpathstringrequiredChat ID (cuid)

Request body

FieldTypeRequiredDescription
reasonstringoptionalOptional reason for clearing escalation

Example

curl -X POST "https://orqestra.id/api/v2/chats/$id/de-escalate" \
  -H "Authorization: Bearer $ORQESTRA_TOKEN"

Responds with 200 · 400 · 401 · 403 · 404. Try it in the playground →


POST /chats/{id}/escalate

Escalate a chat to human agent

Flag a chat for agent escalation. Ends any active AI/flow session and triggers auto-assignment rules. Requires `chats.assign` permission.

Requires the chats.assign permission.

ParameterInTypeRequiredDescription
idpathstringrequiredChat ID (cuid)

Request body

FieldTypeRequiredDescription
reasonstringoptionalOptional escalation reason shown to agents

Example

curl -X POST "https://orqestra.id/api/v2/chats/$id/escalate" \
  -H "Authorization: Bearer $ORQESTRA_TOKEN"

Responds with 200 · 400 · 401 · 403 · 404 · 429. Try it in the playground →


GET /chats/{id}/messages

Get chat message history

Retrieve paginated message history using cursor-based pagination. Returns newest first. Requires `chats.view` permission.

Requires the chats.view permission.

ParameterInTypeRequiredDescription
idpathstringrequiredChat ID (cuid)
takequeryintegeroptionalNumber of messages to return (max 100) Defaults to 50.
cursorquerystringoptionalMessage ID to paginate from (exclusive)

Example

curl -X GET "https://orqestra.id/api/v2/chats/$id/messages" \
  -H "Authorization: Bearer $ORQESTRA_TOKEN"

Responds with 200 · 400 · 401 · 403 · 404. Try it in the playground →


GET /chats/session

Get active session

Check if a contact has an active chat session. Identify the contact by `contactId`, `waId`, or `igId`. Optionally scope lookup to a specific channel via `channelId`.

Requires the chats.view permission.

ParameterInTypeRequiredDescription
waIdquerystringoptionalContact WhatsApp ID (phone number)
igIdquerystringoptionalContact Instagram ID
contactIdquerystringoptionalContact ID (alternative to waId/igId)
channelIdquerystringoptionalOrgChannel ID to scope the chat lookup

Example

curl -X GET "https://orqestra.id/api/v2/chats/session" \
  -H "Authorization: Bearer $ORQESTRA_TOKEN"

Responds with 200 · 400 · 401 · 404. Try it in the playground →


POST /chats/session

Manage session

Start, take over, or end a chat session. Identify contact by `contactId`, `waId`, or `igId`. Optionally scope to a specific channel via `channelId`. Consumes session credits.

Requires the chats.assign permission.

Request body

FieldTypeRequiredDescription
waIdstringoptionalContact WhatsApp ID (phone number)
igIdstringoptionalContact Instagram ID
contactIdstringoptionalContact ID (alternative to waId/igId)
channelIdstringoptionalOrgChannel ID to scope the chat lookup
agentIdstringoptionalAgent ID (required for START and TAKEOVER)
actionSTART · TAKEOVER · ENDoptionalSession action Defaults to "START".

Example

curl -X POST "https://orqestra.id/api/v2/chats/session" \
  -H "Authorization: Bearer $ORQESTRA_TOKEN"

Responds with 200 · 400 · 401 · 403 · 404 · 409. Try it in the playground →