Stage 1: Authentication
Authentication is the foundation of all API interactions with the Tradovate API. This stage ensures your integration can properly authenticate and maintain secure access to the platform.
Overview
The authentication stage validates that your application can:
- Request access tokens using valid credentials
- Renew access tokens to maintain active sessions
- Handle authentication errors gracefully
Required Tests
1. Access Token Request
Endpoint: POST /auth/accesstokenrequest
Purpose: Obtain an access token for API authentication.
Test Steps:
- Send a POST request to
/auth/accesstokenrequestwith valid credentials - Verify the response contains a valid access token
- Verify the response includes an expiration time
- Test with invalid credentials to ensure proper error handling
Example Request:
Expected Response:
Validation Criteria:
- ✅ Access token is returned and non-empty
- ✅ Expiration time is included and valid
- ✅ Response time is under 2 seconds
- ✅ Invalid credentials return appropriate error (401 Unauthorized)
2. Access Token Renewal
Endpoint: GET /auth/renewaccesstoken
Purpose: Extend an existing access token without creating a new session.
Test Steps:
- Obtain a valid access token using
/auth/accesstokenrequest - Use the access token to call
/auth/renewaccesstokenbefore expiration - Verify the response contains a new access token
- Verify the new token has an extended expiration time
- Test with an expired token to ensure proper error handling
Example Request:
Expected Response:
Validation Criteria:
- ✅ New access token is returned and different from original
- ✅ New expiration time is extended beyond original
- ✅ Response time is under 1 second
- ✅ Expired tokens return appropriate error (401 Unauthorized)
Error Handling
Your implementation must handle the following error scenarios:
Common Error Responses
Invalid Credentials (401):
Token Expired (401):
Rate Limiting (429):
Best Practices
- Token Storage: Store access tokens securely and never log them
- Token Refresh: Implement automatic token renewal before expiration
- Error Handling: Implement retry logic with exponential backoff
- Monitoring: Log authentication failures for debugging
- Session Management
- Should use a single access token across all API powered services.
- Should prefer using the
/auth/renewaccesstokenendpoint to renew the token instead of requesting a new one. - Should request a new token only if the previous one has expired and renewal fails.
Testing Checklist
- Access token request succeeds with valid Credentials
- If implementing retry logic, don’t retry on the case
401: Invalid Credentials - Access token renewal succeeds with valid token
- Access token renewal fails with expired token
- Response times meet performance requirements
- Error responses are properly handled
- Session management is properly implemented
Next Steps
After completing Stage 1 authentication tests, proceed to Stage 2: Websocket Management.

