Skip to Content
Webhooks

Rotate webhook secret

Permissionwebhooks:updateRetriesIdempotency-Key requiredAuthentication
POST
/webhooks/{id}/rotate-secret

Returns a new whsec_ signing secret exactly once and invalidates the prior secret for future sends.

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Path Parameters

id*string
Formatuuid

Header Parameters

If-Match?string

Optional strong ETag (or *) from a prior response. A stale tag returns 412 without changing the resource.

Idempotency-Key*string

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

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

Response Body

Secret rotated and shown once.

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/497f6eca-6276-4993-bfeb-53cbbbba6f08/rotate-secret' \  -H 'Idempotency-Key: string'
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"}