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

API

Get an Origin Pull Request Comment via the API

Fetch one comment by stable id with GET https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/pulls/comments/{commentId}. Official reference: Origin API → Get Pull Request Comment (OpenAPI OriginService_GetPullRequestComment). Changelog notes: August 29, 2026 (full thread object on each comment), September 16, 2026 (OpenAPI schema renamed ThreadCommentThread; wire JSON unchanged).

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:reviews:read. Availability: Early Beta per the API overview.

The path addresses the comment by commentId under the repository — there is no pullNumber in this path. A comment outside the authorized repository, or a pending-review comment not visible to the caller, returns 404. A 404 never distinguishes a missing comment from one your installation cannot reach.

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
commentId yes Stable Origin comment id (e.g. cmt_…)
curl --request GET \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/comments/cmt_01k2ja2000e0080000000000e5' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'

Response

200 returns a PullRequestComment: id, nested thread (id, filed-against version, diff anchor, resolvedAt, thread timestamps), body, author, createdAt, updatedAt.

{
  "id": "cmt_01k2ja2000e0080000000000e5",
  "thread": {
    "id": "cth_01k2ja2000e0080000000000s6",
    "version": {
      "number": "3",
      "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4",
      "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8",
      "createdAt": "2026-08-01T09:30:00Z"
    },
    "path": "src/telemetry/retry.ts",
    "side": "right",
    "startLine": 42,
    "endLine": 45,
    "createdAt": "2026-08-01T09:30:00Z",
    "updatedAt": "2026-08-02T14:45:00Z"
  },
  "body": "Should the retry budget be configurable?",
  "author": {
    "user": {
      "id": "user_01k2ja2000e0080000000000c3",
      "email": "jane@acme.dev"
    }
  },
  "createdAt": "2026-08-01T09:30:00Z",
  "updatedAt": "2026-08-02T14:45:00Z"
}

thread.path is empty on general-discussion threads; resolvedAt is unset while the thread is open; startLine / endLine are 0 for file-level and general-discussion threads. Group comments by thread.id. Update the body with Update Pull Request Comment; resolve or reopen with Update Pull Request Thread.

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