palbaseDocs

Palbase ai · API

POST/ai/chats/{chat_id}/approvals/{approval_id}

Decide a tool call

A tool call that waits for a person's yes: approved it is made; denied, the agent is told, with the reason, and goes on. Decided by 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).

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.
approval_idstring · requiredThe approval (a tool event's approval_id).

Request body

approveboolean · requiredYes, or no.
asstring · optionalThe member the project's server acts as: held to that member's rules — their turn (403 not_your_turn) — and the decision is theirs (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.
reasonstring · optionalWhy (told to the agent; 1024 bytes at most).
curl
curl -X POST "https://<your-ref>.palbase.studio/ai/chats/<chat_id>/approvals/<approval_id>" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"approve":false}'

Responses

200The decision

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

503The model service or the database did not answer; retry shortly

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation DecideChatApproval of ai's contract.