Calls

Accept a queued/ringing call and create a room

POST
/api/v1/calls/{id}/accept

Authorization

tenant-api-key
x-api-key<token>

Tenant API key (backend only — never expose to a browser)

In: header

Path Parameters

id*string

Call CUID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/calls/string/accept" \  -H "Content-Type: application/json" \  -d '{    "acceptedByExternalId": "agent_456",    "acceptedByDisplayName": "Dr. Smith"  }'
{  "call": {    "id": "string",    "tenantId": "string",    "roomId": {},    "callerExternalId": "string",    "callerDisplayName": "string",    "callerMetadata": {},    "targetExternalId": {},    "targetDisplayName": {},    "queueName": "string",    "priority": 0,    "skills": [      "string"    ],    "status": "QUEUED",    "acceptedByExternalId": {},    "acceptedByDisplayName": {},    "forwardedToExternalId": {},    "forwardedByExternalId": {},    "queuedAt": "2019-08-24T14:15:22Z",    "ringingAt": {},    "answeredAt": {},    "endedAt": {},    "cancelledAt": {},    "waitDuration": {},    "callDuration": {},    "externalId": {},    "externalMetadata": {},    "notes": {},    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "room": {      "id": "string",      "tenantId": "string",      "name": "string",      "slug": "string",      "livekitRoomName": "string",      "type": "INSTANT",      "maxParticipants": 0,      "enableRecording": true,      "enableChat": true,      "enableScreenShare": true,      "enableWaitingRoom": true,      "enableE2EE": true,      "enableAiFeatures": true,      "allowPublicJoin": true,      "recordingPreset": "string",      "isLocked": true,      "autoRecord": true,      "status": "WAITING",      "scheduledAt": {},      "startedAt": {},      "autoEndAt": {},      "endedAt": {},      "duration": {},      "livekitSid": {},      "activeParticipants": 0,      "reopenCount": 0,      "createdByExternalId": "string",      "externalId": {},      "externalType": {},      "externalMetadata": {},      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "participants": [        {          "id": "string",          "roomId": "string",          "externalUserId": "string",          "displayName": "string",          "avatarUrl": {},          "livekitIdentity": "string",          "livekitSid": {},          "role": "HOST",          "canPublish": true,          "canSubscribe": true,          "canPublishData": true,          "canScreenShare": true,          "canRecord": true,          "isApproved": true,          "approvedBy": {},          "connectionState": "PENDING",          "joinedAt": {},          "leftAt": {},          "duration": {},          "rejoinCount": 0,          "externalRole": {},          "externalMetadata": {},          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z"        }      ]    }  },  "room": {    "id": "string",    "tenantId": "string",    "name": "string",    "slug": "string",    "livekitRoomName": "string",    "type": "INSTANT",    "maxParticipants": 0,    "enableRecording": true,    "enableChat": true,    "enableScreenShare": true,    "enableWaitingRoom": true,    "enableE2EE": true,    "enableAiFeatures": true,    "allowPublicJoin": true,    "recordingPreset": "string",    "isLocked": true,    "autoRecord": true,    "status": "WAITING",    "scheduledAt": {},    "startedAt": {},    "autoEndAt": {},    "endedAt": {},    "duration": {},    "livekitSid": {},    "activeParticipants": 0,    "reopenCount": 0,    "createdByExternalId": "string",    "externalId": {},    "externalType": {},    "externalMetadata": {},    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "participants": [      {        "id": "string",        "roomId": "string",        "externalUserId": "string",        "displayName": "string",        "avatarUrl": {},        "livekitIdentity": "string",        "livekitSid": {},        "role": "HOST",        "canPublish": true,        "canSubscribe": true,        "canPublishData": true,        "canScreenShare": true,        "canRecord": true,        "isApproved": true,        "approvedBy": {},        "connectionState": "PENDING",        "joinedAt": {},        "leftAt": {},        "duration": {},        "rejoinCount": 0,        "externalRole": {},        "externalMetadata": {},        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z"      }    ]  },  "callerToken": "string",  "agentToken": "string",  "livekitUrl": "string"}