Skip to content

Error Responses

The API uses standard HTTP status codes and returns error details in JSON format.

Invalid or missing API token:

{
"success": false,
"message": "Unauthorized"
}

Voice must have at least one dynamic part with digit mode:

{
"success": false,
"message": "Voice must have at least one dynamic part with digit mode for OTP broadcast"
}

Duplicate phone numbers found in the request:

{
"success": false,
"message": "Duplicate phone number found",
"duplicated_number": "019XXXXXXXX"
}

Direct broadcast audio must be G.711-compatible (WAV, 8000 Hz, mono, pcm_s16le). Each failed URL is listed:

{
"success": false,
"message": "Audio file validation failed. Files must be in G.711-compatible format (WAV, 8000Hz, Mono, pcm_s16le)",
"errors": [
{
"field": "voices[0]",
"url": "https://cdn.example.com/audio/announcement.wav",
"issue": "Invalid sample rate. Expected: 8000Hz, Found: 44100Hz"
}
]
}

Insufficient balance to process the broadcast:

{
"success": false,
"message": "Insufficient balance"
}

Voice not found, not approved, or sender not active:

{
"success": false,
"message": "Voice not found or not approved"
}

Duplicate request - request_id already used within 15 minutes:

{
"success": false,
"message": "Request already processed"
}

Broadcast or survey not found or access denied:

{
"success": false,
"message": "Broadcast not found"
}

Server error occurred while processing the request:

{
"success": false,
"message": "Failed to create OTP broadcast"
}

Call-center SDK routes and GET /api/cc/agents/:agent_id/calls return { "error", "code" } rather than { "success": false, "message" }.

POST /api/sdk/session when the token is missing, already used, or expired:

{
"error": "invalid or expired token",
"code": "token_invalid"
}

Agent is not active (when creating a token) or was deactivated after the token was created (when connecting):

{
"error": "agent not active",
"code": "agent_inactive"
}

POST /api/sdk/session when the page is not on HTTPS, or its hostname is not on your Call SDK allowed-domain list (and test mode is off):

{
"error": "origin not allowed for this account",
"code": "origin_not_allowed"
}

POST /api/sdk/token, DELETE /api/sdk/session, and GET /api/cc/agents/:agent_id/calls when agent_id does not belong to your account:

{
"error": "agent not found",
"code": "agent_not_found"
}

Survey template not found or not in published status:

{
"success": false,
"message": "Template not found or not published"
}

Sender number not found or not active:

{
"success": false,
"message": "Sender not found or not active"
}