/org/policy; the workspace /policy endpoints are read-only reflections of the enforced result.
Every endpoint page states which editions it is available on.
Base URL
https://gw.onecli.sh on Cloud, http://localhost:10255 self-hosted). GET /gateway-url returns the right origin for any deployment. SCIM has its own base path, /scim/v2, and its own tokens.
Authentication
All API endpoints require authentication unless their page says otherwise. Include your API key as a Bearer token in theAuthorization header:
Workspace keys
Workspace API keys start withoc_ and are scoped to a single workspace. A workspace key always operates on its own workspace. Read yours from the dashboard, or with GET /user/api-key.
Organization keys
Organization API keys start withoc_org_ and operate across workspaces. For workspace-scoped endpoints, include the X-Workspace-Id header to name the workspace (without it, workspace endpoints return 401):
/org/...) need no workspace header. Where roles are enforced (Cloud and Enterprise) they require the admin or owner role; the Community edition runs a flat team where every member passes.
X-Workspace-Id replaced X-Project-Id, and /v1/workspaces replaced /v1/projects. The old header, the ?_project query bridge, and the /v1/projects path alias still work for a deprecation window and answer with a Deprecation: true header. Migrate to the new names.Dashboard sessions
The web dashboard calls the same API with its own session: a bearer JWT on Cloud, the session cookie on self-hosted deployments. A few endpoints are session-only (deleting your account, accepting an invitation, claiming a provisioned account), because they act for the person rather than a workspace or organization. API keys are refused there.Errors
The API returns standard HTTP status codes. Validation errors return a flaterror string; authentication and service errors use an envelope with message and type:
See Errors for the full reference, including the retired-endpoint inventory. Errors on an agent’s proxied traffic (including the
409 account-selection protocol) are a separate surface: Gateway errors and Multiple accounts.