API Key Management
Manage API keys for PRO plan users.
Note: These endpoints require JWT authentication, not API Key authentication. Use your JWT token from /api/auth/signin to generate and manage API keys.
Generates a new API key for PRO plan users.
Important: This endpoint requires JWT authentication (not API Key). After generating an API Key, you can use it to authenticate all PRO endpoints.
Limitation: Users can only have one active API key at a time. Generating a new key will automatically revoke any existing active keys.
JWT token for FREE/BASIC plans (required for API key management endpoints)
Plan type (only PRO supported)
proPossible values: Custom name for the API key
Production API KeyDescription of the API key usage
API key for production trading botAPI key generated successfully
Invalid request
Unauthorized - Invalid or missing JWT token
PRO plan required - User doesn't have PRO plan
Internal server error
POST /api/auth/generate-api-key HTTP/1.1
Host: https:/.alertlions.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 14
{
"plan": "pro"
}{
"api_key": "lion_pro_6e1fc6354a1c3101c1a7ec6b0121d40f",
"api_secret": "lion_secret_ea49f23a8d49ee4b618c9b01768ebad8",
"plan": "pro",
"name": "Trading Bot API Key",
"description": "API key for automated trading bot",
"rate_limit": {
"requests_per_day": 1000,
"requests_per_hour": 100,
"requests_per_minute": 10
},
"features": [
"complete_data_access",
"historical_data",
"bulk_operations",
"data_export"
],
"status": "active",
"created_at": "2025-01-29T18:25:46.252Z",
"expires_at": null
}Returns all active API keys for the authenticated user. Only shows API keys for the user's current plan (PRO).
Note: This endpoint requires JWT authentication, not API Key.
JWT token for FREE/BASIC plans (required for API key management endpoints)
List of API keys
Unauthorized
Internal server error
GET /api/auth/api-keys HTTP/1.1
Host: https:/.alertlions.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"api_keys": [
{
"api_key": "lion_pro_6e1fc6354a1c3101c1a7ec6b0121d40f",
"name": "Trading Bot API Key",
"plan": "pro",
"status": "active",
"created_at": "2025-01-29T18:25:46.252Z",
"last_used": "2025-01-29T20:15:30.000Z",
"usage_stats": {
"requests_today": 1,
"requests_this_month": 1,
"total_requests": 1
}
}
],
"total": 1
}Revokes (deactivates) an API key. The API key will no longer be valid for authentication.
Note: This endpoint requires JWT authentication, not API Key.
JWT token for FREE/BASIC plans (required for API key management endpoints)
The API key to revoke
lion_pro_6e1fc6354a1c3101c1a7ec6b0121d40fAPI key revoked successfully
Unauthorized
API key not found
Internal server error
DELETE /api/auth/api-keys/{apiKey} HTTP/1.1
Host: https:/.alertlions.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"message": "API key revoked successfully",
"api_key": "lion_pro_6e1fc6354a1c3101c1a7ec6b0121d40f",
"status": "revoked"
}Last updated