Cloud Telephony Webhook

Fast2SMS sends every Cloud Telephony call event (a call comes in, is answered, ends, a caller presses a key in your IVR, a recording is ready) to your webhook URL as a POST request (JSON or URL-encoded) or GET request. Use it to open the caller's record in your CRM, log calls, or save recordings on your own server.

Create the webhook on the dashboard (Webhooks > Create Webhook, service Cloud Telephony) or with the API calls in this section. Cloud Telephony webhooks can be created only on accounts that have Cloud Telephony; other accounts get 400 with Cloud Telephony is not available for this account yet. You can create up to 10 Cloud Telephony webhooks.

Webhook Panel Form Options

When configuring a webhook in the Fast2SMS Dashboard under CREATE WEBHOOK, the fields correspond to the API parameters as follows:

Field Label in UIAPI ParameterDescription
Webhook NamenameFriendly name for internal tracking.
Select ServiceserviceChoose Cloud Telephony to configure Cloud Telephony webhooks.
Select Numberidentity_idall (every number) or one of your Cloud Telephony numbers, e.g. 919000000001, for calls on that number only.
Select FormattemplateStandard Webhook (custom).
Select EventeventDefault All Events (all), or one of incoming, answered, completed, missed, busy, failed, ivr_option, recording_ready.
MethodmethodHTTP method (POST, GET, PUT).
URLurlDestination URL to receive payloads (public https:// or http:// address).
Content-Typecontent_typeJSON, Form URL Encoded or XML.
X-Payload-Transformpayload_transformStandard or Raw JSON. Shown only when Content-Type is Form URL Encoded.
Webhook Status (Active)statusEnable / disable (active / inactive).
BodypayloadCustom payload with the variables below.

Events

EventWhen it is sent
incomingA call comes in on your number (before anyone answers). Incoming calls only.
answeredThe customer side is connected: on an outgoing call the called customer answers; on an incoming call your agent (or the outside number the call is forwarded to) answers.
completedAn answered call has ended (also a transferred call). duration and end_time are filled in.
missedThe call ended without being answered: not answered, or the caller hung up before anyone picked up.
busyThe called number was busy or rejected the call.
failedThe call could not be connected.
ivr_optionThe caller pressed a key in your IVR. The key is in dtmf, the IVR id in ivr.
recording_readyThe call recording is ready. recording_url holds the download link.

Every call ends with one of completed, missed, busy or failed. Calls from blocked (blacklisted) numbers get no end event.


Standard Webhook Payload

Payload Variables

VariableTypeDescription
call_idStringCall id, the same id shown in Cloud Telephony > Call History
request_idStringSame value as call_id
directionStringinbound (incoming call) or outbound (outgoing call)
fromStringCalling number, as reported by the network (e.g. 919999999999)
toStringCalled number
mobileStringThe customer's number: from on an inbound call, to on an outbound call
didStringYour Cloud Telephony number used for the call (the number called on inbound, the caller ID shown on outbound)
agentStringName of the team member on the call, Main Admin for the account owner's browser phone, empty when no agent took the call
statusStringThe event: incoming, answered, completed, missed, busy, failed, ivr_option or recording_ready
descriptionStringEvent in words: Incoming call, Call answered, Call completed, Call missed, Number busy, Call failed, Caller pressed a key in the IVR, Recording ready
durationIntegerCall length in seconds (0 until the call ends)
start_timeStringWhen the call started, YYYY-MM-DD HH:MM:SS IST
answer_timeStringWhen the call was answered, YYYY-MM-DD HH:MM:SS IST (empty when not answered)
end_timeStringWhen the call ended, YYYY-MM-DD HH:MM:SS IST (empty while the call is live)
recording_urlStringLink to the call recording (MP3), empty when the call has no recording yet. The link is signed and works without a login for 7 days; after that, play the recording from Call History. Recordings are kept for 3 months.
dtmfStringivr_option only: the key the caller pressed
ivrStringivr_option only: id of the IVR the key was pressed in
webhook_typeStringSame value as status
timestampIntegerUnix time the event was sent
delivery_attemptIntegerWebhook attempt number (1 to 3)

In the JSON Body every value is sent as a string (for example "duration": "42"), unless you write the variable without quotes. Variables are written as @{{call_id}} (the panel's style) or {{call_id}}; both work. Variables also work inside the URL (URL-encoded), e.g. https://yourdomain.com/call?id=@{{call_id}}.

Default Payload

{
  "call_id": "@{{call_id}}",
  "direction": "@{{direction}}",
  "from": "@{{from}}",
  "to": "@{{to}}",
  "did": "@{{did}}",
  "agent": "@{{agent}}",
  "status": "@{{status}}",
  "description": "@{{description}}",
  "duration": "@{{duration}}",
  "start_time": "@{{start_time}}",
  "answer_time": "@{{answer_time}}",
  "end_time": "@{{end_time}}",
  "recording_url": "@{{recording_url}}",
  "dtmf": "@{{dtmf}}",
  "ivr": "@{{ivr}}",
  "webhook_type": "@{{webhook_type}}",
  "timestamp": "@{{timestamp}}"
}

A webhook created through the API without a payload (Content-Type JSON) sends every variable above as its own key. With Form URL Encoded or XML, always send a payload.

Example (incoming call)

{
  "call_id": "call_8f2kq1x7m3a9t5r0w6zd",
  "direction": "inbound",
  "from": "919999999999",
  "to": "919000000001",
  "did": "919000000001",
  "agent": "",
  "status": "incoming",
  "description": "Incoming call",
  "duration": "0",
  "start_time": "2026-11-30 11:02:14",
  "answer_time": "",
  "end_time": "",
  "recording_url": "",
  "dtmf": "",
  "ivr": "",
  "webhook_type": "incoming",
  "timestamp": "1764480734"
}

Example (IVR key pressed)

{
  "call_id": "call_8f2kq1x7m3a9t5r0w6zd",
  "direction": "inbound",
  "from": "919999999999",
  "to": "919000000001",
  "did": "919000000001",
  "agent": "",
  "status": "ivr_option",
  "description": "Caller pressed a key in the IVR",
  "duration": "0",
  "start_time": "2026-11-30 11:02:14",
  "answer_time": "2026-11-30 11:02:15",
  "end_time": "",
  "recording_url": "",
  "dtmf": "2",
  "ivr": "ivr_5c1d9e",
  "webhook_type": "ivr_option",
  "timestamp": "1764480741"
}

Example (call completed)

{
  "call_id": "call_8f2kq1x7m3a9t5r0w6zd",
  "direction": "inbound",
  "from": "919999999999",
  "to": "919000000001",
  "did": "919000000001",
  "agent": "Rahul Sharma",
  "status": "completed",
  "description": "Call completed",
  "duration": "96",
  "start_time": "2026-11-30 11:02:14",
  "answer_time": "2026-11-30 11:02:20",
  "end_time": "2026-11-30 11:03:50",
  "recording_url": "",
  "dtmf": "",
  "ivr": "",
  "webhook_type": "completed",
  "timestamp": "1764480830"
}

Example (recording ready)

{
  "call_id": "call_8f2kq1x7m3a9t5r0w6zd",
  "direction": "inbound",
  "from": "919999999999",
  "to": "919000000001",
  "did": "919000000001",
  "agent": "Rahul Sharma",
  "status": "recording_ready",
  "description": "Recording ready",
  "duration": "96",
  "start_time": "2026-11-30 11:02:14",
  "answer_time": "2026-11-30 11:02:20",
  "end_time": "2026-11-30 11:03:50",
  "recording_url": "https://www.fast2sms.com/voice-recording/rec_3k9x2m7q?expires=1765085632&u=12345&signature=5b0e...",
  "dtmf": "",
  "ivr": "",
  "webhook_type": "recording_ready",
  "timestamp": "1764480832"
}

Download the recording from recording_url soon after you receive it; the link stops working after 7 days.

Delivery and Retries

  • Headers: Content-Type (as set on the webhook), Accept: */*, your custom headers, and webhook_secret_key when webhook signature is turned on for your account.
  • Your URL should answer with a 2xx status within 10 seconds. A timeout, connection error, 408, 429 or 5xx answer is retried up to 3 attempts in all, one minute apart; other answers (for example 404) are not retried.
  • Each delivery is listed under Webhooks > Logs in the dashboard, channel CLOUD TELEPHONY.