---
title: "Merge Branch"
method: POST
path: "/projects/{projectId}/branches/{branchId}/merges"
tags: ["Branches"]
---

# Merge Branch

`POST /projects/{projectId}/branches/{branchId}/merges`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/projects/{projectId}/branches/{branchId}/merges`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-api-v2/docs/projects/:projectId/branches/:branchId/merges/post.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `project.source.string` (Read and Write).

__NOTE:__ By default, during merge: strings will be added from the source branch, deleted strings will be removed, changed strings will be updated. Conflicted strings will remain unchanged unless `acceptSourceChanges` is enabled.

## Path parameters

- `projectId` integer, required
- `branchId` integer, required

## Request body

- BranchMergeCreateForm
  - `deleteAfterMerge` boolean: Whether to delete branch after merge
  - `sourceBranchId` integer, required: Branch that will be merged
  - `dryRun` boolean: Simulate merging without making any real changes.
  - `acceptSourceChanges` boolean: When enabled, conflicted strings will be resolved by accepting changes from the source branch.

## Response `202`

Branch merge was successfully started

- BranchMergeResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` BranchMerge, required
    - `identifier` string
    - `status` string
    - `progress` integer: in percentages
    - `attributes` object
      - `sourceBranchId` integer
      - `deleteAfterMerge` boolean
      - `acceptSourceChanges` boolean
      - `dryRun` boolean
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `startedAt` string, date-time
    - `finishedAt` string, date-time

## Other responses

- `400`: Invalid Request Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Project or branch with specified id was not found
- `405`: Method Not Allowed
- `503`: Service Unavailable

---

[API](https://skmtc.dev/crowdin/apis/crowdin-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-api-v2/revisions/27aae7751699?raw)
