logo
WebhooksCreate webhook
Webhooks

Create webhook

Creates a new webhook endpoint. If secret is not provided, a random 32-byte hex secret is generated. Defaults: retryAttempts = 3, timeoutMs = 10000.

curl -X POST "https://api.sendkit.ai/v1/webhooks" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "name": "CRM Sync",
  "url": "https://crm.example.com/webhooks/sendkit",
  "events": [
    "email.replied",
    "email.positive_reply"
  ]
}'
{
  "success": true,
  "data": {
    "_id": "664a1b2c3d4e5f6a7b8c9d0e",
    "workspaceId": "ws_123",
    "name": "CRM Sync",
    "url": "https://crm.example.com/webhooks/sendkit",
    "events": [
      "email.replied",
      "email.positive_reply"
    ],
    "secret": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
    "retryAttempts": 3,
    "timeoutMs": 10000,
    "status": "active",
    "createdBy": "user_123",
    "createdAt": "2024-06-01T10:00:00.000Z",
    "updatedAt": "2024-06-01T10:00:00.000Z"
  }
}
POST
/v1/webhooks
POST
API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) or Workspace API key (sk_...)

Platform API key (sk_user_...) or Workspace API key (sk_...)
Bearer Token
Bearer Tokenstring
Required

API key as Bearer token

API key as Bearer token
Content-Typestring
Required

The media type of the request body

Options: application/json
namestring
Required

Webhook name (trimmed)

Min length: 1
urlstring
Required

Endpoint URL to receive webhook payloads

Format: uri
eventsarray
Required

Events to subscribe to

secretstring

HMAC signing secret. Auto-generated if omitted.

retryAttemptsinteger

Number of retry attempts on failure (default 3)

Min: 0 • Max: 10
timeoutMsinteger

Request timeout in milliseconds (default 10000)

Min: 1000 • Max: 30000
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)

header
Authorizationstring
Required

Bearer token. API key as Bearer token

Body

application/json
namestring
Required

Webhook name (trimmed)

urlstring
Required

Endpoint URL to receive webhook payloads

eventsarray
Required

Events to subscribe to

secretstring

HMAC signing secret. Auto-generated if omitted.

retryAttemptsinteger

Number of retry attempts on failure (default 3)

timeoutMsinteger

Request timeout in milliseconds (default 10000)

Responses