POST
/
webhooks
/
subscriptions
Create Webhook Subscription
curl --request POST \
  --url https://api.chat-dash.com/v1/public/webhooks/subscriptions \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "clientId": "<string>",
  "agentId": "<string>",
  "webhookUrl": "<string>",
  "events": [
    "call.started"
  ]
}'
{
  "_id": "<string>",
  "clientId": "<string>",
  "agentId": "<string>",
  "webhookUrl": "<string>",
  "events": [
    "call.started"
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Headers

Authorization
string
required

Client-specific API key for authentication

Body

application/json
clientId
string
required

The client ID associated with the subscription

agentId
string
required

The agent ID associated with the subscription

webhookUrl
string<uri>
required

The URL where event notifications will be sent

events
enum<string>[]
required

List of events to subscribe to

Minimum length: 1

Response

Subscription created successfully

_id
string

Unique identifier for the subscription

clientId
string

The client associated with the subscription

agentId
string

The agent associated with the subscription

webhookUrl
string

The URL where event notifications will be sent

events
enum<string>[]

List of events that trigger notifications

createdAt
string<date-time>

When the subscription was created

updatedAt
string<date-time>

When the subscription was last updated