Skip to main content
POST
/
v1
/
webhook-subscriptions
Create a webhook subscription
curl --request POST \
  --url https://agents.assemblyai.com/v1/webhook-subscriptions \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://your-app.com/webhooks/assemblyai",
  "events": [],
  "secret": "<string>",
  "agent_id": "<string>",
  "enabled": true
}
'
{
  "id": "<string>",
  "agent_id": "<string>",
  "url": "<string>",
  "events": [],
  "enabled": true,
  "secret_version": 1,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Your AssemblyAI API key in the Authorization header (raw key; a Bearer prefix is also accepted).

Body

application/json
url
string
required

Delivery URL. Must be https and a public host.

Example:

"https://your-app.com/webhooks/assemblyai"

events
enum<string>[]
required
Minimum array length: 1
Available options:
session.started,
session.completed,
call.connected,
call.ended,
call.failed
secret
string
required

Signing secret, 32–256 printable ASCII chars (no whitespace). Write-only; never returned.

Required string length: 32 - 256
agent_id
string | null

Scope to one agent. Omit for account-wide events.

enabled
boolean
default:true

Response

The created subscription.

A subscription. The signing secret is never returned, only its version.

id
string
agent_id
string | null
url
string
events
enum<string>[]
Available options:
session.started,
session.completed,
call.connected,
call.ended,
call.failed
enabled
boolean
secret_version
integer
Example:

1

created_at
string<date-time>
updated_at
string<date-time>