Policies API
The Policies API lets you define governance policies for your workspace. Policies enforce rules around deployments, cost thresholds, and approval workflows. You can activate, deactivate, and promote enforcement levels programmatically.
All endpoints are under /api/policies and require authentication.
Templates and Validation
/api/policies/templatesAuth requiredGet available policy templates to use as starting points.
/api/policies/attention-countAuth requiredGet the count of policies that need attention or review.
/api/policies/validate-conditionsAuth requiredValidate condition providers before creating a policy.
// Request body
{
"conditions": {
"provider": "github",
"check": "branch_protection",
"params": { "branch": "main" }
}
}CRUD Operations
/api/policiesAuth requiredCreate a new policy.
/api/policiesAuth requiredList all policies in the workspace.
/api/policies/:idAuth requiredGet a single policy by ID.
/api/policies/:idAuth requiredUpdate an existing policy.
/api/policies/:idAuth requiredDelete a policy. Requires owner or admin role. Returns 204 on success.
Only workspace owners and admins can delete policies. Members will receive a 403 response.
Lifecycle Management
/api/policies/:id/activateAuth requiredActivate a policy so it begins evaluating.
/api/policies/:id/deactivateAuth requiredDeactivate a policy. It will stop evaluating until reactivated.
/api/policies/:id/promoteAuth requiredPromote the policy to the next enforcement level.
/api/policies/:id/reset-circuit-breakerAuth requiredReset the circuit breaker if the policy has tripped.
Policies follow a progressive enforcement model. Use promote to move from warn to block mode after validating behavior.
Evaluations
/api/policies/:id/evaluationsAuth requiredGet evaluation history for a policy. Supports pagination (max 100 per page).
GET /api/policies/:id/evaluations?page=1&pageSize=50Example response
{
"evaluations": [
{
"id": "eval_abc123",
"result": "pass",
"timestamp": "2026-04-30T10:15:00Z",
"context": { "pr": 42, "repo": "acme/api" }
}
],
"total": 128,
"page": 1,
"pageSize": 50
}Bulk Operations
/api/policies/pause-allAuth requiredPause all active policies in the workspace.
/api/policies/resume-allAuth requiredResume all paused policies in the workspace.
Bulk pause and resume affect every policy in the workspace. Use with care during incidents or maintenance windows.