Skip to main content

Authentication Errors

Missing Authentication

{
  "detail": "Authentication required: provide JWT token or API key"
}
Cause: No API key provided in the request. Solution: Include the API key header:
-H "X-Open-Wearables-API-Key: YOUR_API_KEY"
Use X-Open-Wearables-API-Key header, not Authorization: Bearer.

Invalid API Key

{
  "detail": "Invalid or missing 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

{
  "detail": "Could not validate credentials"
}
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

User Not Connected

{
  "detail": "User not connected to garmin"
}
Cause: Attempting to sync or fetch data from a provider the user hasn’t connected yet. Solution: Complete the OAuth flow first:
GET /api/v1/oauth/garmin/authorize?user_id={user_id}

Token Expired

{
  "detail": "Token expired and no refresh token available for garmin"
}
Or:
{
  "detail": "Garmin authorization expired. Please re-authorize."
}
Cause: The OAuth token for this provider has expired and cannot be refreshed. Solution: User needs to reconnect via OAuth:
GET /api/v1/oauth/garmin/authorize?user_id={user_id}

Provider Doesn’t Support OAuth

{
  "detail": "Provider 'apple' does not 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.

Invalid Provider Name

{
  "detail": "Input should be 'apple', 'garmin', 'polar' or 'suunto'"
}
Cause: Provider name is invalid or has wrong case. Solution: Use lowercase provider names: garmin, polar, suunto, apple.

Validation Errors

Missing Required Field

{
  "detail": "Field required"
}
Cause: A required query parameter or request body field is missing. Solution: Check the API documentation for required parameters. Common required fields:
  • start_time and end_time for timeseries endpoints
  • start_date and end_date for event endpoints
  • user_id for OAuth authorization

Invalid UUID Format

{
  "detail": "Input should be a valid UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `n` at 1"
}
Cause: A UUID parameter (like user_id) has an invalid format. Solution: Ensure UUIDs are in the correct format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Resource Errors

Resource Not Found

{
  "detail": "User with ID: {id} not found."
}
Cause: The requested resource (user, connection, etc.) doesn’t exist. Solution: Verify the ID is correct and the resource was created.

HTTP Status Code Reference

StatusMeaningCommon Causes
200SuccessRequest completed successfully
201CreatedResource created successfully
400Bad RequestInvalid parameters, validation errors
401UnauthorizedMissing or invalid authentication
404Not FoundResource doesn’t exist
422UnprocessableRequest body validation failed
500Server ErrorInternal error (please report)