Skip to main content
POST
/
v1
/
events
/
destinations
Create an event destination
curl --request POST \
  --url https://api.prets.app/v1/events/destinations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Production",
  "url": "https://example.com/prets/events",
  "destinationId": "<string>"
}
'
{
  "destinationId": "<string>",
  "name": "Production",
  "url": "https://example.com/prets/events",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "bearerSecret": "whsec_3XvK2nQ8mB7pR1sT4uW6yZ0aE5gH9jLcV2bN1xM4qP8"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Human-readable label for this destination within the organization.

Required string length: 1 - 128
Example:

"Production"

url
string
required

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

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

"https://example.com/prets/events"

destinationId
string

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

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

Response

Event destination created. bearerSecret is returned cleartext exactly once.

destinationId
string
required
Pattern: ^whk_[0-9A-HJKMNP-TV-Z]{26}$
name
string
required

Human-readable label for this destination within the organization.

Required string length: 1 - 128
Example:

"Production"

url
string
required

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

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

"https://example.com/prets/events"

createdAt
string<date-time>
required
updatedAt
string<date-time>
required
bearerSecret
string
required

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

Pattern: ^whsec_[A-Za-z0-9_-]{43}$
Example:

"whsec_3XvK2nQ8mB7pR1sT4uW6yZ0aE5gH9jLcV2bN1xM4qP8"