Deployments.ai Docs
Runtime

Approve a pending tool call

POST /v1/runs/{runId}/approvals/{approvalId}/resolve · SDK resolveApproval · CLI deployments approval approve, deployments approval reject

POST
/v1/runs/{runId}/approvals/{approvalId}/resolve

Requires approvals:write.

Authorization

headerAuthorizationBearer <token>

Opaque bearer credential scoped to one service account and tenant.

Path Parameters

runId*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
approvalId*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"
threadId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$

Response Body

ResolveApprovalResponse

application/json
  1. response
approval*
decision*string
Value in"approved""expired""rejected"
run*
toolCall*
curl -X POST "https://example.com/v1/runs/string/approvals/string/resolve" \  -H "Content-Type: application/json" \  -d '{    "decision": "approved",    "threadId": "string"  }'
{  "approval": {    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "version": 0,    "environmentId": "string",    "organizationId": "string",    "projectId": "string",    "escalatedAt": "2019-08-24T14:15:22Z",    "escalationCount": 0,    "escalationPolicy": {      "property1": null,      "property2": null    },    "executionBindingId": "string",    "executionPurpose": "customer",    "expiresAt": "2019-08-24T14:15:22Z",    "id": "string",    "object": "approval",    "request": {      "property1": null,      "property2": null    },    "requestedByAgentDeploymentId": "string",    "resolvedAt": "2019-08-24T14:15:22Z",    "resolvedByPrincipalId": "string",    "runId": "string",    "status": "approved",    "toolCallId": "string"  },  "decision": "approved",  "run": {    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "version": 0,    "environmentId": "string",    "organizationId": "string",    "projectId": "string",    "workspaceId": "string",    "agentDeploymentId": "string",    "agentReleaseId": "string",    "attempt": 0,    "automation": {      "fireId": "string",      "id": "string",      "kind": "heartbeat"    },    "checkpointCount": 0,    "completedAt": "2019-08-24T14:15:22Z",    "error": {      "property1": null,      "property2": null    },    "executionBindingId": "string",    "executionPurpose": "customer",    "executor": "string",    "id": "string",    "object": "run",    "parentSpanId": "string",    "priority": 0,    "releaseSelection": "candidate",    "replayedFromRunId": "string",    "replayedFromTraceId": "string",    "spanId": "string",    "startedAt": "2019-08-24T14:15:22Z",    "status": "canceled",    "threadId": "string",    "traceId": "string",    "trigger": "string"  },  "toolCall": {    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "version": 0,    "environmentId": "string",    "organizationId": "string",    "projectId": "string",    "approvalId": "string",    "completedAt": "2019-08-24T14:15:22Z",    "effect": "execute",    "executionType": "client",    "expiresAt": "2019-08-24T14:15:22Z",    "externalOperationId": "string",    "id": "string",    "input": {      "property1": null,      "property2": null    },    "inputSummary": "string",    "modelAttemptId": "string",    "modelCallIndex": 0,    "object": "tool-call",    "output": {      "property1": null,      "property2": null    },    "outputSchema": {      "property1": null,      "property2": null    },    "outputSummary": "string",    "policyAction": "allow",    "policyReason": "string",    "requiredScopes": [      "string"    ],    "runId": "string",    "startedAt": "2019-08-24T14:15:22Z",    "status": "failed",    "toolAdapterId": "string",    "toolName": "string",    "toolPlanFingerprint": "string"  }}