Skip to main content
POST
/
v2
/
webhooks
curl --request POST \
  --url https://api.samora.ai/v2/webhooks \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "agent_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "CRM Integration",
  "url": "https://your-server.com/webhooks/samora",
  "events": [
    "CALL_FINISHED",
    "CALL_FAILED"
  ]
}
'
{
  "message": "Webhook created successfully. Save the secret - it will not be shown again.",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "agent_id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "CRM Integration",
    "url": "https://your-server.com/webhooks/samora",
    "secret": "whsec_abc123def456ghi789...",
    "events": [
      "CALL_FINISHED",
      "CALL_FAILED"
    ],
    "data_options": {
      "include_transcript": false,
      "include_recording_url": false
    },
    "custom_headers": {},
    "is_active": true,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}

Authorizations

X-API-Key
string
header
required

Your unique organization API key. Required on all requests.

Body

application/json
agent_id
string<uuid>
required

The UUID of the agent this webhook is associated with.

name
string
required

A friendly name for this webhook.

Required string length: 1 - 255
url
string<uri>
required

The HTTPS URL where webhook payloads will be sent.

events
enum<string>[]
required

List of event types to subscribe to.

Minimum array length: 1
Available options:
CALL_STARTED,
CALL_FINISHED,
CALL_FAILED
data_options
object
custom_headers
object

Custom HTTP headers to send with webhook requests.

Response

Webhook created successfully

message
string
required
data
object
required