Merge an approved changeset
POST /Platform/entities/changesets/{changeset_id}/merge
Merge an approved changeset. Executes the reviewed merge.
Merges using the FROZEN plan and resolutions — what merges is exactly
what was approved. Always all-or-nothing at the plan level (partial
does not exist here; raw merge-branch keeps it for non-reviewed
flows). Refuses on a stale plan (any member's from/to head moved, or
the branch's entity set changed since freeze) — refresh and get
re-approved instead. Concurrent merges targeting the same branch are
mutually excluded.
A mid-write failure leaves the changeset partially_merged with
per-member new_commit_id bookkeeping showing exactly what landed;
recover via changeset-revert (undoes the written members) or
changeset-refresh (re-plan; written members drop out).
On success the feature branch is deleted — the changeset retains the plan, diffs, evidence, and conversation.
Path parameters
changeset_id: str. The approved changeset to execute.
Body parameters
keep_branch: optional bool. Keep the feature branch after a full merge.commit_message: optional str. Override the per-member merge commit message.
Returns
ChangesetResponse
changeset: dict. changeset_id, from_branch, to_branch, status, description, author, origin_ref, approver, resolutions, plan, code_ranges (one per repository: repo_id, repo_name, base_sha, head_sha, to_sha, merged_sha), created_at, merged_at, members (entity members and, as RepoFile members, the files each code range changes), events, test_evidence.auto_approve_ignored: optional str or null. Why auto_approve was ignored (main is protected and the caller holds no bypass).
Example request
curl -X POST "https://api.hilus.ai/Platform/entities/changesets/{changeset_id}/merge" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'