Skip to main content
Generate a JWT token to authenticate API requests. The token contains encoded credentials and permissions that are required for accessing protected endpoints. This endpoint uses Basic Authentication. You’ll need to encode your API Client ID and Secret in the Authorization header. The JWT token returned will be used to authenticate both Account and Liquidity endpoints

Basic Authentication

To authenticate, combine your API Client ID and Secret in the format {apiClientId}:{apiClientSecret} and base64 encode it:
// Browser
const credentials = btoa('{apiClientId}:{apiClientSecret}');
const headers = {
  'Authorization': `Basic ${credentials}`
};
console.log(headers);

// Node.js
import { Buffer } from 'buffer';
const nodeCredentials = Buffer.from('{apiClientId}:{apiClientSecret}').toString('base64');
const nodeHeaders = {
  'Authorization': `Basic ${nodeCredentials}`
};
console.log(nodeHeaders);

Example Request

POST /auth/token HTTP/1.1
Host: api.example.com
Authorization: Basic {base64EncodedCredentials}
Content-Type: application/json