mindra

Approvals

Approve or reject high-risk tool executions

2 min read

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

ParameterTypeDescription
execution_idstringThe execution ID
approval_idstringThe approval ID from the approval_request event

Request Body

FieldTypeRequiredDescription
reasonstringNoReason 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

ParameterTypeDescription
execution_idstringThe execution ID
approval_idstringThe approval ID from the approval_request event

Request Body

FieldTypeRequiredDescription
reasonstringNoReason 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