Aller au contenu

Create a webhook endpoint and return its cleartext secret once.

POST
/v1/webhooks/endpoints
curl --request POST \
--url https://api.asap.cool/v1/webhooks/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "enabled": true, "events": [ "example" ], "url": "example" }'
Media type application/json

Create-endpoint request body.

object
enabled

Whether the endpoint starts enabled (defaults to true).

boolean
events
required

Event tokens to subscribe to (non-empty, all documented events).

Array<string>
url
required

Absolute https:// URL deliveries are POSTed to.

string
Example generated
{
"enabled": true,
"events": [
"example"
],
"url": "example"
}

Endpoint created; secret returned once.

Media type application/json

Creation response: the endpoint plus its cleartext secret, returned once.

object
created_at
required

Creation timestamp (RFC 3339).

string
enabled
required

Whether the endpoint is active.

boolean
events
required

Subscribed event tokens.

Array<string>
id
required

Stable identifier.

string format: uuid
secret
required

Cleartext signing secret (whsec_…). Shown only here, never again.

string
url
required

Destination URL.

string
Example generated
{
"created_at": "example",
"enabled": true,
"events": [
"example"
],
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"secret": "example",
"url": "example"
}

No active org.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Missing webhooks:write scope.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Invalid endpoint payload.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}