API reference
Webhook endpoints
Register webhook endpoints, send test events and read recent deliveries.
These operations take an organisation key (wwo_) with the scope each one lists, and work only on that key’s own organisation. Base URL https://api.wristworkout.com. Authentication and keys explains keys and scopes.
Webhook endpoints
GET/
Every endpoint of the organisation, oldest first, without their signing secrets.
Path parameters
orgIdstringRequiredThe organisation’s ID. A key works only on its own organisation.
1 to 64 characters.
Response 200 · Endpoints
itemsarray of objectsRequired9 fields in each item
idstringRequiredurlstringRequireddescriptionstringRequiredeventsarray of stringsRequiredenabledbooleanRequiredpausedbooleanRequiredTrue while the organisation has no plan that includes webhooks: no new events are queued for this endpoint, and it resumes on its own once the organisation has one.
disabledAtinteger or nullRequiredSet when you turn it off, or after 3 days of failed deliveries.
failingSinceinteger or nullRequiredUnix time in seconds
createdAtintegerRequiredUnix time in seconds
Errors
Errors any call can get: 401, 403, 404, 422, 429
401UNAUTHENTICATED | The key is missing, unknown, expired or revoked. |
403FORBIDDENinsufficient_scope | The key lacks the scope, or is a personal key. |
403FORBIDDENplan_required | When API keys need a plan and the organisation has none in good standing. |
404NOT_FOUND | The organisation is not the key’s own. |
403FORBIDDEN | The request came from a web page (it has an Origin header). Call the API from your server. |
422VALIDATION | A parameter or the body breaks the schema. |
429RATE_LIMITED | The key is over its limit for this minute, or over the service-wide 120 requests a minute (then with Retry-After: 60 and no RateLimit headers). |
Example
curl https://api.wristworkout.com/v1/orgs/org_id/webhooks \
-H "Authorization: Bearer wwo_your_key"const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/webhooks', {
headers: { Authorization: 'Bearer wwo_your_key' },
});
const data = await res.json();Add a webhook endpoint
POST/
At most 10 per organisation. Returns the signing secret once. Deliveries follow the Standard Webhooks specification.
Path parameters
orgIdstringRequiredThe organisation’s ID. A key works only on its own organisation.
1 to 64 characters.
Headers
Idempotency-KeystringMakes a retry safe: the same key with the same request within 24 hours returns the first response. See idempotency.
1 to 64 letters, digits,
_and-.
Request body
urlstringRequiredAn
https:address on port 443 with a host name.At most 2,048 characters.
eventsarray of stringsRequiredEvent types to receive, or
["*"]for all of them.At least 1 item.
descriptionstringAt most 200 characters.
Any other field is refused with 422 VALIDATION.
Response 201 · Created
idstringRequiredurlstringRequireddescriptionstringRequiredeventsarray of stringsRequiredenabledbooleanRequiredpausedbooleanRequiredTrue while the organisation has no plan that includes webhooks: no new events are queued for this endpoint, and it resumes on its own once the organisation has one.
disabledAtinteger or nullRequiredSet when you turn it off, or after 3 days of failed deliveries.
failingSinceinteger or nullRequiredUnix time in seconds
createdAtintegerRequiredUnix time in seconds
secretstringRequiredThe signing secret (
whsec_…), shown this once. Use it to check thewebhook-signatureheader.
Errors
422VALIDATION | The URL breaks a rule: NOT_HTTPS (http, or a port other than 443), IP_LITERAL, OWN_DOMAIN (wristworkout.com), TOO_LONG or INVALID. |
422LIMIT_EXCEEDED | The organisation has 10 endpoints (details.limit is webhooks). |
403FORBIDDENplan_required | Adding an endpoint while the organisation has no plan of its own that includes webhooks. |
Errors any call can get: 400, 401, 403, 404, 409, 413, 422, 429
401UNAUTHENTICATED | The key is missing, unknown, expired or revoked. |
403FORBIDDENinsufficient_scope | The key lacks the scope, or is a personal key. |
403FORBIDDENplan_required | When API keys need a plan and the organisation has none in good standing. |
404NOT_FOUND | The organisation is not the key’s own. |
403FORBIDDEN | The request came from a web page (it has an Origin header). Call the API from your server. |
400MALFORMED | The body is not valid JSON. |
413PAYLOAD_TOO_LARGE | The body is over 64 KiB. |
422VALIDATION | A parameter or the body breaks the schema. |
422VALIDATIONidempotency_key_reused | The Idempotency-Key was used for a different request. |
409PAYLOAD_MISMATCHidempotency_in_progress | The first request with this Idempotency-Key is still running (for up to a minute). |
429RATE_LIMITED | The key is over its limit for this minute, or over the service-wide 120 requests a minute (then with Retry-After: 60 and no RateLimit headers). |
Example
IDEMPOTENCY_KEY=$(uuidgen) # send the same key again if you retry
curl -X POST https://api.wristworkout.com/v1/orgs/org_id/webhooks \
-H "Authorization: Bearer wwo_your_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"url": "https://example.com/hooks/wrist-workout",
"events": [
"programme.assigned",
"programme.unassigned",
"customer.linked",
"customer.unlinked"
],
"description": "Booking system"
}'// Send the same key again if you retry.
const idempotencyKey = crypto.randomUUID();
const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/webhooks', {
method: 'POST',
headers: {
Authorization: 'Bearer wwo_your_key',
'Content-Type': 'application/json',
'Idempotency-Key': idempotencyKey,
},
body: JSON.stringify({
url: 'https://example.com/hooks/wrist-workout',
events: [
'programme.assigned',
'programme.unassigned',
'customer.linked',
'customer.unlinked',
],
description: 'Booking system',
}),
});
const data = await res.json();Change an endpoint, or turn it back on
PATCH/
Send only the fields to change. enabled: true turns a disabled endpoint back on and clears failingSince.
Path parameters
orgIdstringRequiredThe organisation’s ID. A key works only on its own organisation.
1 to 64 characters.
endpointIdstringRequiredThe endpoint’s ID.
1 to 64 characters.
Request body
urlstringAt most 2,048 characters.
eventsarray of stringsEvent types to receive, or
["*"]for all of them.At least 1 item.
descriptionstringAt most 200 characters.
enabledbooleantrueturns a disabled endpoint back on.
Any other field is refused with 422 VALIDATION.
Response 200 · Updated
idstringRequiredurlstringRequireddescriptionstringRequiredeventsarray of stringsRequiredenabledbooleanRequiredpausedbooleanRequiredTrue while the organisation has no plan that includes webhooks: no new events are queued for this endpoint, and it resumes on its own once the organisation has one.
disabledAtinteger or nullRequiredSet when you turn it off, or after 3 days of failed deliveries.
failingSinceinteger or nullRequiredUnix time in seconds
createdAtintegerRequiredUnix time in seconds
Errors
404NOT_FOUND | No endpoint with that ID. |
422VALIDATION | A new URL breaks a rule, as when you add an endpoint. |
422VALIDATION | The body is empty: send at least one field. |
403FORBIDDENplan_required | "enabled": true on a disabled endpoint while the organisation has no plan of its own that includes webhooks. |
Errors any call can get: 400, 401, 403, 404, 413, 422, 429
401UNAUTHENTICATED | The key is missing, unknown, expired or revoked. |
403FORBIDDENinsufficient_scope | The key lacks the scope, or is a personal key. |
403FORBIDDENplan_required | When API keys need a plan and the organisation has none in good standing. |
404NOT_FOUND | The organisation is not the key’s own. |
403FORBIDDEN | The request came from a web page (it has an Origin header). Call the API from your server. |
400MALFORMED | The body is not valid JSON. |
413PAYLOAD_TOO_LARGE | The body is over 64 KiB. |
422VALIDATION | A parameter or the body breaks the schema. |
429RATE_LIMITED | The key is over its limit for this minute, or over the service-wide 120 requests a minute (then with Retry-After: 60 and no RateLimit headers). |
Example
curl -X PATCH \
https://api.wristworkout.com/v1/orgs/org_id/webhooks/endpoint_id \
-H "Authorization: Bearer wwo_your_key" \
-H "Content-Type: application/json" \
-d '{ "enabled": true }'const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/webhooks/endpoint_id', {
method: 'PATCH',
headers: {
Authorization: 'Bearer wwo_your_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({ enabled: true }),
});
const data = await res.json();Delete an endpoint
DELETE/
Its delivery log goes with it.
Path parameters
orgIdstringRequiredThe organisation’s ID. A key works only on its own organisation.
1 to 64 characters.
endpointIdstringRequiredThe endpoint’s ID.
1 to 64 characters.
Response 200 · Deleted, with its deliveries
okbooleanRequiredtrue
Errors
404NOT_FOUND | No endpoint with that ID. |
Errors any call can get: 401, 403, 404, 422, 429
401UNAUTHENTICATED | The key is missing, unknown, expired or revoked. |
403FORBIDDENinsufficient_scope | The key lacks the scope, or is a personal key. |
403FORBIDDENplan_required | When API keys need a plan and the organisation has none in good standing. |
404NOT_FOUND | The organisation is not the key’s own. |
403FORBIDDEN | The request came from a web page (it has an Origin header). Call the API from your server. |
422VALIDATION | A parameter or the body breaks the schema. |
429RATE_LIMITED | The key is over its limit for this minute, or over the service-wide 120 requests a minute (then with Retry-After: 60 and no RateLimit headers). |
Example
curl -X DELETE \
https://api.wristworkout.com/v1/orgs/org_id/webhooks/endpoint_id \
-H "Authorization: Bearer wwo_your_key"const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/webhooks/endpoint_id', {
method: 'DELETE',
headers: { Authorization: 'Bearer wwo_your_key' },
});
const data = await res.json();Send a test event
POST/
Sends a signed ping to this endpoint now and reports the result.
Path parameters
orgIdstringRequiredThe organisation’s ID. A key works only on its own organisation.
1 to 64 characters.
endpointIdstringRequiredThe endpoint’s ID.
1 to 64 characters.
Headers
Idempotency-KeystringMakes a retry safe: the same key with the same request within 24 hours returns the first response. See idempotency.
1 to 64 letters, digits,
_and-.
Response 200 · The attempt
deliveryIdstringRequiredstatestringRequiredpendingdeliveredfailedlastStatusinteger or nullRequired
Errors
404NOT_FOUND | No endpoint with that ID. |
403FORBIDDENplan_required | A test while the organisation has no plan of its own that includes webhooks. |
Errors any call can get: 401, 403, 404, 409, 422, 429
401UNAUTHENTICATED | The key is missing, unknown, expired or revoked. |
403FORBIDDENinsufficient_scope | The key lacks the scope, or is a personal key. |
403FORBIDDENplan_required | When API keys need a plan and the organisation has none in good standing. |
404NOT_FOUND | The organisation is not the key’s own. |
403FORBIDDEN | The request came from a web page (it has an Origin header). Call the API from your server. |
422VALIDATION | A parameter or the body breaks the schema. |
422VALIDATIONidempotency_key_reused | The Idempotency-Key was used for a different request. |
409PAYLOAD_MISMATCHidempotency_in_progress | The first request with this Idempotency-Key is still running (for up to a minute). |
429RATE_LIMITED | The key is over its limit for this minute, or over the service-wide 120 requests a minute (then with Retry-After: 60 and no RateLimit headers). |
Example
IDEMPOTENCY_KEY=$(uuidgen) # send the same key again if you retry
curl -X POST \
https://api.wristworkout.com/v1/orgs/org_id/webhooks/endpoint_id/test \
-H "Authorization: Bearer wwo_your_key" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY"// Send the same key again if you retry.
const idempotencyKey = crypto.randomUUID();
const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/webhooks/endpoint_id/test', {
method: 'POST',
headers: {
Authorization: 'Bearer wwo_your_key',
'Idempotency-Key': idempotencyKey,
},
});
const data = await res.json();Recent deliveries to an endpoint
GET/
Newest first, for the last 30 days.
Path parameters
orgIdstringRequiredThe organisation’s ID. A key works only on its own organisation.
1 to 64 characters.
endpointIdstringRequiredThe endpoint’s ID.
1 to 64 characters.
Query parameters
cursorstringnextCursorfrom the previous page.At most 400 characters.
limitintegerPage size, 20 when left out.
1 to 50.
Response 200 · Deliveries
itemsarray of objectsRequired8 fields in each item
idstringRequiredThe
webhook-idheader: the same on every retry of this message.eventTypestringRequiredstatestringRequiredpendingdeliveredfailedattemptsintegerRequiredlastStatusinteger or nullRequiredHTTP status of the last attempt; 0 when there was no response.
createdAtintegerRequiredUnix time in seconds
deliveredAtinteger or nullRequiredUnix time in seconds
nextAttemptAtinteger or nullRequiredUnix time in seconds
nextCursorstring or nullRequiredSend it as
cursorfor the next page. Null on the last page.
Errors
404NOT_FOUND | No endpoint with that ID. |
Errors any call can get: 401, 403, 404, 422, 429
401UNAUTHENTICATED | The key is missing, unknown, expired or revoked. |
403FORBIDDENinsufficient_scope | The key lacks the scope, or is a personal key. |
403FORBIDDENplan_required | When API keys need a plan and the organisation has none in good standing. |
404NOT_FOUND | The organisation is not the key’s own. |
403FORBIDDEN | The request came from a web page (it has an Origin header). Call the API from your server. |
422VALIDATION | A parameter or the body breaks the schema. |
429RATE_LIMITED | The key is over its limit for this minute, or over the service-wide 120 requests a minute (then with Retry-After: 60 and no RateLimit headers). |
Example
curl \
https://api.wristworkout.com/v1/orgs/org_id/webhooks/endpoint_id/deliveries \
-H "Authorization: Bearer wwo_your_key"const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/webhooks/endpoint_id/deliveries', {
headers: { Authorization: 'Bearer wwo_your_key' },
});
const data = await res.json();