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

# Merge a pull request asynchronously

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

Merges a pull request into the base branch in the background or adds it to a merge queue. Background processing allows certain types of errors to be retried and reduces the risk of timeouts for complex merges.

This is the required API for merging stacked pull requests. For a stacked pull request, the operation includes all open downstack pull requests.

A new asynchronous merge request returns a `202` response with a UUID that can be used to [fetch the result of the merge](https://docs.github.com/rest/pulls/pulls#get-the-result-of-an-asynchronous-merge). If another asynchronous merge request is already pending for this pull request, a `409` response returns that request's UUID and merge options instead.

If the pull request is already merged or already in a merge queue, a `200` response is returned immediately. A `merged` result includes the merge commit OID. An `enqueued` result means the pull request was added to the merge queue, not that it has merged.

If the pull request cannot be merged (e.g. because it is closed, or still a draft) this result will be returned immediately with a `400` response status. Branch protection rules and repository rules are not run at this stage, only basic pull request state checks are performed.

## 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. Only supported for direct merges.
  - `commit_message` string — Extra detail to append to automatic commit message. Only supported for direct merges.
  - `sha` string — SHA that pull request head must match to allow merge. If not provided, the current head of the PR at the time of the request will be used; if the PR is pushed in between the merge being requested and being executed, the merge will be cancelled.
  - `merge_method` 'merge' | 'squash' | 'rebase' — The merge method to use for a direct merge. Only supported for direct merges.
  - `merge_action` 'default' | 'direct_merge' | 'merge_queue' — The action that will be taken to merge the pull request. `direct_merge` merges the pull request directly without using a merge queue; `merge_queue` adds the pull request to a merge queue; `default` uses a merge queue if one is configured for the target branch, or merges directly otherwise. If omitted, defaults to `default`.

## Response `200`

if the pull request was already merged, or is already in a merge queue

- PullRequestMergeAsyncResult — Pull Request Merge Async Result
  - `status` 'pending' | 'merged' | 'enqueued' | 'failed', required
  - `details` union, required
    - object — When the asynchronous merge request is pending
      - `message` string, required
      - `uuid` string, required
      - `merge_method` 'default' | 'merge' | 'squash' | 'rebase', required
      - `merge_action` 'default' | 'merge_queue' | 'direct_merge', required
      - `expected_head_sha` string, required — SHA that the pull request head must match for the enqueued merge to proceed.
    - object — When the pull request is in a merge queue
      - `message` string, required
    - object — When the asynchronous merge request failed
      - `message` string, required
    - object — When the pull request has been merged
      - `message` string, required
      - `sha` string, required

## Other responses

- `202` — if the merge request was accepted and will run in the background
- `400` — if the pull request is not ready to be merged, e.g. because it is closed
- `403` — Forbidden
- `404` — Resource not found
- `409` — if there is an existing merge request already enqueued for this pull request
- `422` — Validation failed, or the endpoint has been spammed.

## Changes

- **2026-09-24** `f2faaeb373ce` — 8 info
  - added `subschema #1, subschema #2, subschema #3, subschema #4` to the `details` response property `anyOf` list for the response status `200`
  - added `subschema #1, subschema #2, subschema #3, subschema #4` to the `details` response property `anyOf` list for the response status `202`
  - added `subschema #1, subschema #2, subschema #3, subschema #4` to the `details` response property `anyOf` list for the response status `400`
  - added `subschema #1, subschema #2, subschema #3, subschema #4` to the `details` response property `anyOf` list for the response status `409`
  - …4 more
- **2026-08-04** `75a3615dcb15` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/github/apis/rest/changes/repos/:owner/:repo/pulls/:pull_number/merge-async/put.md)

---

[API](https://skmtc.dev/github/apis/rest.md) · [All operations](https://skmtc.dev/github/apis/rest/llms.txt) · [OpenAPI document](https://skmtc.dev/github/apis/rest/revisions/f2faaeb373ce?raw)
