Skip to Content
Prets Developer Portal

Create an event destination

POST
/v1/events/destinations

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

Registers an HTTPS endpoint that receives your organization's quote and case events, such as quote.financing.updated and case.updated. Prets sends each event as a POST with Authorization: Bearer {bearerSecret}, and retries deliveries that time out or get a 429 or 5xx response for up to 24 hours.

Returns the destination with its bearerSecret. Store the secret now: it is shown only once. Returns 409 when your organization already has an event destination.

Request Body

application/json
  1. body

Register an HTTPS endpoint that receives outbound events for the authenticated organization.

destinationId?string

Optional client-supplied id. Server-generated when omitted.

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

Human-readable label for this destination within the organization.

Length1 <= length <= 128
url*string

Public HTTPS endpoint that will receive event deliveries. Plain HTTP is rejected.

Match^((%[0-9A-Fa-f]{2}|[-()_.!~*';/?:@&=+$,A-Za-z0-9])+)([).!';/?:,])?$
Lengthlength <= 2048

Response Body

The created event destination, with its bearer secret shown only this once

application/json
  1. response

Created destination plus the bearer secret, returned cleartext exactly once. Subsequent reads omit the secret.

destinationId*string

Stable destination id. Client-supplied at create, or server-generated when omitted.

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

Human-readable label for this destination within the organization.

Length1 <= length <= 128
url*string

Public HTTPS endpoint that will receive event deliveries. Plain HTTP is rejected.

Match^((%[0-9A-Fa-f]{2}|[-()_.!~*';/?:@&=+$,A-Za-z0-9])+)([).!';/?:,])?$
Lengthlength <= 2048
createdAt*string

When the destination was registered

Formatdate-time
updatedAt*string

When the destination name or URL last changed

Formatdate-time
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}$

Authorization

bearerAuth
headerAuthorizationBearer <token>
Example Request
curl -X POST 'https://api.prets.app/v1/events/destinations' \  -H 'Content-Type: application/json' \  -d '{  "name": "Production",  "url": "https://example.com/prets/events"}'
Example Response
{  "destinationId": "whk_01ARZ3NDEKTSV4RRFFQ69G5FAV",  "name": "Production",  "url": "https://example.com/prets/events",  "createdAt": "2026-06-01T12:00:00.000Z",  "updatedAt": "2026-06-01T12:00:00.000Z",  "bearerSecret": "whsec_3XvK2nQ8mB7pR1sT4uW6yZ0aE5gH9jLcV2bN1xM4qP8"}