Documentation

Keely for developers

Errors.

Every error is JSON with the fitting status and a code to act on. Over the rate limit, the API says how long to wait.

Updated

On this page
  1. The errors
  2. Rate limit

Every error is JSON with the fitting status: { "error": "<code>", "message": "<plain words>" }, sometimes with more. Act on error, not on message, which may change.

The errors

CodeStatusWhen
invalid_request400A bad date, range, metric or body; message says which
unauthorized401No token. Comes with WWW-Authenticate: Bearer resource_metadata="https://meetkeely.com/.well-known/oauth-protected-resource/api/v1"
invalid_token401The token expired, was revoked (the person disconnected), or isn’t a client’s. The same header, with error="invalid_token"
app_not_registered403The client isn’t a registered app. Assistants use the connector, not the API
app_not_approved403The app is awaiting approval, and the person isn’t its developer
app_suspended403Keely suspended the app
insufficient_scope403The answer needs a scope the person didn’t allow. Comes with scope, the one needed, and scopes, the ones granted
not_found404An unknown path, or a day, workout or entry that doesn’t exist
method_not_allowed405With an Allow header
journal_off409The person hasn’t turned on journal sharing in the Keely app
journal_refused422The journal’s rules refused a write. reason is one of unknown_tag, bad_tags, future, too_old, bad_window, daily_limit, bad_ids, bad_label, bad_category, tag_cap, not_found, not_added_by_an_app
rate_limited429Too many requests. Wait Retry-After seconds
unavailable503Keely’s backend didn’t answer. Comes with Retry-After: 5
403 insufficient_scope
{
  "error": "insufficient_scope",
  "message": "This person hasn’t allowed your app to read their workouts.",
  "scope": "workouts",
  "scopes": ["nights", "days"]
}

Rate limit

About 60 requests a minute per app and person, best effort: it bounds a runaway loop rather than enforcing a quota. Over it, the API answers 429 rate_limited with Retry-After. A person’s whole year is 366 points per series and at most four reads of 92 days, so an app that keeps a copy current never gets near it.