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 UI | API Parameter | Description |
|---|---|---|
| Webhook Name | name | Friendly name for internal tracking. |
| Select Service | service | Choose Cloud Telephony to configure Cloud Telephony webhooks. |
| Select Number | identity_id | all (every number) or one of your Cloud Telephony numbers, e.g. 919000000001, for calls on that number only. |
| Select Format | template | Standard Webhook (custom). |
| Select Event | event | Default All Events (all), or one of incoming, answered, completed, missed, busy, failed, ivr_option, recording_ready. |
| Method | method | HTTP method (POST, GET, PUT). |
| URL | url | Destination URL to receive payloads (public https:// or http:// address). |
| Content-Type | content_type | JSON, Form URL Encoded or XML. |
| X-Payload-Transform | payload_transform | Standard or Raw JSON. Shown only when Content-Type is Form URL Encoded. |
| Webhook Status (Active) | status | Enable / disable (active / inactive). |
| Body | payload | Custom payload with the variables below. |
Events
| Event | When it is sent |
|---|---|
incoming | A call comes in on your number (before anyone answers). Incoming calls only. |
answered | The 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. |
completed | An answered call has ended (also a transferred call). duration and end_time are filled in. |
missed | The call ended without being answered: not answered, or the caller hung up before anyone picked up. |
busy | The called number was busy or rejected the call. |
failed | The call could not be connected. |
ivr_option | The caller pressed a key in your IVR. The key is in dtmf, the IVR id in ivr. |
recording_ready | The 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
| Variable | Type | Description |
|---|---|---|
call_id | String | Call id, the same id shown in Cloud Telephony > Call History |
request_id | String | Same value as call_id |
direction | String | inbound (incoming call) or outbound (outgoing call) |
from | String | Calling number, as reported by the network (e.g. 919999999999) |
to | String | Called number |
mobile | String | The customer's number: from on an inbound call, to on an outbound call |
did | String | Your Cloud Telephony number used for the call (the number called on inbound, the caller ID shown on outbound) |
agent | String | Name of the team member on the call, Main Admin for the account owner's browser phone, empty when no agent took the call |
status | String | The event: incoming, answered, completed, missed, busy, failed, ivr_option or recording_ready |
description | String | Event in words: Incoming call, Call answered, Call completed, Call missed, Number busy, Call failed, Caller pressed a key in the IVR, Recording ready |
duration | Integer | Call length in seconds (0 until the call ends) |
start_time | String | When the call started, YYYY-MM-DD HH:MM:SS IST |
answer_time | String | When the call was answered, YYYY-MM-DD HH:MM:SS IST (empty when not answered) |
end_time | String | When the call ended, YYYY-MM-DD HH:MM:SS IST (empty while the call is live) |
recording_url | String | Link 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. |
dtmf | String | ivr_option only: the key the caller pressed |
ivr | String | ivr_option only: id of the IVR the key was pressed in |
webhook_type | String | Same value as status |
timestamp | Integer | Unix time the event was sent |
delivery_attempt | Integer | Webhook 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, andwebhook_secret_keywhen webhook signature is turned on for your account. - Your URL should answer with a 2xx status within 10 seconds. A timeout, connection error,
408,429or5xxanswer is retried up to 3 attempts in all, one minute apart; other answers (for example404) are not retried. - Each delivery is listed under Webhooks > Logs in the dashboard, channel CLOUD TELEPHONY.
