Merge branch
Changed on<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>
Merges an active branch into the app's main branch. Base44 merges the branch's code into main, applies its entity and backend function changes to main, saves a checkpoint, and adds a message to main's conversation that summarizes the merge. The branch's status then becomes merged, and it can't be changed after that. Comments left on the branch's preview are deleted. This works while main branch protection is on.
The request returns once the merge is done. A 409 leaves the branch active and main unchanged. Its extra_data.reason tells you what to do:
- branch_has_no_changes: the branch has no code changes to merge.
- branch_merge_conflict: the branch conflicts with main. Update the branch from main to resolve the conflicts, then merge again.
- app_processing or branch_processing: the AI is working on main or on the branch. Try again once it's done.
- branch_sync_in_progress: the branch is being updated from main. Try again once Get branch sync status shows sync_state as idle.
- branch_pending_commit_wait_failed: the branch's latest changes are still being saved. Try again shortly.
In this response, branch.created_by_name is always null. Get branch returns it.
This endpoint is limited to 30 requests per minute, shared with Create branch, Delete branch and Merge branch.
<Note>A branch gets changes of its own from chat messages sent to it: pass the branch's id as branch_id to Send chat message. Until it has some, merging it returns a 409 with branch_has_no_changes.</Note>
<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. A read-only key is refused, and workspace API keys are not accepted.</Note>
<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>
Request
- Base URL: https://app.base44.com
- URL: https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge
- Auth: HTTP bearer
Path parameters
ID of the branch, as returned by List branches.
ID of the app the branch belongs to.
Response
The merged branch.
Example response
{
"branch": {
"id": "68f1a2b3c4d5e6f708192a3b",
"app_id": "6820f3a4e7b91d003c45a1f2",
"branch_name": "add-contact-form",
"status": "active",
"run_state": {
"state": "ready",
"details": "Restoring checkpoint",
"last_updated_date": "2026-09-28T10:18:40"
},
"code_state": "changed",
"base_checkpoint_id": "6886b8d390dc7e2f4a2c91b3",
"created_by_id": "68a0c1d2e3f4a5b6c7d8e9f0",
"created_by_name": "Jane Doe",
"created_date": "2026-09-28T10:15:00",
"merged_at": "2026-09-29T08:02:11",
"merged_by_id": "68a0c1d2e3f4a5b6c7d8e9f0",
"static_preview_url": "https://preview--6820f3a4e7b91d003c45a1f2--b-d8c647b.base44.app"
},
"merge_message_id": "7f3a1c88-52d4-4a0e-9b31-2c6f0d8e4a19"
}Changes
- info
the endpoint scheme security
PersonalAccessTokenAuthwas added to the API
- info
- info
endpoint added
- info