Skip to content

API Authentication

API Keys

Generate API Key

  1. Go to SettingsAPI Keys
  2. Click Generate New Key
  3. Choose scopes and expiration
  4. Copy the key (shown only once)

Using API Keys

Include in the Authorization header:

bash
curl -H "Authorization: Bearer ops_key_abc123..." \
  https://ops.example.com/api/v1/services

Key Scopes

ScopeDescription
readRead-only access
writeCreate and update resources
deleteDelete resources
adminFull access including settings

Key Expiration

Keys can be set to expire:

  • Never (not recommended)
  • 30 days
  • 90 days
  • 1 year

JWT Tokens

For web sessions, use JWT tokens:

bash
# Login
POST /api/v1/auth/login
{
  "username": "admin",
  "password": "password"
}

# Response
{
  "token": "eyJhbG...",
  "expires_at": "2025-01-16T00:00:00Z"
}

Use in subsequent requests:

bash
curl -H "Authorization: Bearer eyJhbG..." \
  https://ops.example.com/api/v1/services

OAuth 2.0

For OAuth-enabled instances:

bash
# Get token
POST /oauth/token
{
  "grant_type": "client_credentials",
  "client_id": "your-client-id",
  "client_secret": "your-client-secret"
}

Security Best Practices

  1. Never share API keys
  2. Rotate keys regularly
  3. Use minimal required scopes
  4. Set expiration dates
  5. Monitor key usage in audit logs

Released under the MIT License.