API reference
Invitations
Create, list and revoke customer invitations. Each link works once and expires after 7 days.
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.
Pending invitations
GET/
Newest first. Trainers see the invitations they created; API keys see customer invitations.
Path parameters
orgIdstringRequiredThe organisation’s ID. A key works only on its own organisation.
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 · Pending invitations
itemsarray of objectsRequired7 fields in each item
idstringRequiredkindstringRequiredcustomerlinks a customer;traineradds a trainer to a gym.customertrainerlabelstringRequiredYour private note. The customer does not see it in the apps; it is part of their data download.
coachobject or nullRequiredCustomer invitations: the coach the customer gets on accepting.
2 fields
userIdstringRequireddisplayNamestringRequired
createdByobject or nullRequiredA member of the organisation.
2 fields
userIdstringRequireddisplayNamestringRequired
createdAtintegerRequiredUnix time in seconds
expiresAtintegerRequiredUnix time in seconds
nextCursorstring or nullRequiredSend it as
cursorfor the next page. Null on the last page.
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/invitations \
-H "Authorization: Bearer wwo_your_key"const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/invitations', {
headers: { Authorization: 'Bearer wwo_your_key' },
});
const data = await res.json();Invite a customer, or a trainer to a gym
POST/
Returns the code and link once; Wrist Workout sends no email, so share the link yourself. It works once and expires after 7 days. Trainer invitations need an owner or admin of a gym. API keys may invite customers.
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
kindstringRequiredcustomerlinks a customer;traineradds a trainer to a gym.customertrainerlabelstringAt most 48 characters.
coachIdstringCustomer invitations: a member to coach the customer. Defaults to the trainer who invites.
An ID of 12 letters and digits.
Any other field is refused with 422 VALIDATION.
Response 201 · Created
idstringRequiredkindstringRequiredcustomerlinks a customer;traineradds a trainer to a gym.customertrainerlabelstringRequiredYour private note. The customer does not see it in the apps; it is part of their data download.
coachobject or nullRequiredCustomer invitations: the coach the customer gets on accepting.
2 fields
userIdstringRequireddisplayNamestringRequired
createdByobject or nullRequiredA member of the organisation.
2 fields
userIdstringRequireddisplayNamestringRequired
createdAtintegerRequiredUnix time in seconds
expiresAtintegerRequiredUnix time in seconds
codestringRequiredShown once. Share the link, not the code alone.
urlstringRequiredThe link the person opens:
https://wristworkout.com/join/<code>, which sends them on to the portal.
Errors
403FORBIDDENinsufficient_scope | kind is trainer: only owners and admins invite trainers, in the portal. |
403FORBIDDENplan_required | A customer invitation, when the organisation needs a plan to invite customers. |
422VALIDATION | coachId is not a member (UNKNOWN_REFERENCE), or label is over 48 characters. |
422LIMIT_EXCEEDED | The organisation has 1,000 pending invitations (details.limit is invitations). |
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/invitations \
-H "Authorization: Bearer wwo_your_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"kind": "customer",
"label": "Tuesday small group",
"coachId": "u6Fj1RkS8dMa"
}'// Send the same key again if you retry.
const idempotencyKey = crypto.randomUUID();
const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/invitations', {
method: 'POST',
headers: {
Authorization: 'Bearer wwo_your_key',
'Content-Type': 'application/json',
'Idempotency-Key': idempotencyKey,
},
body: JSON.stringify({
kind: 'customer',
label: 'Tuesday small group',
coachId: 'u6Fj1RkS8dMa',
}),
});
const data = await res.json();Revoke a pending invitation
DELETE/
The link stops working at once. API keys can revoke customer invitations.
Path parameters
orgIdstringRequiredThe organisation’s ID. A key works only on its own organisation.
1 to 64 characters.
invitationIdstringRequiredThe invitation’s ID.
1 to 64 characters.
Response 200 · Revoked; the link no longer works
okbooleanRequiredtrue
Errors
404NOT_FOUND | No invitation with that ID that this key can see. |
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/invitations/invitation_id \
-H "Authorization: Bearer wwo_your_key"const res = await fetch('https://api.wristworkout.com/v1/orgs/org_id/invitations/invitation_id', {
method: 'DELETE',
headers: { Authorization: 'Bearer wwo_your_key' },
});
const data = await res.json();