Skip to content
Developer docsInvitations

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

Newest first. Trainers see the invitations they created; API keys see customer invitations.

Key
Organisation key, wwo_
Scope
customers:read
Plans
Pro and Trainer/Gym. Plans and limits

Path parameters

orgIdstringRequired

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

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 · Pending invitations

itemsarray of objectsRequired
7 fields in each item
idstringRequired
kindstringRequired

customer links a customer; trainer adds a trainer to a gym.

One ofcustomertrainer

labelstringRequired

Your private note. The customer does not see it in the apps; it is part of their data download.

coachobject or nullRequired

Customer invitations: the coach the customer gets on accepting.

2 fields
userIdstringRequired
displayNamestringRequired
createdByobject or nullRequired

A member of the organisation.

2 fields
userIdstringRequired
displayNamestringRequired
createdAtintegerRequired

Unix time in seconds

expiresAtintegerRequired

Unix time in seconds

nextCursorstring or nullRequired

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

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

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.

Key
Organisation key, wwo_
Scope
customers:write
Plans
Pro and Trainer/Gym. 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

kindstringRequired

customer links a customer; trainer adds a trainer to a gym.

One ofcustomertrainer

labelstring

At most 48 characters.

coachIdstring

Customer 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

idstringRequired
kindstringRequired

customer links a customer; trainer adds a trainer to a gym.

One ofcustomertrainer

labelstringRequired

Your private note. The customer does not see it in the apps; it is part of their data download.

coachobject or nullRequired

Customer invitations: the coach the customer gets on accepting.

2 fields
userIdstringRequired
displayNamestringRequired
createdByobject or nullRequired

A member of the organisation.

2 fields
userIdstringRequired
displayNamestringRequired
createdAtintegerRequired

Unix time in seconds

expiresAtintegerRequired

Unix time in seconds

codestringRequired

Shown once. Share the link, not the code alone.

urlstringRequired

The link the person opens: https://wristworkout.com/join/<code>, which sends them on to the portal.

Errors

403FORBIDDENinsufficient_scopekind is trainer: only owners and admins invite trainers, in the portal.
403FORBIDDENplan_requiredA customer invitation, when the organisation needs a plan to invite customers.
422VALIDATIONcoachId is not a member (UNKNOWN_REFERENCE), or label is over 48 characters.
422LIMIT_EXCEEDEDThe organisation has 1,000 pending invitations (details.limit is invitations).
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/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/v1/orgs/{orgId}/invitations/{invitationId}

The link stops working at once. API keys can revoke customer invitations.

Key
Organisation key, wwo_
Scope
customers:write
Plans
Pro and Trainer/Gym. Plans and limits

Path parameters

orgIdstringRequired

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

1 to 64 characters.

invitationIdstringRequired

The invitation’s ID.

1 to 64 characters.

Response 200 · Revoked; the link no longer works

okbooleanRequired

Valuetrue

Errors

404NOT_FOUNDNo invitation with that ID that this key can see.
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/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();