Palbase ai · API
/ai/chats/{chat_id}/goalChange the chat's goal
Pauses the goal (with a reason, said in its event) or resumes it — a resumed goal opens its next turn at once when no turn of the chat is at work — edits its objective or rubric, or changes a limit (null: none). As the server, or as the member it was set as (as); another member changes nothing of it (403 not_your_turn). An achieved goal is changed by setting a new one (409 goal_achieved); one set as a member who no longer stands where they stood when it was set — out of the chat, or the chat no longer theirs alone — is not resumed (409 goal_lapsed): it is cleared, or another set for the chat as it is now.
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.Request body
asstring · optionalThe member the server changes it as: the one it was set as (403 not_your_turn otherwise).budgetobject · optionalWhat a goal may cost at most, all its turns and their subagents together, their model calls and their web searches; null: no limit.max_turnsinteger · optionalThe most turns it opens; null: no limit.objectivestring · optionalIts objective, edited.reasonstring · optionalWhy it is paused, with status paused (500 characters at most): said in its stop_reason and its event.rubricstring · optionalIts rubric, edited.status"paused" | "active" · optionalpaused (the goal waits) or active (it goes on).curl -X PATCH "https://<your-ref>.palbase.studio/ai/chats/<chat_id>/goal" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"as":"string","budget":{"max_cost_usd":0},"max_turns":1,"objective":"string","reason":"string","rubric":"string","status":"paused"}'Responses
200The goal
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 UpdateChatGoal of ai's contract.