Skip to content
Last updated

Referral API v1 Authentication Management Guide

The Referral Authentication api allows you to retrieve a JWT token to use with the authenticated referral api endpoints.

Deprecation warning

⚠️ API version 1.0.8 is scheduled for deprecation on 2027-07-01.

It will continue to function until then; please migrate to 2.x.x.

Overview

With the Referral Authentication API, you can:

  • Retrieve a JWT token to authenticate your B2B api calls.
  • Rotate your client_secret.

One must pay attention to the token expiry, a token is valid for the entiity of its life.


Authenticate

Before you can call any API endpoint, you must authenticate using the client_id and client_secret originally provided by your RAI Partners' Client Success representative.

API Call Example:

curl -i -X POST \
  https://api.raipartners.com/referral/auth/token \
  -H 'API-Version: 1.0.8' \
  -H 'Content-Type: application/json' \
  -d '{
    "client_id": "my-client-id",
    "client_secret": "my-super-auth-secret"
  }'

API Call Response Example:

Response
{ "scope": "read:user write:user", "refresh_expires_in": 300, "access_token": "eyo.....", "expires_in": 300, "token_type": "Bearer", "not-before-policy": 0 }

Rotating your secret

Trigger a client_secret rotation per your company's policy

  • A successful response confirms that the secret has been rotated and provides new secret value.

API Call Example:

curl -i -X POST \
  https://api.raipartners.com/referral/auth/client-secret/rotation \
  -H 'API-Version: 1.0.8' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

API Call Response Example:

Response
{ "secret": "string" }