{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-devops/json-schema/microsoft-azure-devops-git-pull-request-schema.json",
  "title": "GitPullRequest",
  "description": "An Azure DevOps Git pull request",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-devops-pull-requests-api-openapi.yml#/components/schemas/GitPullRequest",
  "type": "object",
  "properties": {
    "pullRequestId": {
      "type": "integer",
      "description": "Unique numeric ID of the pull request"
    },
    "title": {
      "type": "string",
      "description": "Title of the pull request"
    },
    "description": {
      "type": "string",
      "description": "Description of the changes in this pull request"
    },
    "status": {
      "type": "string",
      "description": "Current status of the pull request",
      "enum": [
        "notSet",
        "active",
        "abandoned",
        "completed",
        "all"
      ]
    },
    "createdBy": {
      "$ref": "#/$defs/IdentityRef"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time the pull request was created"
    },
    "closedDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time the pull request was completed or abandoned"
    },
    "targetRefName": {
      "type": "string",
      "description": "Target branch for the merge"
    },
    "sourceRefName": {
      "type": "string",
      "description": "Source branch containing the changes"
    },
    "mergeId": {
      "type": "string",
      "format": "uuid",
      "description": "ID of the merge operation"
    },
    "mergeStatus": {
      "type": "string",
      "description": "Current merge status",
      "enum": [
        "notSet",
        "queued",
        "conflicts",
        "succeeded",
        "rejectedByPolicy",
        "failure"
      ]
    },
    "lastMergeSourceCommit": {
      "type": "object",
      "description": "Latest commit in the source branch",
      "properties": {
        "commitId": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "lastMergeTargetCommit": {
      "type": "object",
      "description": "Latest commit in the target branch",
      "properties": {
        "commitId": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "lastMergeCommit": {
      "type": "object",
      "description": "The merge commit (if the PR has been merged)",
      "properties": {
        "commitId": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "reviewers": {
      "type": "array",
      "description": "Reviewers assigned to this pull request",
      "items": {
        "$ref": "#/$defs/IdentityRefWithVote"
      }
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "repository": {
      "$ref": "#/$defs/GitRepository"
    },
    "isDraft": {
      "type": "boolean",
      "description": "Whether this is a draft pull request"
    },
    "autoCompleteSetBy": {
      "$ref": "#/$defs/IdentityRef"
    },
    "completionOptions": {
      "type": "object",
      "description": "Options for auto-completing the PR",
      "properties": {
        "deleteSourceBranch": {
          "type": "boolean"
        },
        "squashMerge": {
          "type": "boolean"
        },
        "mergeStrategy": {
          "type": "string",
          "enum": [
            "noFastForward",
            "squash",
            "rebase",
            "rebaseMerge"
          ]
        },
        "transitionWorkItems": {
          "type": "boolean"
        }
      }
    },
    "workItemRefs": {
      "type": "array",
      "description": "Work items associated with this pull request",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "labels": {
      "type": "array",
      "description": "Labels attached to this pull request",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        }
      }
    },
    "_links": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  },
  "$defs": {
    "GitRepository": {
      "type": "object",
      "description": "An Azure DevOps Git repository",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique GUID identifier of the repository"
        },
        "name": {
          "type": "string",
          "description": "Repository name"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "REST API URL for this repository"
        },
        "project": {
          "$ref": "#/$defs/TeamProjectReference"
        },
        "defaultBranch": {
          "type": "string",
          "description": "Default branch of the repository"
        },
        "size": {
          "type": "integer",
          "description": "Size of the repository in bytes"
        },
        "remoteUrl": {
          "type": "string",
          "format": "uri",
          "description": "Remote URL for cloning (HTTPS)"
        },
        "sshUrl": {
          "type": "string",
          "description": "SSH URL for cloning"
        },
        "webUrl": {
          "type": "string",
          "format": "uri",
          "description": "Web browser URL for the repository"
        },
        "parentRepository": {
          "type": [
            "object",
            "null"
          ],
          "description": "Parent repository (if this is a fork)",
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "isFork": {
          "type": "boolean",
          "description": "Whether this repository is a fork of another"
        },
        "isDisabled": {
          "type": "boolean",
          "description": "Whether this repository is disabled"
        },
        "_links": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "href": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    },
    "IdentityRef": {
      "type": "object",
      "description": "Reference to an Azure DevOps user identity",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "displayName": {
          "type": "string"
        },
        "uniqueName": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "descriptor": {
          "type": "string"
        }
      }
    },
    "IdentityRefWithVote": {
      "type": "object",
      "description": "A reviewer identity with their vote on a pull request",
      "allOf": [
        {
          "$ref": "#/$defs/IdentityRef"
        }
      ],
      "properties": {
        "vote": {
          "type": "integer",
          "description": "Vote value: 10 = approved, 5 = approved with suggestions, 0 = no vote, -5 = waiting for author, -10 = rejected\n",
          "enum": [
            10,
            5,
            0,
            -5,
            -10
          ]
        },
        "hasDeclined": {
          "type": "boolean",
          "description": "Whether the reviewer has declined"
        },
        "isFlagged": {
          "type": "boolean",
          "description": "Whether the reviewer has flagged the PR"
        },
        "isRequired": {
          "type": "boolean",
          "description": "Whether this reviewer's approval is required"
        },
        "reviewerUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "TeamProjectReference": {
      "type": "object",
      "description": "Reference to an Azure DevOps project",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "state": {
          "type": "string",
          "enum": [
            "deleting",
            "new",
            "wellFormed",
            "createPending",
            "all",
            "unchanged",
            "deleted"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "private",
            "public"
          ]
        },
        "revision": {
          "type": "integer"
        }
      }
    }
  }
}