Every type below is a serde envelope. Fields are encoded in the order listed. See Envelope Format for primitive encodings.

Enums

ErrorCode (encoded as int32)

ValueNameMeaning
0SUCCESSRequest accepted.
1ERR_INVALID_TRUNKUnknown or unauthorized trunk_id.
2ERR_INVALID_DESTINATIONto could not be parsed or routed.
3ERR_RATE_LIMITEDPer-tenant CPS budget exhausted.
4ERR_CIRCUIT_BREAKERTrunk is unhealthy; gateway is shedding load.
5ERR_INTERNAL_ERRORUnspecified gateway-side failure.
6ERR_VALIDATION_FAILEDDTO failed schema validation.
7ERR_UNAUTHORIZEDJWT missing, expired, or wrong tenant.

DialplanAction (encoded as int32)

Values 0-6 are usable as default_app on Originate. Values 7-12 are call-control verbs — only valid through ExecuteDialplan against an active call_sid.
ValueNameNotes
0HANGUP
1PARK
2MUSIC_ON_HOLD
3PLAYBACKapp_args = absolute path to .wav
4UNPARK_AND_BRIDGEapp_args = target call_sid
5ANSWER
6AI_BIDIRECTIONAL_STREAMapp_args = agent_id
7TRANSFERRFC 3515 SIP REFER. app_args = destination URI or E.164.
8MUTEapp_args = "" (gateway-side TX silence) or "wire" (also recvonly re-INVITE).
9UNMUTESame app_args shape as MUTE.
10HOLDsendrecv → sendonly re-INVITE; opposite leg gets MOH if trunk-configured.
11UNHOLDLifts a previous HOLD.
12SEND_DTMFapp_args = "<digit>:<mode>:<duration_ms>" (mode = rfc2833 | info; inband is not supported today).

InboundRule (encoded as int32)

ValueName
0REJECT
1PLAY_AND_HANGUP
2NOTIFY_AND_HANGUP
3HANDLE_AI

EventType (encoded as int32)

ValueName
0UNKNOWN
1CHANNEL_CREATE
2CHANNEL_ANSWER
3CHANNEL_HANGUP_COMPLETE
4CHANNEL_HOLD
5CHANNEL_RESUME

Request DTOs

OriginateRequest

FieldTypeNotes
trunk_idstringConfigured outbound trunk to use.
tostringE.164 number or full SIP URI.
call_fromstringCaller-ID. Subject to per-trunk allow-listing.
ai_websocket_urlstringIf set, gateway dials AI bridge over WS for this call.
ai_quic_urlstringSame, but QUIC. One of the two should be set when using AI_BIDIRECTIONAL_STREAM.
tenant_idstringEchoed for audit; must match JWT tenant.
max_duration_msint32Hard cap. 0 = trunk default.
call_sidstringOptional client-provided idempotency key.
default_appDialplanActionWhat the call lands in once answered. The BFF (telephony.originate) defaults this to AI_BIDIRECTIONAL_STREAM (=6) when omitted. The polyglot SDK signatures default to PARK (=1) at the C-FFI boundary.
default_app_argsstringPer-app argument string (e.g. playback URL, agent_id). With default_app=AI_BIDIRECTIONAL_STREAM and an empty default_app_args the runtime has no agent to bridge — the call answers silent.
auto_barge_inboolAllow late Barge calls without re-handshake.
barge_in_patience_msint32Grace window for the bargee before forced merge.
client_idstringUUID of the SDK process. Routes CallEvents back.

BulkRequest

FieldTypeNotes
csv_urlstringHTTPS URL of a CSV; first column = E.164 destination.
template_trunk_idstringSame as OriginateRequest.trunk_id for every row.
template_tostringOverride the CSV’s to (rarely used).
template_call_fromstring
template_ai_websocket_urlstring
template_ai_quic_urlstring
template_tenant_idstring
template_max_duration_msint32
template_default_appDialplanAction
template_default_app_argsstring
calls_per_secondint32Pacing.
max_concurrent_callsint32Cap on simultaneous in-flight calls.
campaign_idstringUsed by AbortBulk.

Single-field requests

DTOField
AbortBulkRequeststring campaign_id
TerminateRequeststring call_sid
BargeRequeststring call_sid
EventStreamRequeststring client_id
GetIncomingCallsRequeststring trunk_id
BucketRequeststring bucket_id

SetInboundRoutingRequest

FieldType
trunk_idstring
ruleInboundRule
audio_urlstring
webhook_urlstring
ai_websocket_urlstring
ai_quic_urlstring

AnswerIncomingCallRequest

FieldType
call_sidstring
ai_websocket_urlstring
ai_quic_urlstring

BucketActionRequest

FieldTypeNotes
bucket_idstring
actionint320=hangup, 1=unpark+bridge, 2=playback

ExecuteDialplanRequest

FieldType
call_sidstring
actionDialplanAction
app_argsstring

Response DTOs

OriginateResponse / TerminateResponse / AnswerIncomingCallResponse

FieldType
call_sidstring
statusstring
error_messagestring
error_codeErrorCode
timestamp_msint64

BulkResponse

FieldType
statusstring
loaded_numbersint32

GetIncomingCallsResponse

FieldType
callsvector<IncomingCallInfo>

IncomingCallInfo

FieldType
call_sidstring
call_fromstring
start_timestamp_msint64

ListBucketsResponse

FieldType
bucketsvector<BucketInfo>

BucketInfo

FieldType
bucket_idstring
pending_countint32

BucketCallList

FieldType
call_sidsvector<string>

BucketActionResponse

FieldType
processed_countint32

ExecuteDialplanResponse

FieldType
statusstring
error_messagestring
error_codeErrorCode

Empty

No fields. The serde envelope is just the 6-byte header (v=0, cv=0, payload_size=0).

Streaming DTOs

AudioFrame — see Audio Frames

CallEvent — see Events