Overview
The Approvals API enables approval workflows where task attempts can request human approval before proceeding with critical operations like merging or deployment. Base URL:http://localhost:8887/api/approvals
Create Approval Request
Create a new approval request for a task attempt.Request Body
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
taskAttemptId | string | ✅ | Task attempt ID requesting approval |
type | enum | ✅ | Approval type: merge, deploy, custom |
title | string | ✅ | Approval request title |
description | string | ⚠️ | Detailed description |
metadata | object | ⚠️ | Additional context data |
approvers | array | ⚠️ | List of approver emails (all users if omitted) |
expiresAt | string | ⚠️ | Expiration timestamp |
Example Response
Get Approval Status
Get detailed information about an approval request.Example Response
Status Values
pending- Awaiting approval responsesapproved- All required approvers approvedrejected- At least one approver rejectedexpired- Expired before all approvals receivedcancelled- Cancelled by requester
Respond to Approval
Approve or reject an approval request.Request Body
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
decision | enum | ✅ | Response: approved, rejected |
comment | string | ⚠️ | Optional comment explaining decision |
Example Response
approvalStatus indicates the overall approval request status after this response.
Get Pending Approvals
List all pending approval requests for the current user.Query Parameters
| Parameter | Type | Description |
|---|---|---|
type | enum | Filter by type: merge, deploy, custom |
page | integer | Page number (default: 1) |
limit | integer | Items per page (default: 20) |
Approval Workflows
Merge Approval Workflow
Deployment Approval Workflow
SDK Examples
JavaScript/TypeScript
Python
Best Practices
Use Descriptive Titles
Use Descriptive Titles
Include Context in Metadata
Include Context in Metadata
Set Appropriate Expiration
Set Appropriate Expiration
Specify Relevant Approvers
Specify Relevant Approvers
Next Steps
Attempts API
Manage task attempts that require approval
Workflows
Approval workflow patterns
WebSockets
Real-time approval notifications
Tasks API
Create tasks that trigger approvals

