Deployments.ai Docs
Workflows

Approve a pending workflow step

POST /v1/workflow-executions/{workflowExecutionId}/approvals/{workflowApprovalId}/resolve · SDK resolveWorkflowApproval · CLI deployments workflow-approval approve, deployments workflow-approval reject

POST
/v1/workflow-executions/{workflowExecutionId}/approvals/{workflowApprovalId}/resolve

Requires approvals:write.

Authorization

headerAuthorizationBearer <token>

Opaque bearer credential scoped to one service account and tenant.

Path Parameters

workflowExecutionId*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
workflowApprovalId*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Header Parameters

x-deployments-environment?string

Required with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
x-deployments-organization?string

Required with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
x-deployments-project?string

Required with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Request Body

application/json
  1. body
decision*string
Value in"approved""rejected"

Response Body

WorkflowApprovalResponse

application/json
  1. response
environmentId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
organizationId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
projectId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
createdAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
expiresAt?string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
id*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
object*"workflow-approval"
Value in"workflow-approval"
prompt*string
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length <= 32000
resolvedAt?string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
resolvedBy?
status*string
Value in"approved""canceled""expired""pending""rejected"
stepAttemptId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
updatedAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
version*integer
Range0 <= value
workflowExecutionId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
curl -X POST "https://example.com/v1/workflow-executions/string/approvals/string/resolve" \  -H "Content-Type: application/json" \  -d '{    "decision": "approved"  }'
{  "environmentId": "string",  "organizationId": "string",  "projectId": "string",  "createdAt": "2019-08-24T14:15:22Z",  "expiresAt": "2019-08-24T14:15:22Z",  "id": "string",  "object": "workflow-approval",  "prompt": "string",  "resolvedAt": "2019-08-24T14:15:22Z",  "resolvedBy": {    "id": "string",    "type": "agent"  },  "status": "approved",  "stepAttemptId": "string",  "updatedAt": "2019-08-24T14:15:22Z",  "version": 0,  "workflowExecutionId": "string"}