Skip to main content
This page documents management-plane HTTP endpoints that use session auth. It excludes agent API key endpoints. WorkspaceAPIKeyAuth middleware exists for ws_live_... keys, but it is not mounted to these management routes in the current router.

Dashboard drilldowns

Path prefix: /api/v1/dashboard. Endpoints:
  • GET /overview
  • GET /spend
  • GET /spend/series
  • GET /top-agents
  • GET /top-agents/details
  • GET /budget-blocked
  • GET /budget-blocked/details
  • GET /guard-blocked
  • GET /guard-blocked/details
Auth/runtime behavior:
  • Requires gw_session
  • Tenant is resolved from /w/{slug}
  • Returns 401 when unauthenticated, 403 when tenant access is denied
Query parameters:
  • range (optional, default current_month)
  • Allowed values: 15s, 30s, 1min, 5min, 10min, 15min, 30min, 45min, today, yesterday, 1m, 3m, current_month
  • timezone (optional, IANA timezone string)
Unknown range values currently fall back to current_month. Detail endpoint requirements:
  • top-agents/details: requires agent_id
  • budget-blocked/details: requires run_id or event_id
  • guard-blocked/details: requires run_id or event_id
Example (GET /api/v1/dashboard/spend?range=current_month):

Budgets (workspace, agent, plan)

Path prefix: /api/v1/workspaces/{tenant_id}/budgets. Auth/runtime behavior:
  • Requires gw_session
  • Requires owner access for {tenant_id}
  • Returns 401 for unauthenticated, 403 for non-owner/non-member

Workspace budget

  • GET /workspace
  • PUT /workspace
PUT request:
Response shape:
daily_budget_usd_micros may be null (unset). Negative values return 400.

Agent budgets

  • GET /agents
  • PUT /agents/{agent_id}
PUT request:
PUT response:
PUT /agents/{agent_id} returns 404 when the agent does not exist in that tenant.

Plan budgets

  • GET /plans
  • POST /plans
  • PUT /plans/{plan_key}
  • DELETE /plans/{plan_key} (returns 204)
POST /plans request:
plan_key must match ^[a-z0-9][a-z0-9_-]*$. PUT /plans/{plan_key} supports partial updates:
  • display_name
  • description
  • daily_budget_usd_micros
  • is_active
Plan responses include:

Alerts (rules, channels, history)

Path prefix: /api/v1/alerts. Auth/runtime behavior:
  • Requires gw_session
  • Requires admin-or-higher tenant membership
  • Tenant is resolved from /w/{slug} before membership checks

System status

  • GET /system
Current wire keys are Go struct keys (no JSON tags), for example:

Rules

  • POST /rules
  • GET /rules
  • GET /rules/{rule_id}
  • PATCH /rules/{rule_id}
  • DELETE /rules/{rule_id} (204)
Rule fields:
  • severity: info | low | medium | high | critical
  • scope_type: tenant | workspace | agent
  • rule_kind: event_count_gte | first_occurrence
  • rule_config.window_seconds: required, > 0
  • rule_config.threshold: required for event_count_gte (> 0), omitted or 0 for first_occurrence
  • cooldown_seconds: >= 0
  • channel_config_ids: optional channel references
POST /rules example:

Channels

  • POST /channels
  • GET /channels
  • GET /channels/{channel_id}
  • PATCH /channels/{channel_id}
  • DELETE /channels/{channel_id} (204)
  • POST /channels/{channel_id}/test
Supported channel_type values:
  • slack with config { "webhook_url": "https://..." }
  • webhook with config { "url": "https://...", "signing_secret": "optional" }
POST /channels example:
POST /channels/{channel_id}/test returns 200 for successful test sends. Current wire keys are:

Alert history

  • GET /
  • GET /{alert_id}
List query parameters:
  • limit (default 50)
  • offset (default 0)
  • rule_id
  • severity
  • status
  • from (RFC3339)
  • to (RFC3339)
List response:

Workspace management keys

Path prefix: /api/v1/management/workspace-keys. Auth/runtime behavior:
  • Requires gw_session
  • Owner access required
  • Tenant is resolved from /w/{slug}

GET /

POST /

Request:
Success (201) returns the key record and api_key once:
Valid role values: read_only, developer, admin.

POST /{id}:revoke

Disabled endpoint

POST /api/v1/execute

Always returns 410 Gone: