Agent Versioning
Snapshot an agent's config, run a specific version for a call, and rollback when needed.
Every agent has a current version that increments when you explicitly publish a snapshot. Old versions are kept forever so you can:
- A/B test a new prompt against the previous one
- Rollback instantly if a release breaks something
- Replay a historic call with the same config it was made with (great for debugging)
Lifecycle
draft (live edits) → publish → v2 snapshot → continue editing
↓
rollback → v3 snapshot (= contents of v2)The agent's editable fields (system prompt, voice, settings, etc.) always describe the current draft. Publishing a version captures a frozen copy without affecting the draft.
Publish a new version
curl -X POST https://api.osmtalk.com/api/agents/{agentId}/versions \
-H "Authorization: Bearer $OSMTALK_API_KEY" \
-d '{
"label": "v2 — tighter qualifier",
"notes": "Refined budget question and added the demo-booking CTA at end."
}'Response:
{
"id": "ver_xxx",
"version": 7,
"label": "v2 — tighter qualifier",
"notes": "...",
"snapshot": { /* full agent config at this moment */ }
}The agent's currentVersion updates to 7 and all subsequent calls run that version (unless overridden).
List versions
curl https://api.osmtalk.com/api/agents/{agentId}/versionsReturns the version history, newest first.
Fetch a specific version
curl https://api.osmtalk.com/api/agents/{agentId}/versions/5Returns the snapshot — useful to diff against the current draft.
Run a specific version
Any voice-call endpoint accepts agentVersion:
curl -X POST https://api.osmtalk.com/api/calls/outbound \
-d '{
"agentId": "agent_xxx",
"phoneNumberId": "pn_xxx",
"destination": "+919876543210",
"agentVersion": 5,
"dynamicVariables": { "first_name": "Arjun" }
}'When agentVersion is omitted, the call uses currentVersion.
Rollback
curl -X POST https://api.osmtalk.com/api/agents/{agentId}/versions/5/rollbackThis copies version 5 back to the live draft AND creates a new version (so the history is preserved). After a rollback to v5, currentVersion = 8 with contents identical to v5.
A/B testing
Pin half your traffic to one version, half to another:
# Variant A
curl -X POST .../calls/outbound -d '{"agentVersion": 6, ...}'
# Variant B
curl -X POST .../calls/outbound -d '{"agentVersion": 7, ...}'Compare per-version success rates from the post-call analysis output (analysis.success) and conversion stats in the dashboard.
Where the version is recorded
Every call record stores agent_version so you can reconstruct exactly what config the call used, even after the agent has been edited many times since. Visible on the call-details page.