Skip to Content
Webhooks

Create a webhook configuration

Permissionwebhooks:createRetriesIdempotency-Key requiredAuthentication
POST
/webhooks

Creates a public-HTTPS destination and returns its signing secret exactly once. Store the whsec_ value before discarding the response. Idempotent replay of the same POST may replay that original one-time response.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
name*string
Length1 <= length <= 120
url*string
Match^https://
Formaturi
Lengthlength <= 4096
events?array<>
Items1 <= items <= 7
Default
[  "call.completed"]
active?boolean
Defaulttrue

Response Body

Webhook created; secret is shown only in this response (or an idempotent replay of it).

application/json
  1. response
id*string
Formatuuid
name*string
Length1 <= length <= 120
url*string
Match^https://
Formaturi
events*array<>
Items1 <= items <= 7
active*boolean
has_secret*boolean
last_delivery_at*|
Formatdate-time
last_delivery_status*|null
archived_at*|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
secret*string

One-time HMAC-SHA256 signing secret. Store it securely; later GET/list responses omit it.

Match^whsec_[A-Za-z0-9_-]{43}$
Length49 <= length <= 49
Example Request
curl -X POST 'https://api.kejue.co/v1/webhooks' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "url": "http://example.com"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "url": "http://example.com",  "events": [    "call.completed"  ],  "active": true,  "has_secret": true,  "last_delivery_at": "2019-08-24T14:15:22Z",  "last_delivery_status": "pending",  "archived_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "secret": "stringstringstringstringstringstringstringstrings"}