Skip to main content
POST
Rebase Agent Branch

Overview

Rebases the branch onto the dev head you previewed against: re-runs the three-way merge, applies your conflict resolutions, saves the merged configuration as a new version on the branch, and moves the branch’s base to that dev head. Run Preview Agent Branch Rebase first to get dev_head_version_id and the conflict IDs. Once the rebase succeeds, Merge Agent Branch fast-forwards. Requires an admin, owner, operator, or prompter role.

Headers

string
required
Your API key for authentication.

Path Parameters

string
required
The agent’s unique identifier.
string
required
The branch’s unique identifier. Must be an open branch on this agent.

Body Parameters

string | null
required
The dev_head_version_id returned by the preview, passed unchanged (including null when the preview returned null). If dev has gained a version since, the request returns 409 REBASE_STALE; preview again and retry. Omitting the field is treated as null and fails the same way whenever dev has any version.
object
Map from conflict id (as reported by the preview) to how to settle it. Each value is one of:
  • "ours": keep the branch’s value.
  • "theirs": take dev’s value.
  • { "value": ... }: write this value in place of both. Any JSON value is accepted; the merged configuration is validated as a whole before it is saved.
Any other shape returns 400 INVALID_RESOLUTIONS and nothing is written. Every conflict the merge finds must be covered, or the request returns 400 UNRESOLVED_CONFLICTS and nothing is written. That error does not list which conflicts are outstanding, so build your resolutions from Preview Agent Branch Rebase, which returns the full conflict set. Omit when the preview reported no conflicts.

Response

object
The new branch version holding the merged configuration. When the branch is already based on dev’s head, nothing is written and the branch’s current head version is returned instead.
null | array
null on success, or a list of error objects if the request failed.

Docs for agents: llms.txt