Skip to main content

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

FieldTypeRequiredDescription
api_keystringYesYour 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

FieldTypeDescription
successbooleanWhether authentication was successful
messagestringHuman-readable success message
session_tokenstringSession token for subsequent requests
user_idstringUnique user identifier
user_tierstringUser’s billing tier (basic, premium, developer, enterprise)
expires_atnumberSession 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 CodeErrorDescription
400missing_api_keyAPI key not provided in request
401invalid_api_keyAPI key is invalid or not found
401api_key_disabledAPI key has been disabled
429rate_limit_exceededToo many authentication attempts

Session Errors

Status CodeErrorDescription
401session_expiredSession token has expired
401invalid_sessionSession token is invalid
401missing_authorizationAuthorization header not provided
Store session tokens securely and implement automatic renewal when sessions expire.