Authentication

The Reseller API supports API keys for server-to-server integrations and OAuth2 client credentials for applications that need token lifecycle control.

API Key Authentication

API keys are the simplest option for trusted backend services and operational scripts.

  1. Open Settings > API Keys in the reseller portal.
  2. Create a key with a descriptive name.
  3. Select only the scopes required by your integration.
  4. Copy the key and store it securely.
Authorization: Bearer rsk_xxxxxxxxxxxxxxxxxxxx

X-API-Key: rsk_xxxxxxxxxxxxxxxxxxxx

API Key Scopes

ScopeDescription
companies:readView companies.
companies:writeCreate and update companies.
companies:deleteDelete companies.
seats:readView seat allocations.
seats:writeModify seat allocations.
users:readView users across companies.
users:writeCreate and update users.
users:deleteDelete users from companies.
reports:readAccess training and phishing reports.

OAuth2 Authentication

OAuth2 client credentials are recommended when you need short-lived access tokens or a separate client secret lifecycle.

curl -X POST "https://api.empowsec.com/v1/reseller/oauth/token" 
  -H "Content-Type: application/json" 
  -d '{
    "grant_type": "client_credentials",
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
  }'

Token Response

{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "companies:read companies:write seats:read"
}

Best Practices

  • Protect credentials: Do not expose API keys or client secrets in browsers, mobile apps, logs, or repositories.
  • Use minimal scopes: Grant only the permissions required by the integration.
  • Rotate regularly: Replace keys on a schedule and immediately after suspected exposure.
  • Handle expiration: OAuth2 access tokens expire after one hour.
TypeExpiration
API KeyNo automatic expiry until revoked or deleted.
OAuth2 Access Token1 hour (3600 seconds).