Skip to main content

Overview

The Aries API uses OAuth2 with Bearer tokens (JWT format) for authentication. All API requests require a valid access token in the Authorization header.

Authentication Flow

1. OAuth2 Client Credentials

First, obtain your OAuth2 credentials from the Aries platform:
  • Client ID: Your application identifier
  • Client Secret: Your application secret key

2. Initialize the SDK

OAuth2 Authorization Flow

Authorization Code Flow

For applications that need user authorization:

PKCE Support

For enhanced security in public clients:

MFA Verification

If MFA is enabled:

Token Management

Refreshing Access Tokens

Automatic Token Refresh

Using Bearer Tokens Directly

If you already have an access token:

Security Best Practices

1. Store Credentials Securely

Never hardcode credentials:

2. Use Environment Variables

Set environment variables:

3. Handle Token Expiration

4. Context Support

When the SDK exposes *WithContext helpers, pass context.Context for cancellation and deadlines. Otherwise, wrap outbound calls with your own timeouts at the HTTP layer.

OAuth2 Scopes

Available scopes:
  • read - Read account data, positions, and orders
  • trade - Place and cancel orders
  • withdraw - Withdraw funds from account
  • admin - Administrative operations

Error Handling

Complete Example

Next Steps