Create Webhook Endpoint
Register a new URL to receive webhook events.
POST
/webhooks/endpointsRegister a new webhook endpoint.
No parameters for this endpoint.
Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | Yes | — | HTTPS URL to receive events |
event_types | string[] | Yes | — | List of event types to subscribe to |
agent_id | integer | No | null | Filter events to a specific agent (null = all agents) |
description | string | No | null | Human-readable description |
max_retries | integer | No | 3 | Number of retry attempts (0–5) |
timeout_ms | integer | No | 5000 | Request timeout in milliseconds |
Response
{
"status": "success",
"endpoint": {
"id": 1,
"url": "https://your-app.com/webhooks/thinnestai",
"secret": "a1b2c3d4e5f6...",
"event_types": ["chat.message.completed", "voice.call.ended"],
"agent_id": null,
"description": "Production webhook",
"is_active": true,
"max_retries": 3,
"timeout_ms": 5000,
"created_at": "2026-03-16T10:00:00"
}
}The secret is only returned on creation. Save it immediately — it cannot be retrieved later.
Errors
| Status | Description |
|---|---|
400 | Invalid URL (not HTTPS), invalid event types, or max 20 endpoints reached |
401 | Missing or invalid API key |