# dev.gitosphere.repository.mergePullRequest

> Published by [gitosphere-lex.bsky.social](https://lexicon.garden/identity/did:plc:iz47txlteeb2ojtp5ygiqet6)

✓ This is the authoritative definition for this NSID.

## Description

Merges one reviewed native Pull Request through the server-authoritative Git transaction boundary.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:iz47txlteeb2ojtp5ygiqet6/dev.gitosphere.repository.mergePullRequest)
- [Documentation](https://lexicon.garden/lexicon/did:plc:iz47txlteeb2ojtp5ygiqet6/dev.gitosphere.repository.mergePullRequest/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:iz47txlteeb2ojtp5ygiqet6/dev.gitosphere.repository.mergePullRequest/examples)

## Definitions

### `dev.gitosphere.repository.mergePullRequest`

**Type**: `procedure`

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `dryRun` | `boolean` | No |  |
| `idempotencyKey` | `ref` → `dev.gitosphere.defs#idempotencyKey` | Yes |  |
| `matchHeadCommit` | `string` | Yes |  |
| `number` | `integer` | Yes |  |
| `realmId` | `ref` → `dev.gitosphere.defs#realmId` | Yes |  |
| `repositoryId` | `ref` → `dev.gitosphere.defs#repositoryId` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `baseCommit` | `string` | Yes |  |
| `dryRun` | `boolean` | Yes |  |
| `headCommit` | `string` | Yes |  |
| `idempotency` | `ref` → `dev.gitosphere.defs#idempotencyResult` | Yes |  |
| `issueCloseResults` | `array` | No |  |
| `issueCloseVersion` | `integer` | No |  |
| `mergeCommit` | `string` | No |  |
| `pullRequest` | `ref` → `dev.gitosphere.defs#pullRequestView` | Yes |  |

#### Errors

- **QuotaExceeded**: The operation was rejected because it exceeds a usage limit.
- **InvalidRequest**
- **ValidationFailed**
- **AuthenticationRequired**
- **AccessDenied**
- **ResourceNotFound**
- **Conflict**
- **IdempotencyConflict**
- **DependencyUnavailable**
- **InvitationRequired**: An invitation is required to use this service.
- **AccountSuspended**: Service access for this DID is suspended.
- **ServicePaused**: An administrator has paused new requests for this target.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "errors": [
        {
          "description": "The operation was rejected because it exceeds a usage limit.",
          "name": "QuotaExceeded"
        },
        {
          "name": "InvalidRequest"
        },
        {
          "name": "ValidationFailed"
        },
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AccessDenied"
        },
        {
          "name": "ResourceNotFound"
        },
        {
          "name": "Conflict"
        },
        {
          "name": "IdempotencyConflict"
        },
        {
          "name": "DependencyUnavailable"
        },
        {
          "description": "An invitation is required to use this service.",
          "name": "InvitationRequired"
        },
        {
          "description": "Service access for this DID is suspended.",
          "name": "AccountSuspended"
        },
        {
          "description": "An administrator has paused new requests for this target.",
          "name": "ServicePaused"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "dryRun": {
              "type": "boolean"
            },
            "idempotencyKey": {
              "ref": "dev.gitosphere.defs#idempotencyKey",
              "type": "ref"
            },
            "matchHeadCommit": {
              "maxLength": 64,
              "minLength": 40,
              "type": "string"
            },
            "number": {
              "maximum": 9007199254740991,
              "minimum": 1,
              "type": "integer"
            },
            "realmId": {
              "ref": "dev.gitosphere.defs#realmId",
              "type": "ref"
            },
            "repositoryId": {
              "ref": "dev.gitosphere.defs#repositoryId",
              "type": "ref"
            }
          },
          "required": [
            "realmId",
            "repositoryId",
            "number",
            "matchHeadCommit",
            "idempotencyKey"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "baseCommit": {
              "maxLength": 64,
              "minLength": 40,
              "type": "string"
            },
            "dryRun": {
              "type": "boolean"
            },
            "headCommit": {
              "maxLength": 64,
              "minLength": 40,
              "type": "string"
            },
            "idempotency": {
              "ref": "dev.gitosphere.defs#idempotencyResult",
              "type": "ref"
            },
            "issueCloseResults": {
              "items": {
                "ref": "dev.gitosphere.defs#pullRequestIssueCloseResult",
                "type": "ref"
              },
              "type": "array"
            },
            "issueCloseVersion": {
              "maximum": 1,
              "minimum": 0,
              "type": "integer"
            },
            "mergeCommit": {
              "maxLength": 64,
              "minLength": 40,
              "type": "string"
            },
            "pullRequest": {
              "ref": "dev.gitosphere.defs#pullRequestView",
              "type": "ref"
            }
          },
          "required": [
            "pullRequest",
            "baseCommit",
            "headCommit",
            "idempotency",
            "dryRun"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Merges one reviewed native Pull Request through the server-authoritative Git transaction boundary.",
  "id": "dev.gitosphere.repository.mergePullRequest",
  "lexicon": 1
}
```
