Base URL
All API requests should be made to:Quick Start
1
Create OAuth2 Client
Log into Aries and navigate to Client Center > API tab to create an OAuth2 client and get your
client_id and client_secret2
Configure Scopes
Select the permission scopes your application needs (e.g.,
account:information, order:execution)3
Implement OAuth2 Flow
Redirect users to the authorization endpoint, handle the callback, and exchange the authorization code for access tokens
4
Start Trading
Use the access token to make authenticated API requests on behalf of your users
Prerequisites
Creating an OAuth2 Client
Before you can integrate OAuth2, you need to create an OAuth2 client:1
Access Client Center
Log into Aries and navigate to Client Center > API tab
2
Create New Client
Click Create New Client or Add OAuth2 Client
3
Configure Your Client
Provide the following information:
- Client Name: A descriptive name for your application
- Redirect URIs: One or more callback URLs (e.g.,
https://yourapp.com/oauth/callback) - Scopes: Select the permission scopes your application needs
4
Save Credentials
After creation, you’ll receive:
- Client ID: Public identifier for your application
- Client Secret: Confidential key (store securely - shown only once!)
Available Scopes
Scopes define the permissions your application has to access user data and perform actions. Request only the scopes your application needs.Currently Supported Scopes
| Scope | Description | Example Endpoints |
|---|---|---|
user:management | Manage user accounts, update profiles, modify settings, and perform administrative operations | PATCH /v1/users/mePOST /v1/users/me/email/changePOST /v1/users/me/trading-password |
user:information | View user profile information, personal details, and preferences | GET /v1/users/meGET /v1/users/me/accountsGET /v1/users/me/profile |
account:information | View account balances, positions, transaction history, and account details | GET /v1/accounts/{id}/balancesGET /v1/accounts/{id}/positionsWS /v1/accounts/ws |
order:execution | Place, modify, and cancel orders. Execute trades on user’s behalf | POST /v1/ordersPUT /v1/ordersDELETE /v1/ordersPOST /v1/orders/preview |
order:information | View order history, status, execution reports, and order details | GET /v1/accounts/{id}/orders |
position:information | View current positions, holdings, and position analytics | GET /v1/accounts/{id}/positions |
market:information | Access live and historical market data, quotes, and instrument information | GET /v1/marketdata/searchWSS /v1/marketdata/wsGET /v1/equity/top-gainers |
calendar:information | Access calendar events, earnings announcements, and market schedules | GET /v1/calendars/economicsGET /v1/calendars/earningsGET /v1/calendars/historical/{symbol} |
options:information | Access options chains, Greeks, expiration data, and options analytics | GET /v1/options/stocks/top-volumeGET /v1/options/etfs/top-volume |
analytics:information | View analytics, ratings, portfolio metrics, and market insights | GET /v1/analytics/ratingsGET /v1/analytics/insightsGET /v1/analytics/market-breadth |
When creating your OAuth2 client, you can select multiple scopes separated by spaces. For example:
account:information order:execution market:informationOAuth2 Authorization Flow
The standard OAuth2 Authorization Code flow. This is the recommended approach for web and mobile applications.Flow Overview
Step 1: Redirect User to Authorization URL
Redirect users to the Aries authorization endpoint:| Parameter | Required | Description |
|---|---|---|
response_type | Yes | Must be code for authorization code flow |
client_id | Yes | Your OAuth2 client ID |
redirect_uri | Yes | Must exactly match one of your registered redirect URIs |
scope | Yes | Space-separated list of scopes (e.g., account:information order:execution) |
state | Recommended | Random string to prevent CSRF attacks. Verify this matches on callback |
code_challenge | Optional | Only needed if implementing PKCE flow (advanced). Base64 URL-encoded SHA256 hash of the code_verifier |
code_challenge_method | Optional | Only needed if implementing PKCE flow (advanced). Must be S256 or plain |
Step 2: User Login and Consent
After redirecting, users will:- Log in with their Aries credentials
- Review permissions your app is requesting
- Approve or deny access
Step 3: Handle Authorization Callback
After approval, Aries redirects the user back to yourredirect_uri with the authorization code:
| Parameter | Description |
|---|---|
code | Authorization code (valid for 10 minutes, single-use) |
state | The state parameter you provided. Verify it matches! |
Step 4: Exchange Code for Access Token
Exchange the authorization code for access and refresh tokens using the/oauth2/token endpoint.
Request:
| Field | Description |
|---|---|
access_token | JWT token for API requests (valid for duration specified in expires_in) |
token_type | Always Bearer |
expires_in | Number of seconds until access token expires (typically 3600 = 1 hour) |
refresh_token | Long-lived token to obtain new access tokens |
scope | Granted scopes (may differ from requested if user denied some) |
Step 5: Make Authenticated API Requests
Use the access token in theAuthorization header for all API requests:
Refresh Token Flow
Access tokens expire after a period (typically 1 hour). Use the refresh token to obtain new access tokens without requiring user re-authentication.Refreshing Access Token
Request:Best Practices
Security
Store Credentials Securely
Never hardcode
client_secret or tokens in your code. Use environment variables or secrets management services.Use HTTPS Only
Always use HTTPS for redirect URIs and API calls in production. Never transmit credentials over HTTP.
Validate State Parameter
Always generate and verify the
state parameter to prevent CSRF attacks.Implement Token Rotation
Refresh tokens before they expire. Update stored refresh tokens when new ones are issued.
Error Handling
Rate Limiting
Different endpoints have different rate limits. Implement exponential backoff for rate limit errors:Troubleshooting
Common Errors
invalid_grant - Authorization code expired
invalid_grant - Authorization code expired
invalid_client - Client authentication failed
invalid_client - Client authentication failed
Error:Causes:
- Incorrect
client_idorclient_secret - Client has been deleted or disabled
- Using test/invalid credentials
- Verify your client credentials in the developer portal
- Ensure you’re using the correct
client_secret(it’s only shown once during creation) - Check that your OAuth2 client is active
invalid_scope - Requested scope is invalid
invalid_scope - Requested scope is invalid
Error:Causes:
- Requesting scopes not configured for your client
- Typo in scope name
- Requesting scopes that don’t exist
- Verify scope names match exactly (case-sensitive)
- Check your OAuth2 client configuration in the developer portal
- Ensure the scopes are enabled for your client
redirect_uri_mismatch
redirect_uri_mismatch
Error:Causes:
redirect_uridoesn’t exactly match one registered in your client- Query parameters or fragments in redirect URI
- Protocol mismatch (http vs https)
- Redirect URI must match exactly, including trailing slashes
- Register all redirect URIs you’ll use in the developer portal
- Use HTTPS in production
access_denied - User denied authorization
access_denied - User denied authorization
Debugging Tips
1. Enable Request LoggingAPI Categories
Explore the available API endpoints organized by category:User Management
Create users, manage profiles, and update account settings
Account Information
View account balances, positions, and transaction historyRequired scope:
account:informationOrder Execution
Place, modify, and cancel orders. Execute tradesRequired scopes:
order:execution, order:informationMarket Data
Real-time and historical market data, quotes, and instrument informationRequired scope:
market:informationAnalytics
Trading analytics, ratings, insights, and performance metricsRequired scope:
analytics:informationOptions Data
Options chains, Greeks, expiration data, and options analyticsRequired scope:
options:informationCalendar Events
Earnings announcements, economic events, and market schedulesRequired scope:
calendar:informationPositions
View current positions, holdings, and position analyticsRequired scope:
position:informationRate Limits
API rate limits vary by endpoint category:Authentication
10 requests/minute
User Management
100 requests/minute
Market Data
1,000 requests/minute
Trading
50 requests/minute
HTTP Status Codes
| Code | Status | Description |
|---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | Validation error in request |
401 | Unauthorized | Invalid or missing authentication |
403 | Forbidden | Insufficient permissions/scopes |
404 | Not Found | Resource does not exist |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server-side error |
Error Response Format
All error responses follow this format:Support & Resources
Ready to integrate OAuth2? Create your client in the Developer Portal and start building!