Authentication

Secure your API integrations with multiple authentication methods

API Key Authentication (Recommended)

Key Types

  • Live keys: sk_live_... (production environment)
  • Test keys: sk_test_... (sandbox environment)

Obtaining API Keys

  1. Log into your RebusAI admin panel
  2. Navigate to Settings → API Management
  3. Click Generate New API Key
  4. Configure permissions and expiration
  5. Save immediately (keys are only shown once)

Using API Keys

GET /api/v1/affiliate/affiliates/
Authorization: Bearer sk_live_1234567890abcdef
Content-Type: application/json

JWT Token Authentication

For web applications requiring user context:

Get JWT Token

curl -X POST "https://rebusai.com/api/v1/auth/login/" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "user@example.com", 
    "password": "secure_password"
  }'

JWT Response

{
  "success": true,
  "data": {
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "expires_in": 3600,
    "token_type": "JWT",
    "user": {
      "id": 456,
      "email": "user@example.com",
      "name": "John Manager",
      "role": "affiliate_manager"
    }
  },
  "message": "Authentication successful"
}

Use JWT Token

curl -X GET "https://rebusai.com/api/v1/affiliate/affiliates/" \
  -H "Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."