POST
/
v1
/
calls
/
webhooks
Create a call webhook
curl --request POST \
  --url https://api.wavix.com/v1/calls/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://you-site.com/webhook",
  "event_type": "post-call",
  "expected_url": ""
}
'
{
  "success": true,
  "event_type": "post-call",
  "url": "https://you-site.com/webhook"
}

Authorizations

Authorization
string
header
required

Wavix API key. Pass as Authorization: Bearer <api_key>. Keys support per-resource scopes (none / read / write). See Restricted keys and scopes.

Body

application/json

Attributes for the new call webhook.

url
string<uri>
required

Webhook URL to send call events to.

Example:

"https://you-site.com/webhook"

event_type
enum<string>
required

Allowed values: on-call, post-call.

  • on-call: Sends real-time status updates when a call starts, is answered, and ends.

  • post-call: Sends a callback after the call ends with disposition, duration, and cost.

Available options:
post-call,
on-call
expected_url
string

Applies the change only if the webhook currently has this URL. Pass an empty string to set the webhook only while it is unset, or your own URL to replace your webhook. Setting the URL the webhook already has always succeeds.

Example:

""

Response

Returns the created call webhook.

A call webhook response

success
boolean
required

Indicates whether the request was successful.

Example:

true

event_type
enum<string>
required

Type of call event the webhook subscribes to. One of post-call (delivered once after the call ends) or on-call (delivered for in-call events while the call is active).

Available options:
post-call,
on-call
Example:

"post-call"

url
string<uri>
required

Webhook URL

Example:

"https://you-site.com/webhook"