Authentication

Learn how to authenticate your API requests using API keys or JWT tokens.

Authentication Methods

The Regen Therapy API supports two authentication methods:

API Keys
Best for server-to-server integrations
  • Long-lived credentials
  • Granular permission scopes
  • Passed via X-API-Key header
  • Can be rotated without downtime
JWT Tokens
Best for user-authenticated requests
  • Short-lived (1 hour)
  • Tied to user session
  • Passed via Authorization header
  • Refreshable with refresh token

API Key Authentication

Pass your API key in the X-API-Key header:

curl -X GET "https://gateway.regentherapy.com/api/v1/orders" \
  -H "X-API-Key: rg_abc123_your_secret_key_here"
Creating an API Key
  1. Log in to your Partner Portal
  2. Navigate to Settings → API Keys
  3. Click "Create New Key"
  4. Select the required scopes for your integration
  5. Copy the key immediately - it won't be shown again
Create API Key

JWT Token Authentication

For user-authenticated requests, obtain a JWT token by logging in:

1. Login Request

curl -X POST "https://gateway.regentherapy.com/api/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "your_password"
  }'

2. Login Response

{
  "success": true,
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIs...",
    "refreshToken": "eyJhbGciOiJIUzI1NiIs...",
    "expiresIn": 3600,
    "user": {
      "id": "usr_abc123",
      "email": "user@example.com",
      "role": "CLIENT_OWNER"
    }
  }
}

3. Use the Token

curl -X GET "https://gateway.regentherapy.com/api/v1/orders" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
Token Lifecycle
Token TypeLifetimeUsage
Access Token1 hourAPI requests
Refresh Token7 daysGet new access token

API Scopes

API keys use scopes to limit access. Only request the scopes your integration needs.

ScopeTypeDescription
read:*ReadRead access to all resources
write:*WriteWrite access to all resources
read:ordersReadRead orders
write:ordersWriteCreate and update orders
read:productsReadRead products
write:productsWriteCreate and update products
read:inventoryReadRead inventory levels
write:inventoryWriteAdjust inventory
read:commissionsReadRead commission records
write:commissionsWriteCreate payouts
read:customersReadRead customer data
write:customersWriteUpdate customer data
read:webhooksReadRead webhook configurations
write:webhooksWriteManage webhook endpoints
read:analyticsReadRead analytics data

Rate Limiting

API requests are rate limited per API key. Rate limit information is included in response headers.

TierLimitWindow
Standard100 requestsPer hour
Burst10 requestsPer minute
Write Operations50 requestsPer hour

Rate Limit Headers

HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the window resets
Retry-AfterSeconds to wait when rate limited (429 responses)