> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# pulls_merge

> Merge a pull request. A pull request that cannot be merged fails with 405 rather than reporting it in the body. Pass `sha` to refuse the merge if the branch has moved since you looked.

<div className="tool-route"><span className="tool-row-method" data-method="PUT">PUT</span><code>{"https://api.github.com/repos/{owner}/{repo}/pulls/{pullNumber}/merge"}</code></div>

```python github_pulls_merge.py theme={null}
from charter.packs import github

result = await github.pulls_merge.ainvoke({"owner": ..., "repo": ..., "pullNumber": ...})
```

<Note>
  Requires `repo`, `read:user`.
</Note>

## Path parameters

<div className="reference-table">
  | Field                                                              | Type      | Description                                                                              |
  | ------------------------------------------------------------------ | --------- | ---------------------------------------------------------------------------------------- |
  | `owner` <span className="required" title="required">\*</span>      | `string`  | The account owner of the repository. The name is not case sensitive.                     |
  | `repo` <span className="required" title="required">\*</span>       | `string`  | The name of the repository without the `.git` extension. The name is not case sensitive. |
  | `pullNumber` <span className="required" title="required">\*</span> | `integer` | The number that identifies the pull request.                                             |
</div>

## Body

<div className="reference-table">
  | Field           | Type                                                           | Description                                                                                                                      |
  | --------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
  | `mergeMethod`   | [MergeMethod](/charter/charter/packs/github/pulls/objects#mergemethod) | How to merge. Absent, GitHub creates a merge commit. 'squash' collapses the branch into one commit, 'rebase' replays it.         |
  | `commitTitle`   | `string`                                                       | Title for the merge commit.                                                                                                      |
  | `commitMessage` | `string`                                                       | Extra detail for the merge commit.                                                                                               |
  | `sha`           | `string`                                                       | The head SHA this merge expects. If the branch has moved since, the merge is refused rather than merging work you have not seen. |
</div>
