Bearer authentication is the standard way to callDocumentation Index
Fetch the complete documentation index at: https://docs.onvy.health/llms.txt
Use this file to discover all available pages before exploring further.
health-api. You obtain an access token for one ONVY project, then send it on protected API requests.
What you need from ONVY
- A
project_id - The API base URL:
https://api.onvy.health - Either:
- a confidential OAuth client with
client_idandclient_secretfor server-to-server traffic - or a public client plus a supported upstream identity token for user authentication flows
- a confidential OAuth client with
Choose the right flow
| Use case | Endpoint | Notes |
|---|---|---|
| Backend or BFF integration | POST /v1/projects/{project_id}/auth/server | Uses HTTP Basic auth with a confidential client and returns an access token. |
| Mobile or web app token exchange | POST /v1/projects/{project_id}/auth/sdk | Exchanges an upstream OIDC token or ONVY refresh token for a user-scoped ONVY token. |
| Raw OAuth integration | POST /oauth/token | Canonical OAuth token authority. Form-encoded rather than JSON. |
Server-to-server authentication
Use this flow when your backend calls ONVY directly.User authentication for mobile or web apps
Use this flow when your app already authenticates the user with your own identity provider. Exchange an upstream identity token:Canonical OAuth endpoint
UsePOST /oauth/token when you want direct control over the OAuth grant parameters.
Example server flow:
Token claims
ONVY access tokens include these core claims:issaudexpiatnbfjtiproject_idsubprincipal_typescope
principal_type=user, the token must also include user_id.
Scope format
Scopes follow this pattern:users:readdaily_records:createchat_completions:createadmin.oauth_clients:revoke
How the project auth endpoints map to OAuth
/v1/projects/{project_id}/auth/servermaps to theclient_credentialsgrant forurn:onvy:project:{project_id}/v1/projects/{project_id}/auth/sdkmaps to token exchange or refresh, depending on thegrantvalue in the JSON body/oauth/tokenis the canonical OAuth endpoint when you want to send grant parameters directly