Base URL
Versioning
All resource management endpoints are grouped under/api/v1/. The evaluation endpoint is at /api/v1/evaluate. Health probes are at /healthz and /readyz at the root (no version prefix).
Authentication
Togul supports two authentication schemes depending on the endpoint.BearerAuth
Used for all management endpoints. Pass a JWT access token obtained from login or refresh-token.ApiKeyAuth
Used for the evaluate and stream endpoints. Pass an environment-scoped API key created from the management API.server, sdk, and stream. The evaluate endpoint accepts server and sdk keys; the stream endpoint accepts sdk and stream keys.
Request and response format
All request and response bodies use JSON. SetContent-Type: application/json on requests that include a body.
Status codes
Togul uses standard HTTP status codes. All successful responses return200 OK.
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad request — invalid body, missing required fields, or validation failure |
401 | Unauthorized — missing, expired, or invalid token or API key |
403 | Forbidden — valid credentials but insufficient permissions, quota exceeded, or environment not enabled in region |
404 | Not found — resource doesn’t exist or isn’t accessible |
409 | Conflict — resource already exists or constraint violation |
500 | Internal server error — typically a billing provider error |
Error format
Error responses use a consistent JSON structure:| Field | Type | Description |
|---|---|---|
code | string | Machine-readable error code |
message | string | Human-readable description |
details | object | null | Optional additional context |
Endpoint groups
| Group | Base path | Auth |
|---|---|---|
| Auth | /api/v1/ | None or BearerAuth |
| Organizations | /api/v1/organizations | BearerAuth |
| Members | /api/v1/members | BearerAuth |
| Roles | /api/v1/roles | BearerAuth |
| Invitations | /api/v1/invitations | BearerAuth |
| Projects | /api/v1/projects | BearerAuth |
| Project Members | /api/v1/projects/{project_id}/members | BearerAuth |
| API Keys | /api/v1/projects/{project_id}/api-keys | BearerAuth |
| Environments | /api/v1/projects/{project_id}/environments | BearerAuth |
| Flags | /api/v1/projects/{project_id}/flags | BearerAuth |
| Rules | /api/v1/projects/{project_id}/rules | BearerAuth |
| Evaluate | /api/v1/evaluate | ApiKeyAuth |
| Stream | /api/v1/stream | BearerAuth or ApiKeyAuth |
| Billing | /api/v1/billing | BearerAuth |
| Usage | /api/v1/usage | BearerAuth |
| Exports | /api/v1/exports | BearerAuth |
| Account Lifecycle | /api/v1/account-deletion | BearerAuth |
| Infrastructure | /healthz, /readyz, /metrics | None |