Skip to content

Answer, reject, hang up, hold or resume

POST
/v1/calls/{callId}/{action}
curl --request POST \
--url https://your-machine.your-tailnet.ts.net/v1/calls/example/answer \
--header 'Authorization: Bearer <token>'

Sends the action to the phone. 202 means the phone received it; the resulting state change arrives as a webhook. answer and reject apply to ringing incoming calls.

callId
required
string
action
required
string
Allowed values: answer reject hangup hold unhold

The phone received the command.

Media typeapplication/json
object
accepted
boolean
command
object
type
string
Allowed value: command
commandId
string format: uuid
callId
string
action
string
Allowed values: dial answer reject hangup hold unhold dtmf
payload
object
key
additional properties
any
call
object
id
required
string
deviceId
required
string
remoteNumber
required
string
direction
required
string
Allowed values: outgoing incoming
state
required
string
Allowed values: queued dialing ringing active held ended rejected failed
nativeCallId
string
webhookUrl
string format: uri
metadata
object
key
additional properties
any
stream

Your agent’s WebSocket. The gateway connects to it when the call is answered.

object
url
required

ws:// or wss://.

string
format

raw: 16 kHz s16le binary frames. twilio: Twilio Media Streams JSON with 8 kHz mu-law, compatible with Twilio integrations such as Pipecat’s.

string
default: raw
Allowed values: raw twilio
parameters

Sent to your agent in the start message (Twilio customParameters).

object
key
additional properties
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
answeredAt
string format: date-time
endedAt
string format: date-time

Example

{
"accepted": true,
"command": {
"type": "command",
"action": "dial"
},
"call": {
"remoteNumber": "+919876543210",
"direction": "outgoing",
"state": "queued",
"stream": {
"url": "wss://agent.example.com/ws",
"format": "raw"
}
}
}

The request didn’t validate.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
issues

Validation details

Array

Example

{
"error": {
"code": "VALIDATION_ERROR",
"message": "invalid request",
"issues": []
}
}

Missing or invalid API key.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
issues

Validation details

Array

Example

{
"error": {
"code": "UNAUTHORIZED",
"message": "invalid API key or session"
}
}

Not found.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
issues

Validation details

Array

Example

{
"error": {
"code": "NOT_FOUND",
"message": "call not found"
}
}

The phone isn’t connected to the gateway.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
issues

Validation details

Array

Example

{
"error": {
"code": "DEVICE_OFFLINE",
"message": "device is offline"
}
}