Authentication
All API requests require an authorization header with a bearer token. An access token can be retrieved from our authorization server using the OAuth2 client credentials flow. If you would like to use our API, please contact us at [email protected] and we will issue you aclient_id and client_secret.
Testing Connectivity
To test connectivity, you can use one of the following examples below which target our Sandbox environment. You will need to replace<client-id> and <client-secret> with the credentials you were given.
Using the Access Token
Once you receive an access token from the authorization server, include it in theAuthorization header of your API requests:
User Identification Header
In addition to the bearer token, most API endpoints require a header to identify which user’s data you’re accessing. The header name varies by API:- x-user-id
The following APIs use the Example request to Investment Orders API:Example request to Cash API:
x-user-id header:- Investment Orders API - Submit and manage investment orders
- Portfolios API - Access portfolio holdings and returns
- Cash API - Retrieve user cash balances
- Investment Products API (some endpoints) - Asset-specific data with user context
Complete Authentication Flow
Here’s a complete example of the authentication flow from obtaining a token to making an authenticated API request:1
Request an access token
Obtain a bearer token from the authentication server:Response:
2
Make an authenticated API request
Use the access token and user identifier to access API endpoints:
If the request succeeds, you’re properly authenticated and can access all API endpoints.
Remember to use the correct user identification header (
x-user-id) based on which API you’re calling.3
Handle token expiration
When your token expires (after 3600 seconds in this example), request a new one using the same credentials: