# Get a pull request

> A pull request's status, head commit, comments and reviews, the issue it is for, the latest run of that issue's acceptance checks with each command's output, whether it is behind the branch it would merge into, and overlaps: other pull requests in progress that change the same files.

<div class="g1t-endpoint"><span class="g1t-method" data-method="get">GET</span><code>/repos/{owner}/{name}/pulls/{number}</code></div>

An overlap with a pull request for a different issue means the two will conflict; say so, or keep clear of those files.

| Field | |
| --- | --- |
| `pull.files` | The files it changes, with lines added and removed. |
| `checks` | The latest run of the acceptance checks against its head, with each command's output. |
| `overlaps` | Other pull requests in progress that change the same files. |
| `behind` | Whether the default branch has moved since it was made. |
| `landing` | Whether it is being brought up to date to land. |
| `lifecycle` | For a pull request the g1t agent is seeing through: its stage, such as `working`, `checking`, `reviewing` or `needs_you`. |
| `comments` | Comments, reviews and events, with `path`, `line` and `verdict`. |
| `messages` | Messages sent to the agent working on it. |
| `statuses` | Commit statuses reported for its head, such as workflow runs. |
| `mergeable` | Whether it merges cleanly into its target: `clean`, `conflicting`, `checking` (being worked out) or `unknown`. Worked out ahead of time whenever it or its target moves. |
| `conflicts` | When `mergeable` is `conflicting`, the files that conflict. Resolve them by merging the target in, or have the g1t agent do it. |
| `earlierChecks` | Earlier runs of the acceptance checks, newest first, without their output. |

Checks are started by g1t, not through the API. They run when a pull request becomes ready for review and again when its head moves.

- **Authentication:** Optional. Public data can be read without a token; send one to see what is private.
- **MCP tool:** [`pull_request`](/reference/mcp/#pull_request) with `action` `get`, and the same inputs
- **Scope:** An access token needs [`pull_requests:read`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner` | string | Yes | The workspace that owns the repository. |
| `name` | string | Yes | The repository's name. |
| `number` | integer | Yes | The number shown after the #. Issues and pull requests share one sequence. |

## Example request

```sh
curl https://api.g1t.sh/repos/flagon-io/hello/pulls/14 \
  -H "Authorization: Bearer $G1T_TOKEN"
```

## Example response

A successful request answers `200` with:

```json
{
  "pull": {
    "id": "pr_01m43smh3vexsr5pmp60qwv0vs",
    "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr",
    "number": 14,
    "issue": 12,
    "title": "Greeting should name the caller",
    "body": "Reads a name from the first argument. `hello ana` prints \"Hello, ana!\".",
    "agent": "claude-code",
    "runtime": "external",
    "status": "open",
    "fork": {
      "namespace": "pulls",
      "name": "pr_01m43smh3vexsr5pmp60qwv0vs"
    },
    "fork_repo_id": "rep_01m43smh5xd7aw2kq9tv0b4c8e",
    "branch": null,
    "head_commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13",
    "merge_base": null,
    "merged_by": null,
    "merged_at": null,
    "superseded_by": null,
    "check_status": "passed",
    "files": [
      {
        "path": "src/main.rs",
        "additions": 6,
        "deletions": 2
      }
    ],
    "assignees": [],
    "reviewers": [
      "ana"
    ],
    "author": {
      "id": "usr_01kkntcg1eeb98j62xjm7eh09p",
      "username": "syntaqx",
      "kind": "user",
      "verified": false,
      "workspaces": []
    },
    "created_at": "2026-10-01T18:20:02.117Z",
    "updated_at": "2026-10-01T18:35:44.902Z",
    "confidence": null
  },
  "issue": {
    "id": "iss_01m43shrzpfe49x74ga7sj1c6v",
    "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr",
    "number": 12,
    "title": "Greeting should name the caller",
    "body": "Take a name from the first argument; fall back to world.",
    "labels": [
      "feature"
    ],
    "checks": [
      "cargo test"
    ],
    "state": "open",
    "reason": null,
    "resolved_by": null,
    "author": {
      "id": "usr_01kkntcg1eeb98j62xjm7eh09p",
      "username": "syntaqx",
      "kind": "user",
      "verified": false,
      "workspaces": []
    },
    "created_at": "2026-10-01T18:04:11.482Z",
    "updated_at": "2026-10-01T18:20:02.117Z",
    "closed_at": null,
    "pull_count": 1,
    "comment_count": 0,
    "assignees": [],
    "blocked_by": [],
    "queued": false,
    "agent": "claude-code"
  },
  "comments": [
    {
      "id": "cmt_01m43st6d0f4h8k2n6r0v4z8c2",
      "kind": "event",
      "author": {
        "id": "usr_01kkntcg1eeb98j62xjm7eh09p",
        "username": "syntaqx",
        "kind": "user",
        "verified": false,
        "workspaces": []
      },
      "body": "marked this ready for review",
      "path": null,
      "line": null,
      "verdict": null,
      "created_at": "2026-10-01T18:33:10.420Z"
    }
  ],
  "checks": {
    "id": "chk_01m43sw8e2g6j0m4q8t2x6a0c4",
    "head_commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13",
    "status": "passed",
    "results": [
      {
        "command": "cargo test",
        "passed": true,
        "exit_code": 0,
        "output": "test result: ok. 3 passed; 0 failed",
        "duration_ms": 18234
      }
    ],
    "error": null,
    "created_at": "2026-10-01T18:33:11.002Z",
    "finished_at": "2026-10-01T18:35:44.902Z"
  },
  "overlaps": [],
  "behind": false,
  "review_pending": false,
  "lifecycle": null,
  "landing": false,
  "stalled": null,
  "messages": [
    {
      "id": "msg_01m43tx5egeh4t3f9zcnjenqvz",
      "author": "syntaqx",
      "body": "Keep \"world\" as the default when no name is given.",
      "created_at": "2026-10-01T18:25:00.310Z",
      "delivered_at": "2026-10-01T18:25:31.007Z",
      "kind": "message",
      "from_number": null,
      "to_number": 14,
      "answer": null,
      "declined": false
    }
  ],
  "statuses": []
}
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
