Skip to main content
POST
Create Webhook Subscription

Headers

Authorization
string
required

A client API key (Agency dashboard → Clients → select a client → API Access tab) or the agency API key. Client keys can only manage their own client's subscriptions, agents and phone numbers.

Body

application/json

Provide at least one of agentIds or phoneNumberIds.

webhookUrl
string<uri>
required

The URL where event notifications will be POSTed

events
enum<string>[]
required

Events to subscribe to

Minimum array length: 1
Available options:
call.started,
call.missed,
call.ended,
call.inbound
clientId
string

The client that owns the subscription. Optional with a client API key; required with the agency API key.

agentIds
string[]

Agents to receive call.started, call.ended and call.missed events for

phoneNumberIds
string[]

Phone numbers to receive call.inbound events for (Retell / Native numbers)

Response

Subscriptions created

_id
string

Unique identifier for the subscription

clientId
string

The client that owns the subscription

agentId
string

The agent the subscription is for (agent-level events)

phoneNumberId
string

The phone number the subscription is for (call.inbound)

webhookUrl
string

The URL where event notifications are sent

events
enum<string>[]

Events that trigger notifications

Available options:
call.started,
call.missed,
call.ended,
call.inbound
createdAt
string<date-time>
updatedAt
string<date-time>