Skip to content
Developer docsRate limits

Conventions

Rate limits

Each API key has its own limit on requests per minute, and every response to a key says where it stands.

Limits per key

Limits per key
KeyRequests per minute
Organisation key, wwo_100
Personal key, wwp_30

Requests are counted in windows of one minute. A window starts with the key’s first request and lasts 60 seconds; the first request after it ends starts the next one.

The limits are the same for every key of a kind, whatever its organisation or plan. To get more done within them, see staying under.

Headers

Once the API has checked the key and its scopes, it counts the request, and the response carries two headers. A request refused before that (401, 403 insufficient_scope from the scope check, or 404 for another organisation or a path no operation has) is not counted and has neither header. Two refusals come after the count and carry both headers: 403 plan_required, and 403 insufficient_scope for a key that tries to invite a trainer.

HTTP
RateLimit-Policy: "key";q=100;w=60
RateLimit: "key";a=57;w=23
  • RateLimit-Policy: the key’s quota q for each window of w seconds.
  • RateLimit: a requests left in the current window, which ends in w seconds.

The headers follow the IETF draft draft-ietf-httpapi-ratelimit-headers-12, and will follow the RFC once it is published. That change will be in the changelog.

Going over

A request over the limit gets 429 RATE_LIMITED with a Retry-After header: the seconds until the window ends. details.retryAfter holds the same number. Requests sent before then fail too, so wait.

JavaScript
// Calls the API, waiting and retrying when the key is over its limit.
async function callWithRetry(url, init, attempts = 5) {
  for (let i = 0; i < attempts; i++) {
    const res = await fetch(url, init);
    if (res.status !== 429) return res;
    const seconds = Number(res.headers.get('Retry-After') ?? '1');
    await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
  }
  throw new Error(`Still rate limited after ${attempts} attempts`);
}

Staying under

  • Watch a in the RateLimit header, and slow down as it nears 0.
  • Use webhooks to hear about changes instead of polling for them.
  • Assign a programme to up to 100 customers in one request.
  • Read pages of 50 when you list everything.

The service also limits each credential to 120 requests a minute across all routes, to protect the service. The limits per key are lower, so you meet those first.

Other limits

Limits
LimitValue
Request body64 KiB; 128 KiB on programme routes
Page size (limit) of a list with a cursor1 to 50, 20 when left out
Customers in one assignment request1 to 100
Active programmes a customer can have, their own and assigned30, their own within their plan’s allowance
Active library programmes per organisation500, within the plan’s allowance
Active exercises and machines per organisation300 exercises, 200 machines
Pending invitations per organisation1,000
Linked customers per organisation5,000
Members of a gym100
Webhook endpoints per organisation10
Active API keysThe plan’s allowance, and 20 per account
Stations per programme, sets per station15 stations, 10 sets
Plan size the watch downloads6,000 bytes