Versioning and rollback
Editing an agent does not change what is live. Edits land on the agent's draft; live traffic keeps using the published version until you publish again.
Drafts vs published
A PATCH to the agent updates its draft. Publishing snapshots that draft as a numbered version and makes it the published one. You can name a version at publish time, which is worth doing, it is what you will be reading in the version list six weeks later.
publish.sh
# 1. Edit the agent — this updates the draft.
curl -X PATCH https://api.saaya.ai/api/v1/agents/{agent_id} \
-H "X-API-Key: sa_..." \
-H "Content-Type: application/json" \
-d '{ "system_prompt": "…the revised prompt…" }'
# 2. Promote the draft when you're happy.
curl -X POST https://api.saaya.ai/api/v1/agents/{agent_id}/publish \
-H "X-API-Key: sa_..." \
-H "Content-Type: application/json" \
-d '{ "version_name": "april-refund-copy" }'Restoring an earlier version
List the agent's versions, pick the one you want back, and restore it. Nothing is deleted, the version you rolled away from stays in the list, so you can compare the two afterwards.
restore.sh
curl https://api.saaya.ai/api/v1/agents/{agent_id}/versions \
-H "X-API-Key: sa_..."
curl -X POST \
https://api.saaya.ai/api/v1/agents/{agent_id}/versions/{version_id}/restore \
-H "X-API-Key: sa_..."Was this page helpful?
