Approvals
When a workflow encounters a high-risk tool execution, it pauses and emits an approval_request event. Use these endpoints to approve or reject the pending action.
Approve
Endpoint
POST /v1/workflows/execute/{execution_id}/approve/{approval_id}
Path Parameters
| Parameter | Type | Description |
|---|
execution_id | string | The execution ID |
approval_id | string | The approval ID from the approval_request event |
Request Body
| Field | Type | Required | Description |
|---|
reason | string | No | Reason for approving |
Example
curl -X POST "https://api.mindra.co/v1/workflows/execute/exec_abc123/approve/apr_xyz789" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason": "Approved by user"}'
Reject
Endpoint
POST /v1/workflows/execute/{execution_id}/reject/{approval_id}
Path Parameters
| Parameter | Type | Description |
|---|
execution_id | string | The execution ID |
approval_id | string | The approval ID from the approval_request event |
Request Body
| Field | Type | Required | Description |
|---|
reason | string | No | Reason for rejecting |
Example
curl -X POST "https://api.mindra.co/v1/workflows/execute/exec_abc123/reject/apr_xyz789" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason": "Not authorized"}'
Behavior
- Approve: The paused tool execution proceeds and the workflow continues
- Reject: The tool execution is skipped and the agent is notified of the rejection
- Timeout: If no decision is made within the configured timeout, the request expires and the agent handles it according to the workflow's policy