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.

Generate new API key for PRO plan

post

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.

Authorizations
AuthorizationstringRequired

JWT token for FREE/BASIC plans (required for API key management endpoints)

Body
planstring · enumRequired

Plan type (only PRO supported)

Example: proPossible values:
namestring · max: 100Optional

Custom name for the API key

Example: Production API Key
descriptionstring · max: 500Optional

Description of the API key usage

Example: API key for production trading bot
Responses
200

API key generated successfully

application/json
post
/auth/generate-api-key
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
}

List user's API keys

get

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.

Authorizations
AuthorizationstringRequired

JWT token for FREE/BASIC plans (required for API key management endpoints)

Responses
200

List of API keys

application/json
get
/auth/api-keys
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
}

Revoke API key

delete

Revokes (deactivates) an API key. The API key will no longer be valid for authentication.

Note: This endpoint requires JWT authentication, not API Key.

Authorizations
AuthorizationstringRequired

JWT token for FREE/BASIC plans (required for API key management endpoints)

Path parameters
apiKeystringRequired

The API key to revoke

Example: lion_pro_6e1fc6354a1c3101c1a7ec6b0121d40f
Responses
200

API key revoked successfully

application/json
delete
/auth/api-keys/{apiKey}
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