API / get-origin-pull-request-via-api

API

Get an Origin Pull Request via the API

Read one pull request with GET https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}. Official reference: Origin API → Get Pull Request (OpenAPI OriginService_GetPullRequest). Changelog notes that affect the response: August 20, 2026 (assigned labels) and September 1, 2026 (default-valued fields always present).

Origin is in Early Beta and subject to change. Authenticate with an installation access token (oit_…) or a user access token that carries repository:pull_requests:read. Availability: Early Beta per the API overview.

The response includes assigned labels. Pull request number is a JSON string (protobuf 64-bit encoding).

Cost: 1 point against the principal budget (ordinary read).

Path parameters

Param Required Meaning
ownerSlug yes Owning entity's unique slug
repoName yes Repo name, unique to the owner
pullNumber yes Pull request number within the repository (string on the wire)

A missing or unreachable pull request returns 404. A 404 never distinguishes a missing pull from one your installation cannot reach.

curl --request GET \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/17' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'

Response

200 returns a single PullRequest: id, number (string), state, draft, merged, title, body, head / base refs, author, timestamps, line stats, labels, and latest version.

{
  "id": "pr_01k2ja2000e0080000000000d4",
  "number": "17",
  "state": "open",
  "draft": false,
  "merged": false,
  "title": "Add launch telemetry",
  "body": "Adds structured launch telemetry to the ignition path.",
  "head": {
    "ref": "add-telemetry",
    "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4"
  },
  "base": {
    "ref": "main",
    "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8"
  },
  "author": {
    "user": {
      "id": "user_01k2ja2000e0080000000000c3",
      "email": "jane@acme.dev"
    }
  },
  "createdAt": "2026-08-01T09:30:00Z",
  "updatedAt": "2026-08-02T14:45:00Z",
  "additions": 128,
  "deletions": 46,
  "changedFiles": 5,
  "labels": [
    {
      "id": "lbl_01k2ja2000e0080000000000m1",
      "name": "bug",
      "color": "d73a4a",
      "description": "Something isn't working"
    }
  ],
  "version": {
    "number": "3",
    "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4",
    "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8",
    "createdAt": "2026-08-01T09:30:00Z"
  }
}

Parse number as a string. state is "open" or "closed" (a draft is open; merged pulls are closed with merged: true). List every open pull with List Pull Requests when you need filters or pagination.

Base URL: https://api.cursor.com/v1/origin.