Authentication
You need aclient_id and client_secret to interact with the Cobalt API. You will also need an access_token for each user which can be obtained in through the Cobalt Link flow.
Headers
Example Request
Access Tokens
Access tokens are obtained through the Cobalt Link flow. Each access token is associated with a specific set of EHR credentials. An access token alone cannot be used against the API — every request also requires yourclient_id and client_secret.
Error Responses
Every authenticated endpoint runs the same credential check before your request reaches the resource. The check can fail with the following status codes:
All error responses share the shape
{ "success": false, "message": "...", "error": "..." }, where error is present on the codes noted above.
A GET request made with a token whose linked account needs attention (credentials_required, mfa_required, or dual_credentials_required) still succeeds so cached data stays readable, but the response carries a Cobalt-Link-Action-Required: true header and a Cobalt-Link-Access-Token-Status header describing the condition. Write requests in the same state return 403.
Rotating and Revoking Access Tokens
If a token may have been exposed, rotate it: a new token is returned and the old one is invalidated immediately. The user’s EHR connection is unaffected and no re-link is required. Requests with a rotated-out token return401. To rotate many tokens at once, loop the rotate endpoint over your stored tokens.
To revoke a user’s access entirely, deactivate the account. Subsequent requests with that token return 403 with "error": "login_required", and the user reconnects through the normal Cobalt Link flow.
For a broad compromise, lock your client: every token and EHR session under your client is invalidated immediately and your client_secret is cleared. Contact support to unlock.