Statuses
Merged and closed proposals also carry
outcome.at and outcome.by_user_id.
Creating a proposal
Call Create a merge proposal with:created_merge_proposal_id. Opening a proposal does not change either branch. The proposal records the source’s tip at that moment as source_tip_version_id_at_creation, but a merge always takes the source’s current tip.
Find proposals with List proposals, newest first. Filter by
status, source_branch_id or target_branch_id, or search titles and descriptions with search. Read one with Get a merge proposal.
Reviewers and approvals
Anyone who can edit the agent, other than the proposal’s author, can review it with Review a merge proposal. Send astate and an optional comment:
A reviewer’s latest review replaces their earlier one, so a reviewer who requested changes approves to lift their request. Only that reviewer can lift it. Reviews stay in force when the source branch gets new versions: nothing resets them. To start the review again, close the proposal and open a new one. The author cannot review their own proposal:
403 merge_proposal_self_review. Reviews can be left only while the proposal is open.
To discuss a proposal without recording a verdict, use Comment on a merge proposal. Comments support Markdown, accumulate, and can still be added after the proposal is merged or closed.
The author, the requested reviewers and anyone who has reviewed can edit an open proposal’s title, description and requested_reviewer_user_ids with Update a merge proposal. Anyone else is refused with 403 merge_proposal_edit_forbidden.
Merging a proposal
Call Merge a merge proposal. It takesarchive_source_branch (default true) and force (default false), and returns the proposal with outcome.status: merged.
The merge is allowed when all of these hold:
- You can merge into the target branch. On a protected target, that means a workspace admin. When the merge archives the source, you also need access to the source.
- No reviewer’s latest review is
changes_requested. This applies to admins too. - Someone other than the author has approved it. Workspace admins can merge without an approval.
400 merge_proposal_requirements_not_met, and the message says which one. Missing access answers 403 agent_branch_protected.
The merge itself follows the rules of a direct merge: it writes one version on the target, moves the source’s live traffic, and refuses a merge with nothing new (no_new_changes_to_merge, branch_already_merged). A proposal refused that way stays open until someone closes it.
When the merge archives the source, every other open proposal from or to the source is closed as branch_archived. When the source is kept, its other proposals stay open.
Conflicts on a proposal
A proposal merge has noconflict_resolutions. If both branches changed the same field, the merge answers 409 merge_conflicts_unresolved, and data.unresolved_conflict_ids lists the conflicts. You have two ways forward:
- Pull in changes on the source branch. Rebase the source from the target with Rebase a branch onto main, setting
source_branch_idto the proposal’s target, and resolve the conflicts there. The source then holds the target’s changes, and the proposal merges without conflicts. Tell reviewers what changed, since the source has a new tip and their earlier reviews still count. - Keep the source’s value for every conflict. Merge with
force: true. Check the result first with Preview merged configuration andforce=true.
force or merge Main directly with conflict_resolutions.
Linked triage tickets
When you create a proposal withtriage_ticket_id, the ticket records that the proposal was opened to resolve it. Merging the proposal resolves the ticket if it is still open or in_progress. Closing the proposal leaves the ticket as it is.
Closing a proposal
Close an open proposal without merging by sendingclose: true to Update a merge proposal. Anyone who can edit the agent can close it.
A merged or closed proposal cannot be reviewed, edited, merged or closed again:
400 merge_proposal_not_open. Open a new proposal for the same branches instead.