---
title: "Merge a branch"
method: POST
path: "/v1/models/{modelId}/branch/{branchName}/merge"
tags: ["Model branches"]
---

# Merge a branch

`POST /v1/models/{modelId}/branch/{branchName}/merge`

Merge a model branch into the shared model.

## Path parameters

- `modelId` string, uuid, required
- `branchName` string, required

## Request body

- object
  - `delete_branch` boolean — Delete the branch after merging
  - `publish_drafts` boolean — When enabled, publish branch-attached drafts when merging
  - `commit_message` string — Custom commit message for git sync. Defaults to `"branch <name> merged via API"`
  - `force_override_git_settings` boolean — **Requires Connection Admin or Organization Admin permissions.** Users with lesser permissions will receive a `403 Forbidden` error when attempting to use this parameter. Allow merge for PR-required or git-follower models. When enabled, the merge will succeed but git will not be synced to avoid force-pushing to main.

## Response `200`

Branch merged successfully

- object
  - `success` boolean — Whether the merge was successful
  - `published_drafts_count` integer — Number of drafts that were published during the merge
  - `failed_drafts_count` integer — Number of drafts that failed to publish
  - `git_synced` boolean — Whether the changes were synced to git

## Other responses

- `400` — Bad Request - Merge not allowed for this model configuration
- `403` — Forbidden - Insufficient permissions
- `404` — Not Found - Resource does not exist
- `405` — Invalid HTTP method
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)
- `500` — Internal Server Error

---

[API](https://skmtc.net/omni/apis/omni-api.md) · [All operations](https://skmtc.net/omni/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omni/omni-api/versions/6b02f7349d0e/schema)
