v3

latestOpenAPI 3.1.02026-07-31121144224.9 KB
External: Mobile SDK

Create User Token

Exchange app credentials or admin auth for user-scoped access token.

Supports two authentication methods:

  1. App credentials: Provide app_id and app_secret in the request body
  2. Admin authentication: Authenticate as a developer/admin via Bearer token (app_id and app_secret can be omitted)

Both methods return access_token with refresh_token.

Returns a JWT token scoped to SDK endpoints only. Tokens expire after configured time (default: 60 minutes).

Args: user_id: OpenWearables User ID (UUID) payload: Optional application credentials (app_id, app_secret) db: Database session developer: Optional authenticated developer (from Bearer token)

Returns: TokenResponse containing access_token, token_type, and refresh_token

Raises: 401: If app credentials are invalid or admin auth is missing 400: If neither app credentials nor admin auth is provided

post/api/v1/users/{user_id}/token

Path parameters

user_idstring uuid required

Request body

app_idstring nullable
app_secretstring nullable

Response

Successful Response

access_tokenstring required
token_typestring
refresh_tokenstring nullable
expires_ininteger nullable