Webhooks
Create a webhook configuration
POST
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.
bearerAuthheader
AuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
Idempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
Match
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$Length
1 <= length <= 255application/json- body
name*stringLength
1 <= length <= 120url*stringMatch
^https://Format
uriLength
length <= 4096events?array<>Items
1 <= items <= 7Default
[ "call.completed"]active?booleanDefault
trueWebhook created; secret is shown only in this response (or an idempotent replay of it).
application/json- response
id*stringFormat
uuidname*stringLength
1 <= length <= 120url*stringMatch
^https://Format
urievents*array<>Items
1 <= items <= 7active*booleanhas_secret*booleanlast_delivery_at*|Format
date-timelast_delivery_status*|nullarchived_at*|Format
date-timecreated_at*stringFormat
date-timeupdated_at*stringFormat
date-timesecret*stringOne-time HMAC-SHA256 signing secret. Store it securely; later GET/list responses omit it.
Match
^whsec_[A-Za-z0-9_-]{43}$Length
49 <= length <= 49curl -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"}