Chat

Answer a tool approval

POST
/api/v1/chat/{session_id}/approve

Answer the tool call a conversation stopped on (status: "awaiting_approval"), and carry the turn on. The answer is a stream, in the same events as stream. Approved, the call runs and the stream carries on to the answer. Refused, the stream shows the call as tool_execution, then a tool_result with refused, reason and category, and the agent carries on without it. See the Chat API.

apiKey
headerAuthorizationBearer <token>

An API key, sk-syn- and 32 characters. On SynapseOrch Cloud an owner or admin makes it under Settings → Developer; on a self-hosted install, under Settings → API Keys.

session_id*string

The conversation that is waiting.

application/json
  1. body

The answer to the tool call a conversation stopped on.

approve*boolean

true runs the call; false refuses it.

reason?string

Why it was refused. The agent is told.

Lengthlength <= 2000
Default""
approval_id?|

The approval_id from pending_call. When given and it is not the call the conversation is waiting on, the answer is a 409 rather than an answer to a newer question.

agent?|

The conversation's agent. Omitted, the agent that is waiting; name it, or the approval_id, when two agents in one conversation both wait.

question_id?|null

Response Body

A stream of server-sent events.

response?stringtext/event-stream
curl -X POST "https://api.synapseorch.com/api/v1/chat/chat_01a1205c3e8f7a2b9d4c6e1f0a3b5d7c/approve" \  -H "Authorization: Bearer sk-syn-..." \  -H "Content-Type: application/json" \  -d '{    "approve": true,    "approval_id": "3f9a1c2b7d4e5f60"  }'
data: {"type": "tool_execution", "tool_name": "scrape_url", "args": {"url": "https://example.com"}}data: {"type": "tool_result", "tool_name": "scrape_url", "preview": "Example Domain..."}data: {"type": "response", "content": "The page is a placeholder domain for documentation examples.", "intent": "chat", "session_id": "user-session-123"}data: {"type": "done"}