Promote a whole branch into another

POST /Platform/entities/merge-branch

Promote a whole branch into another. Merges every entity on the branch in one call.

The branch-level counterpart to per-entity merge. Discovers what the branch touched itself, so you don't need to know every entity id up front.

Standard entity-change workflow:

  1. Create or select a feature branch.

  2. Edit the existing ids on that branch.

  3. Test the changed behavior on the feature branch.

  4. Open a changeset with test evidence. A human reviews and approves it, then the merge executes the approved plan.

dry_run=true (the default) previews the promote plan for any caller. Applying it directly with dry_run=false is the one-command path for low-risk solo work: in an org where main is protected it requires the bypass_branch_protection permission (see docs_api(page='changesets')); everyone else promotes through changeset_open -> review -> changeset_merge. Every real promotion, reviewed or not, is recorded as a changeset; changeset_id in the response links to the ledger entry.

Semantics that matter:

Conflicts come back keyed by entity; resolve by re-calling with resolutions={"EntityType/entity_id": {conflict_path: "ours" | "theirs" | "base" | {"value": X}}}.

Body parameters

Returns

MergeBranchResponse

Example request

curl -X POST "https://api.hilus.ai/Platform/entities/merge-branch" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'