Authentication API
Authentication and session management
The CDN Manager exposes versioned HTTP APIs under /api (v1 and v2), using JSON payloads by default. When sending request bodies, set Content-Type: application/json. Server errors typically respond with { "message": "..." } where available, or an empty body with the relevant status code.
Authentication uses a two-step flow:
grant_type=sessionUse the access token in Authorization: Bearer <token> when calling bearer-protected routes. CORS preflight (OPTIONS) is supported and wildcard origins are accepted by default.
Durations such as TTLs use humantime strings (for example, 60s, 5m, 1h).
All API endpoints are relative to:
https://<manager-host>/api
The API documentation is organized by functional area:
| Guide | Description |
|---|---|
| Authentication API | Login, token exchange, logout, and session management |
| Health API | Liveness and readiness probes |
| Selection Input API | Key-value and list storage with search capabilities |
| Data Store API | Generic JSON key/value storage |
| Subnets API | CIDR-to-value mappings for routing decisions |
| Routing API | GeoIP lookups and IP validation |
| Discovery API | Host and namespace discovery |
| Metrics API | Metrics submission and aggregation |
| Configuration API | Configuration document management |
| Operator UI API | Blocked tokens, user agents, and referrers |
| OpenAPI Specification | Complete OpenAPI 3.0 specification |
All authenticated API calls follow the same authentication flow. For detailed instructions, see the Authentication API Guide.
Quick Start:
# Step 1: Login to get session
curl -s -X POST "https://cdn-manager/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "Password1!"
}' | tee /tmp/session.json
SESSION_ID=$(jq -r '.session_id' /tmp/session.json)
SESSION_TOKEN=$(jq -r '.session_token' /tmp/session.json)
# Step 2: Exchange session for access token
curl -s -X POST "https://cdn-manager/api/v1/auth/token" \
-H "Content-Type: application/json" \
-d "$(jq -nc --arg sid "$SESSION_ID" --arg st "$SESSION_TOKEN" \
'{session_id:$sid,session_token:$st,grant_type:"session",scope:"openid"}')" \
| tee /tmp/token.json
ACCESS_TOKEN=$(jq -r '.access_token' /tmp/token.json)
# Step 3: Call a protected endpoint
curl -s "https://cdn-manager/api/v1/metrics" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
The API uses standard HTTP response codes to indicate the success or failure of an API request.
Most errors return an empty response body with the relevant HTTP status code (e.g., 404 Not Found or 409 Conflict).
In some cases, the server may return a JSON body containing a user-facing error message:
{
"message": "Human-readable error message"
}
After learning the API:
Authentication and session management
Liveness and readiness probe endpoints
Key-value and list storage with search capabilities
Generic JSON key/value storage
CIDR-to-value mappings for routing decisions
GeoIP lookups and IP validation
Host and namespace discovery
Metrics submission and aggregation
Configuration document management
Blocked tokens, user agents, and referrers
Complete OpenAPI 3.0 specification