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}$/
Media typeapplication/json
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
Examplegenerated
{
"name": "example",
"url": "https://example.com",
"transaction": {
"created": "https://example.com",
"updated": "https://example.com",
"completed": "https://example.com"
},
"card": {
"updated": "https://example.com"
},
"user": {
"updated": "https://example.com"
}
}

Webhook created

Media typeapplication/json
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
Examplegenerated
{
"url": "https://example.com",
"transaction": {
"created": "https://example.com",
"updated": "https://example.com",
"completed": "https://example.com"
},
"card": {
"updated": "https://example.com"
},
"user": {
"updated": "https://example.com"
},
"name": "example",
"secret": "example"
}

Invalid webhook name, body, or URL

Media typeapplication/json
object
code
required
string
message
Array<string>
Example
{
"code": "invalid name"
}

Unauthorized

Media typeapplication/json
object
code
required
Allowed values: unauthorized
Example
{
"code": "unauthorized"
}

User doesn't belong to the organization

Media typeapplication/json
Any of:
object
code
required
Allowed values: no organization
Example
{
"code": "no organization"
}

A webhook with the given name already exists

Media typeapplication/json
object
code
required
Allowed values: name conflict
Example
{
"code": "name conflict"
}