Create a webhook endpoint
curl --request POST \
--url https://my.server.express/api/v1/user/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"description": "<string>",
"events": []
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', description: '<string>', events: []})
};
fetch('https://my.server.express/api/v1/user/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/webhooks"
payload = {
"url": "<string>",
"description": "<string>",
"events": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>",
"url": "<string>",
"description": "<string>",
"events": [
"invoice.paid"
],
"active": true,
"disabledAt": "2023-11-07T05:31:56Z",
"consecutiveFails": 1,
"lastDeliveryAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Webhooks
Create a webhook endpoint
Registers an endpoint and returns its signing secret once (stored encrypted; delete and recreate to rotate). The URL must be https on the default port, at most 2048 characters, with no embedded credentials, and resolve to a public host that isn’t ours. Max 10 endpoints (409). 503 when server-side encryption isn’t configured. Writes a WEBHOOK_ENDPOINT_CREATED audit entry.
POST
/
v1
/
user
/
webhooks
Create a webhook endpoint
curl --request POST \
--url https://my.server.express/api/v1/user/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"description": "<string>",
"events": []
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', description: '<string>', events: []})
};
fetch('https://my.server.express/api/v1/user/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/webhooks"
payload = {
"url": "<string>",
"description": "<string>",
"events": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>",
"url": "<string>",
"description": "<string>",
"events": [
"invoice.paid"
],
"active": true,
"disabledAt": "2023-11-07T05:31:56Z",
"consecutiveFails": 1,
"lastDeliveryAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
Session access token (JWT) from POST /v1/auth/login or /v1/auth/refresh. A session satisfies every API scope.
Body
application/json
Maximum string length:
2048Trimmed; blank becomes null.
Maximum string length:
200Events to receive. Empty, null or omitted means every event, including ones added later. Duplicates are collapsed.
Available options:
invoice.paid, invoice.refunded, team.member_joined, team.member_removed, team.service_shared, service.provisioned, service.suspended, service.unsuspended, service.terminated, ticket.replied