Skip to main content
Version: v12

Bearer Token Authentication

warning

This page does not apply to the BQL API. The BQL API uses its own API token authentication (ApiKey scheme). Bearer tokens described here are only used by other Brinqa Platform API endpoints, such as the metrics API.

Some Brinqa Platform API endpoints use bearer token authentication to verify the identity of the user making the request. This page describes how to obtain and use a bearer token for those endpoints.

Obtain a bearer token

To get your access token, use the following cURL command:

curl --location --request POST 'https://<your-brinqa-platform-url>/api/auth/login' \
--header 'Accept: application/json' \
--header 'X-Requested-With: XMLHttpRequest' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "<your-username>",
"password": "<your-password>"
}'

Replace <your-brinqa-platform-url>, <your-username>, and <your-password> with your Brinqa Platform URL and login information. This token grants the same permissions as the user's access within the Brinqa Platform. If a user's access in the Brinqa Platform is limited to a certain subset of data, their API access is also limited to that subset.

<your-password> is the password assigned to the user record in the Brinqa Platform. If your user is configured with single sign-on (SSO) authentication, you can edit the user record and set a password specifically for token generation. Alternatively, you can create a new user designated to generate tokens. Either way, your SSO username and password remain unaffected.

If you have multi-factor authentication (MFA) enabled, add "code": "<your-mfa-code>" at the end of the request body:

curl --location --request POST 'https://<your-brinqa-platform-url>/api/auth/login' \
--header 'Accept: application/json' \
--header 'X-Requested-With: XMLHttpRequest' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "<your-username>",
"password": "<your-password>",
"code": "<your-mfa-code>"
}'

Replace <your-mfa-code> with the authenticator code generated by your organization's authenticator app.

Upon successful authentication, you receive a response similar to the following that includes your access token:

{
"username": "<your-username>",
"token_type": "Bearer",
"access_token": "<your-access-token>",
"expires_in": 86400,
"refresh_token": ""
}

Copy the <your-access-token> value. This token is what you use to authenticate your requests.

The access token is valid for 86400 seconds, or 24 hours. After it expires, you can generate a new token by following the same steps.