Skip to main content

Error Response Format

Every error response uses RFC 9457 Problem Details and is served with Content-Type: application/problem+json:
string
required
The HTTP status phrase, such as Not Found.
integer
required
The HTTP status code, the same as the response’s.
string
required
A human-readable explanation of this occurrence. Its wording can change between releases: log or show it, but don’t branch on it.
string
required
A machine-readable error code, stable across releases. Branch on this. See Error Codes.
array
Only on a 422 validation error: every invalid value in the request. See Validation Errors.
The type member of RFC 9457 is omitted, which the RFC defines as about:blank: the error is fully described by its status and code.
Responses that carry no body by definition (204, 304, and any answer to a HEAD request) stay empty. Everything else, including unexpected 500s, has the body above.

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 a 422 with code VALIDATION_ERROR. The errors array lists every invalid value, and detail summarises the first one:
(string | integer)[]
Where the invalid value is: path, query, header or body, followed by the field name (and list indexes inside a body).
string
What is wrong with the value.
string
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.
Common causes:
  • A required parameter is missing: start_time and end_time for timeseries endpoints, start_date and end_date for event endpoints, user_id for OAuth authorization.
  • A UUID has the wrong format ("type": "uuid_parsing"). Use xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
  • A provider name is not one of the listed values ("type": "enum"). Provider names are lowercase: garmin, polar, suunto, apple.
A failed login is the exception: 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

Cause: No API key provided in the request. Solution: Include the API key header:
Use X-Open-Wearables-API-Key header, not Authorization: Bearer.

Invalid API Key

Cause: The provided API key doesn’t exist or has been revoked. Solution: Verify your API key is correct and active in the developer portal.

Protected Endpoint

Cause: Attempting to access an endpoint that requires developer JWT authentication (not just an API key). Solution: Some operations (like deleting users) require logging in via the developer portal. Use JWT authentication for these endpoints.

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)

Cause: Attempting to sync or fetch data from a provider the user hasn’t connected yet. Solution: Complete the OAuth flow first:

Reconnection Required (409)

Cause: The user’s OAuth grant is gone: the token expired and cannot be refreshed, or the provider rejected it (for example, the user revoked access in the provider’s app). Solution: User needs to reconnect via OAuth:

No Provider API Token (400)

Cause: The connection has no API token to call the provider with, e.g. an SDK-based provider whose data is pushed from the device. Solution: Use the SDK sync or import endpoints for this provider.

Provider Unavailable (502 / 503)

Cause: The provider’s API failed or did not respond (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

Cause: Attempting to use OAuth with a push-only provider like Apple Health. Solution: Apple Health data is pushed from the device, not pulled via OAuth. Use the SDK sync or import endpoints instead.

Resource Errors

Resource Not Found

Cause: The requested resource (user, connection, etc.) doesn’t exist. Solution: Verify the ID is correct and the resource was created.

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, not 400. They used to be a 400 describing only the first invalid value; now they are a 422 listing all of them in errors. A client that treats every 400 as a validation error should check for 422 (or code == "VALIDATION_ERROR") instead.
  • Content-Type is application/problem+json. JSON parsers accept it as is; only a client that checks for exactly application/json before parsing needs updating.
  • New members: title, status and code on every error, errors on a 422.

HTTP Status Code Reference