Palbase ai · API
/ai/chats/{chat_id}/tool-outputs/{call_id}Answer an app's tool call
The answer of a client tool's call, made by the app's code: the turn waiting for it goes on. The first answer is the one. Given by the app of the member whose message began the turn (403 not_your_turn for any other) — or by the project's server, for any turn, or as that member (as). A call of the project's backend (or an HTTPS tool of its) that answered {"deferred": true} — its work outlasts a call — is answered here too, by the project's server as itself, within the while it named (a minute to a day; an hour), and by no member. An answer whose tool wrote the chat's workspace names the tree its writes left (workspace_tree), as an answer given at once does: the agent's next command waits for the session's machine to have it (400 for one that names no tree).
Called by a signed-in user of your app, with their token and the publishable key; or your server, with the project's secret key.
Path
chat_idstring · requiredThe chat's id.call_idstring · requiredThe tool call (a tool event's call_id).Request body
asstring · optionalThe member the project's server acts as: held to that member's rules — their turn (403 not_your_turn) (the server's alone: a user sending it is answered 400; one who is not a member of the chat, 403 not_a_member). Left out, the server acts as itself.is_errorboolean · optionalThe tool failed; the output says why.outputobject[] · requiredText and images: the agent is shown both.workspace_treeobject · optionalThe tree the tool's writes left the chat's workspace at, as a write of it answered them (PUT /ai/chats/{chat_id}/workspace/files): its manifest, its place in the workspace's history, either or both. A call that answered later names it as one answered at once does (workspace_tree): the agent's next command waits for the session's machine to have it. Left out: the tool wrote nothing there.curl -X POST "https://<your-ref>.palbase.studio/ai/chats/<chat_id>/tool-outputs/<call_id>" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"output":[{"type":"text"}]}'Responses
200The answer, given
400The request is malformed, or names what this module does not offer (the error names which)
401No valid credential
403A publishable key or a user's session: everything here is the project's server's, called with the secret key
404No such response, job or provider in this project
409The response's state refuses it
503The model service or the database did not answer; retry shortly
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation AnswerChatToolCall of ai's contract.