Request an Access Token

Before you can request an access token and invoke the API, you must configure an API service account in the Clean Room UI. If the service account has been configured, you can use it to retrieve an access token to authenticate to the API.

šŸ“˜

2 token/day limit

LiveRamp enforces a maximum of 2 tokens per 24-hour period via the /oauth/token call.

  1. In the Clean Room UI, go to the Manage API Key page and copy the client ID and client secret.

  2. Create a BASIC access key with Base64 encoding using the client ID and client secret:

    export AUTH_BASIC=$(printf "%s" "client_id:client_secret" | base64)
    
  3. Submit a request for an access token:

    curl -k -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic  
    $AUTH_BASIC" -d "grant_type=client_credentials"  
    -X POST <https://api.habu.com/v1/oauth/token>  
    {  
        "accessToken": ".............",  
        "tokenType": "Bearer",  
        "expiresIn": 86400,  
        "expiresAt": "2023-10-14T18:47:16.104+00:00"  
    }
    

    If the access token request is valid and authorized, the token server issues the access token in the format shown below:

    {  
       "accessToken": ".............",  
       "tokenType": "Bearer",  
       "expiresIn": 86400,  
       "expiresAt": "2023-10-14T18:47:16.104+00:00"  
    }
    
  4. Use the accessToken from the response to authorize API calls via HTTP header or your HTTP client library's authorization method:

    curl -k -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic 
    $AUTH_BASIC" -d "grant_type=client_credentials" -X POST <https://api.habu.com/v1/oauth/token>  
       {  
           "accessToken": ".............",  
           "tokenType": "Bearer",  
           "expiresIn": 86400,  
           "expiresAt": "2023-10-14T18:47:16.104+00:00"  
       }
    

    Or in the third-party tool Postman:

    Postman authorization call

šŸ“˜

About access token expiration

Access tokens expire after 12 hours. The expiresAt field in the response specifies the time of expiration.

Reuse the access token in subsequent requests. Avoid requesting a new token until the current one has expired.

Starting October 8, 2025: LiveRamp will enforce a maximum of 2 tokens/24-hour period.

API Response Codes

CodeMessage
200Successfully fetched clean room details
400Bad Request - Incorrect syntax or request
401Authorization information was missing or invalid
404The specified resource was not found
500Internal Server Error