Skip to navigation

Initiate a call

View as Markdown

Initiates a call using the specified agent. Requires API key authentication. Call initiation is rate limited per API key (default: 1 per 20 seconds; configurable per key). Other endpoints: 1 request per second per API key. Request body may include agent_args as a JSON object {} (e.g. {“contact_name”: “John”, “order_id”: “123”}); agent_args is not an array.

Calling hours. An immediate call (no scheduled_at) is placed only between 09:05 and 20:55 local time of the called number’s country; for a country with several time zones the window must hold in all of them. Outside it the request gets a 400 with code: "OUTSIDE_CALLING_HOURS" and next_allowed_at (ISO time when it would be allowed). Scheduled calls are not affected. Accounts that need other hours can ask us to switch this off.

Authentication

X-API-Keystring

API key for authentication. Example: raya_ABCD1234567890abcdef

Request

This endpoint expects an object.
agent_idstringRequired
The agent ID to use for the call
to_numberstringRequiredformat: "^\d{10}$"

Phone number - must be exactly 10 digits

agent_argsmap from strings to anyOptional

Optional JSON object with agent-specific arguments (e.g. contact_name, order_id). Must be an object , not an array.

out_didstringOptional

Outbound DID (must be assigned to the customer)

country_codestringOptionalDefaults to 91

Country code (only “91” is currently supported, defaults to “91”)

timezonestringOptionalDefaults to Asia/Kolkata

IANA timezone (e.g., “Asia/Kolkata” for IST, defaults to “Asia/Kolkata”)

Response

Call initiated successfully
messagestring
uuidstring
The UUID of the originated call

Errors

400
Bad Request Error
401
Unauthorized Error
429
Too Many Requests Error
500
Internal Server Error