Skip to content
Developer docsWebhook endpoints

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/v1/orgs/{orgId}/webhooks

Every endpoint of the organisation, oldest first, without their signing secrets.

Key
Organisation key, wwo_
Scope
webhooks:manage
Plans
Pro and Trainer/Gym. Webhooks need the organisation’s own plan. Plans and limits

Path parameters

orgIdstringRequired

The organisation’s ID. A key works only on its own organisation.

1 to 64 characters.

Response 200 · Endpoints

itemsarray of objectsRequired
9 fields in each item
idstringRequired
urlstringRequired
descriptionstringRequired
eventsarray of stringsRequired
enabledbooleanRequired
pausedbooleanRequired

True 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 nullRequired

Set when you turn it off, or after 3 days of failed deliveries.

failingSinceinteger or nullRequired

Unix time in seconds

createdAtintegerRequired

Unix time in seconds

Errors

Errors any call can get: 401, 403, 404, 422, 429
401UNAUTHENTICATEDThe key is missing, unknown, expired or revoked.
403FORBIDDENinsufficient_scopeThe key lacks the scope, or is a personal key.
403FORBIDDENplan_requiredWhen API keys need a plan and the organisation has none in good standing.
404NOT_FOUNDThe organisation is not the key’s own.
403FORBIDDENThe request came from a web page (it has an Origin header). Call the API from your server.
422VALIDATIONA parameter or the body breaks the schema.
429RATE_LIMITEDThe 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/v1/orgs/{orgId}/webhooks

At most 10 per organisation. Returns the signing secret once. Deliveries follow the Standard Webhooks specification.

Key
Organisation key, wwo_
Scope
webhooks:manage
Plans
Pro and Trainer/Gym. Webhooks need the organisation’s own plan. Plans and limits

Path parameters

orgIdstringRequired

The organisation’s ID. A key works only on its own organisation.

1 to 64 characters.

Headers

Idempotency-Keystring

Makes 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

urlstringRequired

An https: address on port 443 with a host name.

At most 2,048 characters.

eventsarray of stringsRequired

Event types to receive, or ["*"] for all of them.

At least 1 item.

descriptionstring

At most 200 characters.

Any other field is refused with 422 VALIDATION.

Response 201 · Created

idstringRequired
urlstringRequired
descriptionstringRequired
eventsarray of stringsRequired
enabledbooleanRequired
pausedbooleanRequired

True 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 nullRequired

Set when you turn it off, or after 3 days of failed deliveries.

failingSinceinteger or nullRequired

Unix time in seconds

createdAtintegerRequired

Unix time in seconds

secretstringRequired

The signing secret (whsec_…), shown this once. Use it to check the webhook-signature header.

Errors

422VALIDATIONThe URL breaks a rule: NOT_HTTPS (http, or a port other than 443), IP_LITERAL, OWN_DOMAIN (wristworkout.com), TOO_LONG or INVALID.
422LIMIT_EXCEEDEDThe organisation has 10 endpoints (details.limit is webhooks).
403FORBIDDENplan_requiredAdding 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
401UNAUTHENTICATEDThe key is missing, unknown, expired or revoked.
403FORBIDDENinsufficient_scopeThe key lacks the scope, or is a personal key.
403FORBIDDENplan_requiredWhen API keys need a plan and the organisation has none in good standing.
404NOT_FOUNDThe organisation is not the key’s own.
403FORBIDDENThe request came from a web page (it has an Origin header). Call the API from your server.
400MALFORMEDThe body is not valid JSON.
413PAYLOAD_TOO_LARGEThe body is over 64 KiB.
422VALIDATIONA parameter or the body breaks the schema.
422VALIDATIONidempotency_key_reusedThe Idempotency-Key was used for a different request.
409PAYLOAD_MISMATCHidempotency_in_progressThe first request with this Idempotency-Key is still running (for up to a minute).
429RATE_LIMITEDThe 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/v1/orgs/{orgId}/webhooks/{endpointId}

Send only the fields to change. enabled: true turns a disabled endpoint back on and clears failingSince.

Key
Organisation key, wwo_
Scope
webhooks:manage
Plans
Pro and Trainer/Gym. Webhooks need the organisation’s own plan. Plans and limits

Path parameters

orgIdstringRequired

The organisation’s ID. A key works only on its own organisation.

1 to 64 characters.

endpointIdstringRequired

The endpoint’s ID.

1 to 64 characters.

Request body

urlstring

At most 2,048 characters.

eventsarray of strings

Event types to receive, or ["*"] for all of them.

At least 1 item.

descriptionstring

At most 200 characters.

enabledboolean

true turns a disabled endpoint back on.

Any other field is refused with 422 VALIDATION.

Response 200 · Updated

idstringRequired
urlstringRequired
descriptionstringRequired
eventsarray of stringsRequired
enabledbooleanRequired
pausedbooleanRequired

True 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 nullRequired

Set when you turn it off, or after 3 days of failed deliveries.

failingSinceinteger or nullRequired

Unix time in seconds

createdAtintegerRequired

Unix time in seconds

Errors

404NOT_FOUNDNo endpoint with that ID.
422VALIDATIONA new URL breaks a rule, as when you add an endpoint.
422VALIDATIONThe 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
401UNAUTHENTICATEDThe key is missing, unknown, expired or revoked.
403FORBIDDENinsufficient_scopeThe key lacks the scope, or is a personal key.
403FORBIDDENplan_requiredWhen API keys need a plan and the organisation has none in good standing.
404NOT_FOUNDThe organisation is not the key’s own.
403FORBIDDENThe request came from a web page (it has an Origin header). Call the API from your server.
400MALFORMEDThe body is not valid JSON.
413PAYLOAD_TOO_LARGEThe body is over 64 KiB.
422VALIDATIONA parameter or the body breaks the schema.
429RATE_LIMITEDThe 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/v1/orgs/{orgId}/webhooks/{endpointId}

Its delivery log goes with it.

Key
Organisation key, wwo_
Scope
webhooks:manage
Plans
Pro and Trainer/Gym. Webhooks need the organisation’s own plan. Plans and limits

Path parameters

orgIdstringRequired

The organisation’s ID. A key works only on its own organisation.

1 to 64 characters.

endpointIdstringRequired

The endpoint’s ID.

1 to 64 characters.

Response 200 · Deleted, with its deliveries

okbooleanRequired

Valuetrue

Errors

404NOT_FOUNDNo endpoint with that ID.
Errors any call can get: 401, 403, 404, 422, 429
401UNAUTHENTICATEDThe key is missing, unknown, expired or revoked.
403FORBIDDENinsufficient_scopeThe key lacks the scope, or is a personal key.
403FORBIDDENplan_requiredWhen API keys need a plan and the organisation has none in good standing.
404NOT_FOUNDThe organisation is not the key’s own.
403FORBIDDENThe request came from a web page (it has an Origin header). Call the API from your server.
422VALIDATIONA parameter or the body breaks the schema.
429RATE_LIMITEDThe 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/v1/orgs/{orgId}/webhooks/{endpointId}/test

Sends a signed ping to this endpoint now and reports the result.

Key
Organisation key, wwo_
Scope
webhooks:manage
Plans
Pro and Trainer/Gym. Webhooks need the organisation’s own plan. Plans and limits

Path parameters

orgIdstringRequired

The organisation’s ID. A key works only on its own organisation.

1 to 64 characters.

endpointIdstringRequired

The endpoint’s ID.

1 to 64 characters.

Headers

Idempotency-Keystring

Makes 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

deliveryIdstringRequired
statestringRequired

One ofpendingdeliveredfailed

lastStatusinteger or nullRequired

Errors

404NOT_FOUNDNo endpoint with that ID.
403FORBIDDENplan_requiredA test while the organisation has no plan of its own that includes webhooks.
Errors any call can get: 401, 403, 404, 409, 422, 429
401UNAUTHENTICATEDThe key is missing, unknown, expired or revoked.
403FORBIDDENinsufficient_scopeThe key lacks the scope, or is a personal key.
403FORBIDDENplan_requiredWhen API keys need a plan and the organisation has none in good standing.
404NOT_FOUNDThe organisation is not the key’s own.
403FORBIDDENThe request came from a web page (it has an Origin header). Call the API from your server.
422VALIDATIONA parameter or the body breaks the schema.
422VALIDATIONidempotency_key_reusedThe Idempotency-Key was used for a different request.
409PAYLOAD_MISMATCHidempotency_in_progressThe first request with this Idempotency-Key is still running (for up to a minute).
429RATE_LIMITEDThe 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/v1/orgs/{orgId}/webhooks/{endpointId}/deliveries

Newest first, for the last 30 days.

Key
Organisation key, wwo_
Scope
webhooks:manage
Plans
Pro and Trainer/Gym. Webhooks need the organisation’s own plan. Plans and limits

Path parameters

orgIdstringRequired

The organisation’s ID. A key works only on its own organisation.

1 to 64 characters.

endpointIdstringRequired

The endpoint’s ID.

1 to 64 characters.

Query parameters

cursorstring

nextCursor from the previous page.

At most 400 characters.

limitinteger

Page size, 20 when left out.

1 to 50.

Response 200 · Deliveries

itemsarray of objectsRequired
8 fields in each item
idstringRequired

The webhook-id header: the same on every retry of this message.

eventTypestringRequired
statestringRequired

One ofpendingdeliveredfailed

attemptsintegerRequired
lastStatusinteger or nullRequired

HTTP status of the last attempt; 0 when there was no response.

createdAtintegerRequired

Unix time in seconds

deliveredAtinteger or nullRequired

Unix time in seconds

nextAttemptAtinteger or nullRequired

Unix time in seconds

nextCursorstring or nullRequired

Send it as cursor for the next page. Null on the last page.

Errors

404NOT_FOUNDNo endpoint with that ID.
Errors any call can get: 401, 403, 404, 422, 429
401UNAUTHENTICATEDThe key is missing, unknown, expired or revoked.
403FORBIDDENinsufficient_scopeThe key lacks the scope, or is a personal key.
403FORBIDDENplan_requiredWhen API keys need a plan and the organisation has none in good standing.
404NOT_FOUNDThe organisation is not the key’s own.
403FORBIDDENThe request came from a web page (it has an Origin header). Call the API from your server.
422VALIDATIONA parameter or the body breaks the schema.
429RATE_LIMITEDThe 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();