Pinter
ENID
Conversations
Lihat sebagai Markdown

Resolve Tool Approval Confirmation

POST/api/conversations/{conversation_id}/approvals/{approval_id}

Overview

Resolves a pending tool execution approval by either confirming or rejecting the paused action, resuming the conversation run.

When the agent pauses on several tool calls at once (parallel tool calls), answer all of them in one request: put one decision in approved and the rest in decisions. The run resumes once, after every decision is applied. Answering them in separate requests lets the agent continue while the others are still pending.

Authentication & Headers

  • Auth: Bearer Token
  • Required Header: API-Version: 1
  • Optional Header: X-Pinter-Response-Format (comma-separated tokens): json returns a collected JSON response; blocks or blocks,openui streams blocks and OpenUI fences.

Path Parameters

  • conversation_id (string, required): Unique identifier of the conversation session.
  • approval_id (string, required): Unique identifier of the pending tool approval request (the approval_id from the approval_required event). May contain /, + or =, so the route accepts it as a path.

Request Body

  • approved (boolean, required): true to approve tool execution, false to reject. Applies to the approval_id in the path.
  • agent_id (string, required): ID of the active agent executing the conversation.
  • stream (boolean, optional, default: true): Whether to stream subsequent execution events via SSE.
  • approval_mode (string, optional, default: full-access): Mode for the resumed turn, same meaning as on send. With full-access, tools the agent calls after this resume run without a new confirmation. An explicit answer to a pending approval is always honored, including a rejection.
  • decisions (array, optional, default: []): Decisions for the other pending approvals of the same turn, resumed together with the path approval. Each item is { "approval_id": string, "approved": boolean }. An entry that repeats the path approval_id is ignored.

Example: two parallel tool calls

POST /api/conversations/{conversation_id}/approvals/appr_a
{
  "approved": true,
  "agent_id": "agent-1",
  "stream": true,
  "decisions": [{ "approval_id": "appr_b", "approved": false }]
}

If any listed approval is not found (404) or already resolved (409), the whole request is rejected and nothing is resumed.

Parameter

Path

conversation_idstringwajib
Unique UUID of the conversation session / thread.
approval_idstringwajib

Header

x-pinter-response-formatstring
Comma-separated response mode tokens. `blocks`: structured rich response blocks (charts, html, images, followup). `blocks,openui`: same as `blocks` plus openui-lang UI fences inside text deltas. `json`: collected JSON response.

Body permintaan

application/json

approvedbooleanwajib
agent_idstringwajib
streamboolean
approval_modeenum
approvalfull-access
decisionsobject[]
decisions[].approval_idstringwajib
decisions[].approvedbooleanwajib
{
  "approved": true,
  "agent_id": "string",
  "stream": true,
  "approval_mode": "full-access",
  "decisions": []
}

Respons

200 SSE event stream resuming agent turn, or collected JSON response

400 Bad Request - The request parameters or headers are invalid (e.g. unsupported API-Version).

401 Unauthorized - Missing, invalid, or expired JWT Bearer token.

403 Forbidden - Insufficient role permissions or resource access denied by RBAC policy.

404 Conversation, active session, or any listed pending approval not found

409 Any listed approval has already been resolved

422 Validation Error

detailobject[]
detail[].locstring | integer[]wajib
detail[].msgstringwajib
detail[].typestringwajib
detail[].inputobject
detail[].ctxobject
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Contoh

curl -X POST "$PINTER_URL/api/conversations/018f3a55-234b-76b9-b8d1-561b34e2a101/approvals/<approval_id>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"approved":true,"agent_id":"string","stream":true,"approval_mode":"full-access","decisions":[]}'