Agent BrainsAgent Brains
APIConversations

Update conversation control

Switch an active web chat between AI and human control using the observed control_version. Required scope: `conversations:write`.

PATCH
/conversations/{id}/control
x-api-key<token>

Preferred authentication header.

In: header

Path Parameters

id*string

Conversation ID from an event or existing conversation record.

Match^[a-fA-F0-9]{24}$
Length24 <= length <= 24

Request Body

application/json

JSON object. Unknown properties are rejected.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://api.agent-brains.com/conversations/stringstringstringstring/control" \  -H "Content-Type: application/json" \  -d '{    "mode": "ai",    "expected_version": 9007199254740991  }'
{
  "id": "string",
  "employee_id": "string",
  "recipient_id": "string",
  "channel": "web-chat",
  "mode": "ai",
  "control_version": 0
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}