API: Approvals
REST API endpoints for reviewing and approving dangerous operations.
API: Approvals
Overview
Operations classified as dangerous require human approval before execution. The approvals API lets you list pending approvals, review execution plans, and approve or reject operations.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /v1/approvals | List pending approvals |
| POST | /v1/approvals/{id}/approve | Approve an operation |
| POST | /v1/approvals/{id}/reject | Reject an operation |
GET /v1/approvals
Response (200)
{
"items": [
{
"id": "appr-abc123",
"resource_id": "inst-xyz789",
"operation": "delete",
"risk_level": "dangerous",
"plan": {
"description": "Delete production instance web-server-01",
"impact": "Service will become unavailable",
"rollback": "Re-create instance from latest backup"
},
"requested_at": "2025-01-15T10:30:00Z",
"requested_by": "agent:instance-agent"
}
]
}
Approve an Operation
POST /v1/approvals/appr-abc123/approve
{
"comment": "Approved - maintenance window confirmed"
}
Reject an Operation
POST /v1/approvals/appr-abc123/reject
{
"reason": "Not approved - production traffic still active"
}
Approval Object
| Field | Type | Description |
|---|---|---|
id | string | Unique approval ID |
resource_id | string | ID of the resource involved |
operation | string | Operation awaiting approval |
risk_level | string | Risk classification (always dangerous for approvals) |
plan | object | Execution plan with description, impact, and rollback info |
requested_at | string | ISO 8601 timestamp |
requested_by | string | Agent or user that requested the operation |