Overview
The Approvals API manages the approval workflow for tool executions that require human review. When a tool call requires approval based on policy configuration, an approval record is created and must be resolved before execution can proceed.Main Functions
resolveApproval
Resolves a pending approval with an approval or denial decision. This is a workspace mutation that requires admin privileges.The approval identifier to resolve
The approval decision
Identifier of the reviewer making the decision
Optional reason for the decision
Internal Functions
createApproval
Creates a new approval record for a tool execution.Unique approval identifier
The task requesting tool execution
Full path of the tool being invoked (e.g.,
"github.create_issue")The input parameters passed to the tool
Unique approval identifier
Associated task ID
Tool path requiring approval
Tool input parameters
Current status:
"pending", "approved", or "denied"Reason provided for approval/denial decision
Identifier of the reviewer who resolved the approval
Unix timestamp when approval was created
Unix timestamp when approval was resolved
getApproval
Retrieves an approval by its ID.The approval identifier
null if not found.
listApprovals
Lists approvals in a workspace, optionally filtered by status.Workspace to list approvals from
Filter by status:
"pending", "approved", or "denied"listPendingApprovals
Retrieves pending approvals with associated task information.Workspace identifier
Approval identifier
Associated task ID
Tool requiring approval
Tool input parameters
Always
"pending" for this queryWhen approval was created
resolveApproval (Internal)
Internal mutation for resolving approvals without workspace context validation.Approval identifier
Approval decision
Reviewer identifier
Decision reason
null if the approval wasn’t in pending status.
getApprovalInWorkspace
Retrieves an approval only if it belongs to the specified workspace.Approval identifier
Workspace ID to verify against
null if not found or workspace mismatch.
Approval Workflow
The typical approval workflow:- Task Execution: A task attempts to call a tool that requires approval
- Approval Creation: System creates an approval record with
status: "pending" - Notification: Workspace admins are notified of pending approval
- Review: Admin reviews the tool path, input parameters, and context
- Resolution: Admin calls
resolveApproval()with decision - Continuation: Task execution resumes based on the decision
Related Types
ApprovalStatus:"pending"|"approved"|"denied"TaskStatus:"queued"|"running"|"completed"|"failed"|"timed_out"|"denied"