Skip to content

Creates a webhook

POST
/webhook/{name}

Creates a new webhook with the given name and generates its signing secret. The name may be provided either as a path parameter (POST /webhook/:name) or as a name field in the request body for backwards compatibility; the path parameter takes precedence when both are present. Returns 400 when neither is provided, when the path name fails the slug pattern, when the body fails validation (e.g. missing or malformed url, body name not matching the slug pattern), or when any URL uses a non-https scheme, fails to resolve, or resolves to a private/loopback address. Returns 409 when a webhook with that name already exists for the organization. Only owner and admin roles can create a webhook.

name
string
/^[a-z0-9-]{1,64}$/
object
name
string
/^[a-z0-9-]{1,64}$/
url
required
string format: uri
transaction
object
created
string format: uri
updated
string format: uri
completed
string format: uri
card
object
updated
string format: uri
user
object
updated
string format: uri

Webhook created

object
url
required
string format: uri
transaction
object
created
string format: uri
updated
string format: uri
completed
string format: uri
card
object
updated
string format: uri
user
object
updated
string format: uri
name
required
string
/^[a-z0-9-]{1,64}$/
secret
required
string

Invalid webhook name, body, or URL

object
code
required
string
Example
invalid name
message
Array<string>

Unauthorized

object
code
required
Allowed values: unauthorized
Example
unauthorized

User doesn’t belong to the organization

Any of:
object
code
required
Allowed values: no organization
Example
no organization

A webhook with the given name already exists

object
code
required
Allowed values: name conflict
Example
name conflict