Skip to main content
POST
/
webhooks
/
endpoints
curl -X POST https://api.thinnest.ai/webhooks/endpoints \
  -H "Authorization: Bearer $THINNESTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://your-app.com/webhooks/thinnestai",
  "event_types": [
    "chat.message.completed",
    "voice.call.ended"
  ],
  "description": "Production webhook",
  "max_retries": 3,
  "timeout_ms": 5000
}'
{
  "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"
  }
}
curl -X POST https://api.thinnest.ai/webhooks/endpoints \
  -H "Authorization: Bearer $THINNESTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://your-app.com/webhooks/thinnestai",
  "event_types": [
    "chat.message.completed",
    "voice.call.ended"
  ],
  "description": "Production webhook",
  "max_retries": 3,
  "timeout_ms": 5000
}'

Request Body

url
string
required
HTTPS URL to receive events
event_types
array
required
List of event types to subscribe to
agent_id
integer
default:"null"
Filter events to a specific agent (null = all agents)
description
string
default:"null"
Human-readable description
max_retries
integer
default:"3"
Number of retry attempts (0–5)
timeout_ms
integer
default:"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

StatusDescription
400Invalid URL (not HTTPS), invalid event types, or max 20 endpoints reached
401Missing or invalid API key

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
url
string
required
event_types
string[]
required
agent_id
integer | null
description
string | null
max_retries
integer
default:3
timeout_ms
integer
default:5000

Response

Successful Response