Error Response Format
Every error response uses RFC 9457 Problem Details and is served withContent-Type: application/problem+json:
A human-readable explanation of this occurrence. Its wording can change between releases: log or show it, but don’t branch on it.
A machine-readable error code, stable across releases. Branch on this. See Error Codes.
Only on a
422 validation error: every invalid value in the request. See Validation Errors.type member of RFC 9457 is omitted, which the RFC defines as about:blank: the error is fully described by its status and code.
Handling Errors in Code
Error Codes
An error that needs no code of its own has the name of its HTTP status:BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT, NOT_IMPLEMENTED, BAD_GATEWAY, SERVICE_UNAVAILABLE and so on. The codes below are more specific:
UNSUPPORTED_PROVIDER covers what a provider cannot be configured for, such as OAuth or live sync mode. A data or webhook endpoint the provider has no implementation of answers 501 with NOT_IMPLEMENTED instead.
WEBHOOK_VERIFICATION_FAILED (401) is sent to providers whose webhook callback failed signature or token verification; your integration never sees it.
Validation Errors
A request whose parameters or body fail validation gets a422 with code VALIDATION_ERROR. The errors array lists every invalid value, and detail summarises the first one:
Where the invalid value is:
path, query, header or body, followed by the field name (and list indexes inside a body).The Pydantic error type, such as
missing, uuid_parsing or enum.The submitted values are never echoed back, so a rejected password or health record does not end up in your logs.
- A required parameter is missing:
start_timeandend_timefor timeseries endpoints,start_dateandend_datefor event endpoints,user_idfor OAuth authorization. - A UUID has the wrong format (
"type": "uuid_parsing"). Usexxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. - A provider name is not one of the listed values (
"type": "enum"). Provider names are lowercase:garmin,polar,suunto,apple.
POST /api/v1/auth/login with a missing field answers 401 (UNAUTHORIZED, Incorrect email or password), the same as wrong credentials.
SDK Sync Payloads (Async Validation)
POST /api/v1/sdk/users/{user_id}/sync returns 202 Accepted immediately and validates/imports the payload in a background worker. A malformed record does not produce a synchronous 400/422 — validation failures are surfaced via the batch’s sync status (and internal error reporting), not the HTTP response. The endpoint returns 400 only for an unsupported provider.
Authentication Errors
Missing Authentication
Invalid API Key
Protected Endpoint
Provider Errors
A
401 always means a problem with your credentials (API key or JWT). Problems with the
user’s connection to a provider use the statuses below, so you can tell them apart.User Not Connected (404)
Reconnection Required (409)
No Provider API Token (400)
Provider Unavailable (502 / 503)
502, PROVIDER_ERROR), or kept rate-limiting the request after retries (503, PROVIDER_RATE_LIMITED). The detail names the provider’s status; its own response is not included.
Solution: For a provider 5xx, no response, or a 503, retry later; the user’s connection is still valid. A 502 naming a provider 4xx (such as status 400) means the provider refused the request, and retrying it unchanged fails the same way.
Provider Doesn’t Support OAuth
Resource Errors
Resource Not Found
Migrating from the Previous Format
Earlier releases answered errors with{"detail": "..."} only. The current format keeps detail as a string, so code that reads it keeps working. What changed:
- Validation errors are
422, not400. They used to be a400describing only the first invalid value; now they are a422listing all of them inerrors. A client that treats every400as a validation error should check for422(orcode == "VALIDATION_ERROR") instead. Content-Typeisapplication/problem+json. JSON parsers accept it as is; only a client that checks for exactlyapplication/jsonbefore parsing needs updating.- New members:
title,statusandcodeon every error,errorson a422.