Agent Versioning Migration Guide (v1 → v2)
Agent Versioning Migration Guide (v1 → v2)
The Atoms agent-versioning API moved to a branch-and-revision model. This page walks through what changed and gives you a concrete, endpoint-by-endpoint mapping to move existing integrations across.
What changed
The v1 model had two loose concepts (drafts and versions) that lived side-by-side on one linear history per agent. The v2 model wraps them in a branch:
- Every editable copy of an agent is a branch. Each agent has a
Mainbranch by default. - Each branch has one open draft at a time. Draft edits are upserts.
- Publishing a draft commits a revision on the branch. Revisions are immutable and equivalent to the old
version. - Exactly one branch per agent is live and serves production traffic.
activateon a specific version is gone; you make a whole branch live.
Existing IDs carry over. A v1 versionId equals its migrated revisionId, so any code that stores version IDs can keep resolving them via the by-id endpoints (which are kept, see below).
Endpoint mapping
409 endpoints return a body of the form { "status": false, "error_type": "versioning_v2_migration_required", "errors": [...] } and set Deprecation: true. The kept endpoints continue to accept the same request shape and return the same response.
The SDK routes under /sdk/agents/* are unaffected by this migration.
Timeline
- Launch day: v1 write endpoints and v1 list reads begin returning
409. Kept endpoints and the SDK routes continue to work. The v2 branch endpoints go live behind the same base URL. - Coexistence window: kept v1 endpoints (by-id reads + both test-calls) continue to work so existing integrations that store
versionIdvalues do not break. A v1versionIdequals its migratedrevisionId, so by-id lookups continue to resolve. - Sunset: v1 endpoints are removed. No removal date is published yet. When the backend owner fixes a date, this page and the Deprecation Notices page will carry it, and the affected endpoints will start returning a
Sunset:header (RFC 8594) with an RFC 7231 date.
Worked examples
1. Create a draft, edit it, publish it
Before (v1):
After (v2):
2. Activate an older revision
Before (v1):
After (v2): activate is replaced by two options:
-
Make the branch that owns the revision live. Sets the branch’s head as production traffic.
-
Restore an older revision on the current branch. Republishes its config as a new revision at the head of the branch. Existing revisions keep their IDs. If the branch has
v1, v2, v3and you restorev1, the branch ends up withv1, v2, v3, v4, wherev4’s content matchesv1andv4becomes the head.
3. List past versions
Before (v1):
After (v2): list per branch.
Revisions returned here have the same _id as v1 versionId.
4. Diff a draft against the active version
Before (v1):
After (v2): diff endpoint takes two refs; each side is either a revisionId or <branchId>:draft.
5. Test call against a draft or a specific revision
Before (v1): two different endpoints.
After (v2): one endpoint on the branch, differentiated by body.
Handling the 409 responses
There are three flavors of 409 you can see on the branch-and-revision API. Discriminate on error_type (for deprecation) or on body shape (for concurrency and base-revision errors).
1. versioning_v2_migration_required (deprecated v1 endpoint)
Returned by any of the deprecated v1 write / list endpoints. Body:
Header: Deprecation: true. Route to the v2 equivalent from the mapping table above.
2. DraftConflictError (concurrent draft edit)
Returned by PUT /agent/{id}/branches/{branchId}/draft when the caller passed expectedRevision and a concurrent edit changed the same field since. Body has a data.conflict object listing per-field diffs and both revision numbers.
Retry the read → merge → write cycle, or drop expectedRevision for last-write-wins.
3. base_revision_unavailable (unknown base for the draft)
Returned by PUT .../draft when expectedRevision names a revision the branch does not have. Body:
Fetch the branch’s current head revision (GET /agent/{id}/branches/{branchId}) and rebase the client’s expectedRevision before retrying.
Client sketch
Python:
Node:

