Skip to main content

Configure Bearer Token Credentials

Configure a Credential that sends a bearer token and can refresh token values through a generated Credential Payload.

Configure Bearer Token Credentials

Use a Bearer Token Credential when the external API expects an Authorization: Bearer ... header.

This type is normally used for OAuth-style APIs where an access token is issued by an authentication endpoint. Payloads stores the current token values on the Credential and links the Credential to a generated Credential Payload that can model the token request and response.

For more detail on the generated Payload, see Configure a Credential Payload.

Before you start

Collect the values required by the authentication API.

You will usually need a client id, client secret, access token, refresh token, token duration, and token endpoint. The exact set depends on the external API.

Check the API documentation for the token request body and response body. Payloads needs those details on the generated Credential Payload so it can read the response and update the Credential.

Configure the Credential

Create a Credential from the relevant Integration.

Set Type to Bearer Token.

Enter the Client Id and Client Secret if the token refresh request needs them.

Enter the current Access Token and Refresh Token if you already have them.

Set Access Token Duration in Minutes so Payloads can calculate when the token expires.

Save the Credential.

Payloads creates a related Credential Payload for the token refresh flow. Open that Payload from the Token Payload field and finish the request, response, and target mappings.

A Bearer Token Credential record showing token fields, expiry fields, and the related generated Credential Payload.

The Bearer Token Credential stores the current token state and links to the generated Credential Payload used for refresh configuration.

Configure the generated Payload

Open the generated Credential Payload.

Set the Endpoint and Method required by the authentication API.

Configure the Callout Body, Headers, or Parameters required by the token request.

Configure the Response Body so Payloads can identify values such as access_token and refresh_token.

Use Data Targets to write updated token values back to the Credential.

Attach it to a Payload

Open the outbound Payload that should use the bearer token.

Select the Bearer Token Credential in the Payload header fields, then save the Payload.

Payloads uses the Credential to generate the bearer Authorization header when the request runs.

What to check

Before testing, check that:

  • the Credential has the expected access token and refresh token values

  • Access Token Duration in Minutes matches the token lifetime

  • the generated Credential Payload has the correct endpoint, method, request body, response body, and Data Targets

  • the business Payload has this Credential selected

After testing, open the Job records for both the token flow and the business Payload. Confirm the token response was read correctly and the business API call used the current bearer token.

Did this answer your question?