---
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`

## Request

- Base URL: `https://blobsrus.omniapp.co/api`
- URL: `https://blobsrus.omniapp.co/api/v1/models/{modelId}/branch/{branchName}/merge`
- Auth: HTTP bearer

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.dev/omni/apis/omni-api.md) - [All operations](https://skmtc.dev/omni/apis/omni-api/llms.txt) - [OpenAPI document](https://skmtc.dev/omni/apis/omni-api/revisions/43290040f88f?raw)
