Webhooks
Webhooks allow your application to receive real-time notifications about events happening in the Audian system. Instead of continuously polling the API for updates, webhooks push event data to your application's endpoint whenever an event occurs.
Base URL​
https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/webhooks
Authentication​
All requests require the X-Auth-Token header:
curl -X GET "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/webhooks" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Accept: application/json"
How Webhooks Work​
When an event occurs in the Audian system:
- The system generates an event notification
- The notification is sent as an HTTP POST request to your configured endpoint
- Your endpoint receives the event data and processes it
- You return a 2xx status code to acknowledge receipt
List Webhooks​
curl -X GET "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/webhooks?paginate=false" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Accept: application/json"
Response​
{
"auth_token": "eyJhbGciOiJSUzI1...",
"data": [
{
"id": "webhook_abc123",
"name": "Call Events",
"uri": "https://yourapp.com/webhooks/audian",
"hook": "channel_create",
"enabled": true
}
],
"request_id": "req_xyz789",
"status": "success"
}
Create Webhook​
curl -X PUT "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/webhooks" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"data": {
"name": "Call Events",
"uri": "https://yourapp.com/webhooks/audian",
"hook": "channel_create",
"http_verb": "post",
"retries": 3
}
}'
Update Webhook​
curl -X POST "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/webhooks/{WEBHOOK_ID}" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"data": {
"enabled": true,
"uri": "https://yourapp.com/webhooks/v2/audian"
}
}'
Delete Webhook​
curl -X DELETE "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/webhooks/{WEBHOOK_ID}" \
-H "X-Auth-Token: {AUTH_TOKEN}"
Webhook Event Types​
| Hook | Description |
|---|---|
channel_create | New call started |
channel_answer | Call answered |
channel_destroy | Call ended |
channel_bridge | Call connected to another party |
object_create | Resource created |
object_update | Resource updated |
object_delete | Resource deleted |
Webhook Fields​
| Field | Type | Description |
|---|---|---|
id | string | Unique webhook identifier |
name | string | Webhook display name |
uri | string | Your endpoint URL |
hook | string | Event type to subscribe |
http_verb | string | HTTP method (post, get) |
retries | integer | Number of retry attempts |
enabled | boolean | Whether webhook is active |
Example Webhook Payload​
When an event occurs, Audian sends a POST request to your endpoint:
{
"id": "evt_1234567890",
"account_id": "account_abc123",
"hook": "channel_destroy",
"timestamp": "2026-02-04T10:30:00Z",
"data": {
"call_id": "call_xyz789",
"caller_id_number": "+14155559999",
"callee_id_number": "+14155552671",
"duration_seconds": 245,
"hangup_cause": "NORMAL_CLEARING"
}
}
Retry Policy​
If your endpoint returns a non-2xx status code:
- Audian retries the webhook based on
retriessetting - Retries use exponential backoff
- After all retries fail, the webhook is logged as failed
Best Practices​
- Return quickly: Acknowledge receipt within 5 seconds
- Process async: Handle heavy processing in background jobs
- Verify source: Validate requests come from Audian
- Handle duplicates: Design handlers to be idempotent
- Log everything: Keep logs for debugging
Test Webhooks​
Verify your endpoint is working:
curl -X POST "https://api.audian.com:8443/v2/accounts/{ACCOUNT_ID}/webhooks/{WEBHOOK_ID}/test" \
-H "X-Auth-Token: {AUTH_TOKEN}"
Topics​
- Setup Webhooks - Configure your endpoints
- Event Types - All available events
- Payload Structure - Understand payloads
- Troubleshooting - Common issues