default
<Callout intent="info"> Candid Health SDKs automatically handle authentication workflows after configuring them with the `client_id` and `client_secret`. </Callout>

Candid Health utilizes the OAuth 2.0 bearer token authentication scheme in our auth flow. You obtain the bearer token for all subsequent API requests via the /auth/v2/token endpoint defined below, which requires you to provide your client_id and client_secret. Your client_id and client_secret can be generated from the "Users & Credentials" tab by your org admin.

The /auth/v2/token endpoint accepts both Content-Type: application/json and Content-Type: application/x-www-form-urlencoded. The request body should contain the client_id and client_secret as follows:

{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}

or as URL-encoded form data:

client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET

The bearer token is a signed JWT. The public key for the JWT can be found here for any verification workflows.

The bearer token should be provided in the Authorization header for all subsequent API calls.

<Callout intent="warning"> The bearer token expires 5 hours after it has been created. After it has expired, the client will receive an "HTTP 401 Unauthorized" error, at which point the client should generate a new token. It is important that tokens be reused between requests; if the client attempts to generate a token too often, it will be rate-limited and will receive an `HTTP 429 Too Many Requests` error. </Callout>
post/api/auth/v2/token

Request

  • Base URL
    https://pre-api.joincandidhealth.com
  • URL
    https://pre-api.joincandidhealth.com/api/auth/v2/token
  • Auth
    none declared

Request body

client_idstring required

Your application's Client ID.

client_secretstring required

Your application's Client Secret.

Response

Response with status 200

access_tokenstring required
expires_ininteger required

Time in seconds.

token_typestring required

Changes

    • breaking

      the response's body type changed from no type to object for status

    • breaking

      the response's property type changed from no type to object for status

    • breaking

      the response's property type changed from no type to object for status

    • info

      added the required property to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      api operation id get_token removed and replaced with default_get_token