Generate a Bearer Token

📘

BEARER TOKEN LIFESPAN

The lifespan of a Bearer token is one hour (3600 seconds) for both sandbox and production environments.

We recommend automating transactions to use the tokens generated over the token lifespan. Obtaining tokens for each transaction is less efficient and does not improve the security criteria for any transactions.


Content-Type: application/json
Authorization: Bearer <Your-Access-Token>

In your development platform/tool

Run the following in your platform with your sandbox credentials provided by Optum.

curl --request POST \
     --url https://sandbox-apigw.optum.com/apip/auth/v2/token \
     --header 'accept: */*' \
     --header 'content-type: application/json' \
     --data '
{
  "client_id": "your client ID",
  "client_secret": "your secret",
  "grant_type": "client_credentials"
}

Here is an example output:

In interactive Try It interface

  1. Go to API reference's Try It page.
  2. For example, to generate an API Bearer Token, click API Tools in the developer portal.
  3. Click /apip/auth/v2/token.
  4. Use your sandbox client Id and client secret provided by Optum in their respective fields, and use client_credentials in the grant_type field and click Try It.
2174

Try It Feature

Related Topics