---
title: "Merge a pull request"
method: PUT
path: "/repos/{owner}/{repo}/pulls/{pull_number}/merge"
tags: ["pulls"]
---

# Merge a pull request

`PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge`

Merges a pull request into the base branch.
This endpoint triggers [notifications](https://docs.github.com/enterprise-cloud@latest/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-cloud@latest/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-cloud@latest/rest/guides/best-practices-for-using-the-rest-api)."

## Path parameters

- `owner` string, required
- `repo` string, required
- `pull_number` integer, required

## Request body

- object, nullable
  - `commit_title` string — Title for the automatic commit message.
  - `commit_message` string — Extra detail to append to automatic commit message.
  - `sha` string — SHA that pull request head must match to allow merge.
  - `merge_method` 'merge' | 'squash' | 'rebase' — The merge method to use.

## Response `200`

if merge was successful

- PullRequestMergeResult — Pull Request Merge Result
  - `sha` string, required
  - `merged` boolean, required
  - `message` string, required

## Other responses

- `403` — Forbidden
- `404` — Resource not found
- `405` — Method Not Allowed if merge cannot be performed
- `409` — Conflict if sha was provided and pull request head did not match
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
