---
title: "Merge ref into a branch"
method: POST
path: "/repos/{repo_id}/merges"
tags: ["Repository Merge Manipulation"]
---

# Merge ref into a branch

`POST /repos/{repo_id}/merges`

## Request

- Base URL: `https://api.diversion.dev/v0`
- URL: `https://api.diversion.dev/v0/repos/{repo_id}/merges`
- Auth: OAuth 2
  - Implicit: `https://auth.diversion.dev/oauth2/authorize`
  - Scopes: `coreapi/write`
- TypeScript: <https://skmtc.dev/diversion/apis/diversion-core-api/docs/repos/:repo_id/merges/post.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `base_id` string
- `other_id` string

## Response `200`

Request completed successfully

## Other responses

- `201`: The merge into a branch was completed successfully, and the response contains the new commit ID
- `202`: The merge is in progress. It has merge conflicts requiring active input from the user for conflict resolution. The response contains a merge ID, which can be used for querying /repos/{repo_id}/merges/{merge_id}

---

[API](https://skmtc.dev/diversion/apis/diversion-core-api.md) - [All operations](https://skmtc.dev/diversion/apis/diversion-core-api/llms.txt) - [OpenAPI document](https://skmtc.dev/diversion/apis/diversion-core-api/revisions/38a18aba804b?raw)
