palbaseDocs

Palbase ai · API

POST/ai/agents/{name}/publish

Publish an agent's draft

Makes the draft a version, the next number, and the one its chats talk to from their next turn on. A draft that is the version published is refused (409 nothing_to_publish); an agent keeps 1000 versions (409 too_many_versions).

Called by your server, with the project's secret key.

Path

namestring · requiredThe name: lowercase letters, digits, _ and -, starting with a letter, at most 64.

Request body

revisioninteger · optionalThe draft's revision as it was looked at: when another was saved since, the publish is refused (draft_changed). Left out: the draft as it is now.
curl
curl -X POST "https://<your-ref>.palbase.studio/ai/agents/<name>/publish" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"revision":1}'

Responses

200The agent

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

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

Operation PublishAgent of ai's contract.