
Recording pending: Review and publish a configuration version. Follow the written guide below.
Branches, versions and Main
Create agent returns
agent_id, main_branch_id and initial_version_id. List agent branches returns Main first, then the newest branches. Add include_archived=true to include archived branches, and include_commit_status=true to fill commits_ahead and commits_behind, counted against Main.
To read a configuration, call Get agent with branch_id for that branch’s tip or version_id for one version. Get agent version metadata returns a version’s branch, description and parent pointers.
Versioned and per-agent settings
Most settings belong to the version, so each branch can hold its own values. Theseplatform_settings keys belong to the agent and are shared by every branch:
alerting, analysis_llm, auth, ban, call_limits, privacy, queueing_config, sentiment_analysis, simulation_library and topic_discovery.
They change only when you publish on Main. Publishing them to another branch discards them, and a merge never applies them. The agent’s name and tags also belong to the agent.
Drafts
A draft holds a complete configuration you have not published yet. Drafts belong to one member on one branch: a teammate does not see your draft, and a request made with your personal API key uses your draft. Drafts and publishing to a branch need a workspace member; a caller without one is refused with403 agent_member_required.
1
Save a draft
Call Create draft with
branch_id and the complete name, conversation_config, platform_settings and workflow. Start from the branch tip and keep the fields you are not changing: a draft replaces the whole configuration, not individual fields.2
Keep your own copy
The public API does not return a saved draft, and Create draft returns an empty body. Keep the configuration you sent if you need to compare it later.
3
Publish or discard it
Publish it as described in the next section, or remove it with Delete draft.
draft_is_behind_tip: true, because the draft is the configuration as you saved it and does not include the changes pulled in.
Publishing
Publishing writes a new version on a branch. Use Update agent with thebranch_id query parameter:
- Commit your draft. Send a body that contains only
version_description. The draft becomes the branch’s new tip and is cleared. Unpublished procedure edits on the branch are published with it. With neither a draft nor procedure edits, the request answers404 agent_draft_not_found. - Publish changes directly. Send the fields to change, such as
conversation_config, with an optionalversion_description. The new version is the branch tip with those changes applied. Your saved draft on that branch is discarded, not applied. Other members’ drafts stay.
400 publish_to_archived_branch. Conversation configuration changes need branch_id; without it the request answers 400 agent_branch_required.
The agent’s name and tags change only on Main: sent with another branch’s branch_id, they are ignored. An Update agent request without branch_id that changes name, tags, platform_settings or workflow counts as a write on Main. A settings or workflow change sent that way becomes a new Main version and discards your Main draft.
Screenshot pending: Review Changes with a sample configuration diff and the selected branch.
Traffic split and deploying
A deployment sets the share of live conversations each branch receives. Each branch is pinned to a version. A conversation that names aversion_id uses that version, and one that names a branch_id uses that branch’s tip, whatever the split. A version_id that is not on the named branch answers 400 agent_version_branch_mismatch. A conversation that names neither needs a deployment: without one it is refused with 409 agent_runtime_projection_unavailable.
Create deployment replaces the whole split. List every branch that should receive traffic, with percentages that total 100:
List agent deployments returns the history of splits, newest first. Each entry’s
source says what made it: manual for a deployment you created, branch_merge for a merge that moved traffic, and duplicate for an agent copied with its split.
See the warning at the top of this page: a deployment that gives a branch traffic is refused until agent execution is available.
Creating a branch
Create a branch from any version of any branch with Create agent branch. Sendparent_version_id, name and description. You can also send conversation_config, platform_settings or workflow changes to apply to the new branch’s first version.
Branch name rules
Rename a branch, or change its description, with Update agent branch.
Merging branches
A merge takes the changes made on a source branch and writes them as one new version on a target branch. Any active branch can be merged into any other active branch, and Main can be either the source or the target. Call Merge agent branch with the source in the path andtarget_branch_id in the query. Check the result first with Preview merged configuration, which takes target_branch_id and force and changes nothing. Until a conflict is resolved, the preview shows the target’s value, or the source’s with force=true.
The merge compares both tips with their merge base, the newest version both branches share:
- A field only one branch changed takes that branch’s value.
- A field both branches changed to different values is a conflict. See Resolving conflicts.
The new version’s description is
Merged from branch <source name>. Archiving the source also closes the merge proposals from or to it.
Merges with nothing new
A merge that would bring nothing new is refused with400 and writes nothing:
A merge is still written when both branches made the same change on their own.
Pulling in changes
Pulling in changes, also called a rebase, brings another branch’s changes into your branch as a new version. Use it to keep a long-running branch current with Main, or to settle conflicts on your own branch before merging it. Call Rebase a branch onto main with the branch to update in the path. It pulls from Main unless you name another active branch insource_branch_id. Check the result first with Preview rebased configuration.
- Main cannot be rebased:
400 cannot_rebase_main. - A branch that already holds every change is refused with
400 branch_already_up_to_date. A branch can be behind and still be up to date, for example when it already made the same change itself. - The new version’s description is
Rebased onto <source name>. Your drafts are kept. - There is no
forceon a rebase. Until a conflict is resolved, the preview keeps your branch’s value.
Automatic updates from Main
Turn onauto_rebase with Update agent branch to pull in each new version of Main automatically, within seconds of it being written. Nothing runs when you turn it on: the first update follows Main’s next version.
To follow another branch instead, set sync_branch_id. It must be Main or the active branch this branch was created from (parent_branch_id). Pass Main’s ID to follow Main again. At most 10 branches can follow one another in a row. While the chosen branch is archived, Main is followed in its place.
Each attempt acts as the member who turned automatic updates on, with that member’s current access. Turn them on as a workspace member: an attempt with no member to act as is rejected. The branch’s sync_status.last_attempt shows the latest outcome:
Automatic updates cannot be turned on for Main (
cannot_auto_rebase_main_branch) or an archived branch (cannot_auto_rebase_archived_branch). Archiving a branch turns them off.
Resolving conflicts
A merge or rebase with a conflict is refused with409 merge_conflicts_unresolved until you choose a value for every conflict. Resolve them in three steps.
1
Preview
Call the merge or rebase preview. Each entry in
conflicts has an id, the field’s section and path, and its base_value, source_value and target_value. Keep source_tip_version_id and target_tip_version_id from the response.In a rebase preview, the source is the branch you are updating and the target is the branch you pull from.2
Choose
For each conflict, send a resolution with its
conflict_id and a choice: source, target, or custom with a custom_value. Only conflicts with accepts_custom_value: true take custom. For a procedure conflict, custom_value is the ID of the procedure version to keep.3
Merge
Send the resolutions with the tip IDs from the preview. On a merge, these are
source_tip_id and target_tip_id. On a rebase, they are branch_tip_id (the preview’s source_tip_version_id) and source_tip_id (the preview’s target_tip_version_id).force: true instead, which keeps the source’s value for every conflict. You cannot send both. Preview the forced result with force=true on the merge preview.
A preview’s
merge_error says when the merged result would fail the checks every version passes, even with no conflicts left. The merge is then refused the same way publishing would refuse it.
Branch protection
Set a branch’sprotection_status with Update agent branch:
writer_perms_required, the default: anyone who can edit the agent can change the branch. Changingprotection_statusitself, in either direction, needs a workspace admin.admin_perms_required: only workspace admins can publish to the branch, merge into it, pull changes into it, change its share of traffic, or change any of its settings, such as its name, description, archiving, protection or automatic updates.
403 agent_branch_protected. When Main is protected, this includes an Update agent request without branch_id, which writes on Main. A merge needs access to its target, and to its source only when the merge archives the source. Members who cannot merge into a protected branch can open a merge proposal for an admin to merge.
A branch with automatic updates that is admin_perms_required cannot follow a branch other than Main that is writer_perms_required: 400 auto_rebase_sync_branch_less_protected.
Duplicating an agent
Duplicate agent creates a new agent with a copy of every unarchived branch at its tip, with its name and description. It also copies the procedures those tips use, under new IDs, the per-agent settings and the current traffic split. Not copied: archived branches, drafts, merge proposals, history, past deployments and automatic updates. Every copied branch starts aswriter_perms_required.
A copied branch and the new Main share no history. The first merge or pull between them reports every field they hold differently as a conflict. Resolve the conflicts or, on a merge, use force. Later merges between them work as usual.
If a branch cannot be copied, the whole duplicate fails with 400 branch_cannot_be_duplicated, and data.branch_id names the branch.
Archiving
Archive a branch withis_archived: true on Update agent branch, or by merging it with archive_source_branch: true. An archived branch:
- cannot be published to, merged, rebased or given traffic;
- is left out of the branch list unless you ask for
include_archived=true; - has its automatic updates turned off;
- closes every open merge proposal from or to it, as
branch_archived.
cannot_archive_main_branch), and neither can a branch with live traffic (cannot_archive_branch_with_traffic). Move its traffic first. Restore a branch with is_archived: false. Automatic updates stay off until you turn them on again. A restore is refused:
- with
409 conflictwhen an active branch has taken its name. Send a newnamein the same request; - with
400 validation_errorandparam: is_archivedwhen an admin-protected branch that follows it with automatic updates would then follow a less protected branch. Restore it asadmin_perms_requiredin the same request, or change the follower first.