Complete REST API Reference
This page documents every HTTP route exposed by the Control Zero backend. It is an exhaustive reference intended for developers writing direct API clients. For a narrative introduction and higher-level concepts, see the API Overview.
Base URL
- SaaS production:
https://api.controlzero.ai - Staging:
https://api.example.com - Self-managed / air-gap: the base URL provided with your deployment (see the install runbook delivered with your package)
All endpoints listed below are relative to the base URL.
Authentication
Control Zero exposes three distinct authentication mechanisms, each used by a different class of route.
| Auth model | Header | Route families |
|---|---|---|
| API key (Bearer) | Authorization: Bearer cz_live_... or cz_test_... | /v1/*, /v1/sdk/*, /api/scout/* |
| Dashboard session | cz_session cookie (SaaS) or session JWT (self-managed) via Authorization: Bearer ... | /api/* |
| Machine signature | Cryptographically signed request headers bound to an enrolled machine_id | /api/enroll, /api/heartbeat, /api/policy, /api/audit |
| SCIM bearer | Authorization: Bearer <scim_token> (org-specific) | /scim/v2/* |
| Signature-verified | Provider signature (Stripe) | /webhooks/* |
On SaaS, dashboard sign-in (email + password or Google) is handled by Control
Zero's self-hosted identity service. After sign-in the frontend
exchanges the identity session for a first-party cz_session cookie via
POST /api/auth/native/exchange; that cookie authenticates all /api/*
requests. Per-organization SAML / OIDC single sign-on (Teams tier)
is built but COMING SOON: hosted-tier SSO login is still operator-gated and
not yet self-serve-enabled -- see SSO setup
(tracking: TODO-SSO-1291).
API keys have a required scope. read is the minimum for all /v1/sdk/*
operations; write is required for creating or mutating policies via
/v1/policies. The scout scope is required for /api/scout/*.
The backend also accepts the X-API-Key header as an equivalent to
Authorization: Bearer.
The hosted gateway at gateway.controlzero.ai uses a different header
(X-ControlZero-API-Key or Authorization: Bearer) to avoid colliding with
upstream provider headers like Anthropic's X-Api-Key. The backend at
api.controlzero.ai uses X-API-Key or Authorization: Bearer. See the
API Overview for details.
Rate limits
All authenticated routes pass through a combined rate limiter:
- Per-IP: 1,000 requests/min (protects against single-source DDoS).
- Per-API-key: 500 requests/min (protects against single-tenant abuse).
A request that exceeds either limit receives 429 Too Many Requests.
Requests larger than 1 MB receive 413 Request Entity Too Large.
Conventions
- All request and response bodies are JSON unless otherwise stated.
- All timestamps are RFC 3339 UTC.
- Errors use the shape
{ "error": "message" }with an appropriate HTTP status code. - Every request emits an
X-Request-IDresponse header for correlation.
Health and meta
GET /
Unauthenticated. Returns basic service metadata (version, environment).
GET /health
Unauthenticated. Liveness probe. Returns 200 OK if the process is up.
GET /ready
Unauthenticated. Readiness probe. Returns 200 OK only when the rate-limit cache, the
secret store, and the configured auth backend all respond. Used by
Kubernetes / load-balancer health checks.
GET /metrics
Prometheus scrape endpoint. Requires the request to originate from an
internal network (enforced by InternalOnly middleware).