Skip to Content
Prets Developer Portal

Rotate an event destination bearer secret

POST
/v1/events/destinations/{destinationId}/bearer-secret

to try read requests with your account, or paste an API key into the Authorization field. Create an API key in the Partner Portal.

Replaces an event destination's bearer secret, for example when the old one may have leaked. Prets sends the new secret on subsequent deliveries and there is no overlap period, so update your endpoint to accept it straight away.

Returns the new bearerSecret, shown only once, and rotatedAt. Returns 404 when the destination does not exist or belongs to another organization.

Path Parameters

destinationId*string

Event destination id

Match^whk_[0-9A-HJKMNP-TV-Z]{26}$

Response Body

The new bearer secret, shown only this once

application/json
  1. response

New bearer secret minted for the destination. Returned cleartext exactly once; the previous secret stops working immediately.

destinationId*string

Event destination whose bearer secret was rotated

Match^whk_[0-9A-HJKMNP-TV-Z]{26}$
bearerSecret*string

Bearer secret returned cleartext exactly once when minted. Sent on every delivery as Authorization: Bearer {secret}. Cannot be retrieved later.

Match^whsec_[A-Za-z0-9_-]{43}$
rotatedAt*string

When this secret became the live delivery credential

Formatdate-time

Authorization

bearerAuth
headerAuthorizationBearer <token>
Example Request
curl -X POST 'https://api.prets.app/v1/events/destinations/whk_01ARZ3NDEKTSV4RRFFQ69G5FAV/bearer-secret'
Example Response
{  "destinationId": "whk_01ARZ3NDEKTSV4RRFFQ69G5FAV",  "bearerSecret": "whsec_3XvK2nQ8mB7pR1sT4uW6yZ0aE5gH9jLcV2bN1xM4qP8",  "rotatedAt": "2026-06-01T12:00:00.000Z"}