Authentication Flow
The Unified Transaction APIs use session-based authentication for enhanced security. Follow these steps to authenticate:
Step 1: Authenticate
POST /api/v1/authenticate
Authenticate with your API key to receive a session token.
Request
curl -X POST "https://data.quantcite.com/api/v1/authenticate" \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY"
}'
Request Body
| Field | Type | Required | Description |
|---|
api_key | string | Yes | Your API key |
Response
{
"success": true,
"message": "Authenticated successfully as premium user",
"session_token": "12345678-1234-1234-1234-123456789abc",
"user_id": "cb88461f-421a-4ac8-9722-afe248a40ae6",
"user_tier": "premium",
"expires_at": 1695134400000
}
Response Fields
| Field | Type | Description |
|---|
success | boolean | Whether authentication was successful |
message | string | Human-readable success message |
session_token | string | Session token for subsequent requests |
user_id | string | Unique user identifier |
user_tier | string | User’s billing tier (basic, premium, developer, enterprise) |
expires_at | number | Session expiration timestamp (Unix milliseconds) |
Step 2: Use Session Token
Include the session token in the Authorization header for all subsequent API requests:
Authorization: Bearer 12345678-1234-1234-1234-123456789abc
curl -X POST "https://data.quantcite.com/api/v1/transactions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 12345678-1234-1234-1234-123456789abc" \
-d '{
"exchange": "bybit",
"transaction_types": ["deposits", "withdrawals"]
}'
API Key Management
API keys are generated by administrators and provided to authorized users. Each key is associated with a specific billing tier and usage limits.
API keys are provided by QuantCite administrators. Contact support to get your production API keys.
Session Management
Session Duration
- Duration: 24 hours from creation
- Auto Expiry: Sessions automatically expire
- Renewal: Authenticate again to get a new session token
Check Session Status
GET /api/v1/session-status
Check the status of your current session.
curl -X GET "https://data.quantcite.com/api/v1/session-status" \
-H "Authorization: Bearer your_session_token"
Success Response
{
"authenticated": true,
"user_id": "cb88461f-421a-4ac8-9722-afe248a40ae6",
"user_tier": "premium",
"expires_at": 1695134400000,
"created_at": 1695048000000,
"message": "Session is valid"
}
Invalid Session Response
{
"authenticated": false,
"message": "Invalid or expired session token"
}
Error Handling
Authentication Errors
| Status Code | Error | Description |
|---|
400 | missing_api_key | API key not provided in request |
401 | invalid_api_key | API key is invalid or not found |
401 | api_key_disabled | API key has been disabled |
429 | rate_limit_exceeded | Too many authentication attempts |
Session Errors
| Status Code | Error | Description |
|---|
401 | session_expired | Session token has expired |
401 | invalid_session | Session token is invalid |
401 | missing_authorization | Authorization header not provided |
Store session tokens securely and implement automatic renewal when sessions expire.