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"
}
}{
"message": "Invalid request body"
}{
"message": "Agent does not belong to your company"
}Webhooks
Create webhook
Creates a new webhook to receive call event notifications.
The webhook secret is returned only once during creation and should be saved securely.
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"
}
}{
"message": "Invalid request body"
}{
"message": "Agent does not belong to your company"
}Authorizations
Your unique organization API key. Required on all requests.
Body
application/json
The UUID of the agent this webhook is associated with.
A friendly name for this webhook.
Required string length:
1 - 255The HTTPS URL where webhook payloads will be sent.
List of event types to subscribe to.
Minimum array length:
1Available options:
CALL_STARTED, CALL_FINISHED, CALL_FAILED Show child attributes
Show child attributes
Custom HTTP headers to send with webhook requests.
Show child attributes
Show child attributes