Skip to Content
AgentShield
API Reference

Approval Management

List pending approval requests with the request under review, and approve or reject them.

Approval requests are created by the gateway when policy returns require_approval. Humans with the owner, admin, or approver role decide them here. Lifecycle and binding rules: Human approvals.

List approvals

Listing also marks pending requests past their expires_at as expired. Each item includes what an approver needs to decide: the tool, operation, resource, redacted arguments, request time, and the policy reason.

GET/api/v1/approvals

List approval requests

Bearer sessionoperationId: listApprovals

Implemented for owner, admin, and approver. Agents cannot call this route.

Responses

  • 200ApprovalPage

    Approval page

curl -X GET "http://127.0.0.1:8080/api/v1/approvals" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

Approve

Approving records the deciding user and time, and appends approval.decided. It does not execute anything; the agent's next execute call with this approval_id consumes it.

POST/api/v1/approvals/{approvalId}/approve

Approve the exact bound payload

Bearer sessionoperationId: approveRequest

The caller must be a human approver, admin, or owner in the same organization. The same user id cannot approve an agent with that id. The approval binds to payload_hash and expires.

Parameters

  • approvalIdpath · string (uuid)required

Responses

  • 200Approval

    Approved, not yet consumed

  • 409ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/approvals/$APPROVAL_ID/approve" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

ErrorCause
403 self_approvalThe deciding user's id equals the agent id
404 not_foundNo such approval in your organization
409 approval_expiredexpires_at has passed
409 conflictThe approval is not pending

Reject

POST/api/v1/approvals/{approvalId}/reject

Reject an approval request

Bearer sessionoperationId: rejectRequest

A rejected approval cannot be replayed.

Parameters

  • approvalIdpath · string (uuid)required

Responses

  • 200Approval

    Rejected approval

curl -X POST "http://127.0.0.1:8080/api/v1/approvals/$APPROVAL_ID/reject" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

A rejected approval cannot be approved or consumed. The agent's execute call returns 409 conflict.

Reserved

POST/api/v1/approvals Reserved · not registered

Record an approval request for an existing authorization decision

Bearer sessionoperationId: createApproval

Not implemented. Reserved for the gateway service identity. Agent credentials and the agent that initiated the action are rejected.

Request body · required

  • authorization_decision_idstring (uuid)required
  • payload_hashstringrequired

    pattern ^[0-9a-f]{64}$

  • expires_atstring (date-time)required

Responses

  • 201Approval

    Pending approval

  • 403ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/approvals" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

This operation is reserved in the contract for a gateway service identity and is not registered. Approval requests are created only by the gateway, bound to the exact request body, so no caller can mint one.

Was this page helpful?

On this page