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

API

Update an Origin Pull Request Comment via the API

Replace a comment's body with PATCH https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/pulls/comments/{commentId}. Official reference: Origin API → Update Pull Request Comment (OpenAPI OriginService_UpdatePullRequestComment). Changelog notes: August 24, 2026 (body length cap), August 29, 2026 (full thread on the response), 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:write. Availability: Early Beta per the API overview.

The comment must belong to the repository in the path, be visible to the caller, and have been authored by that caller. Cross-repository and hidden pending-review comments return 404; a visible comment owned by another actor returns 403. Bodies longer than 65,536 Unicode code points return InvalidArgument (HTTP 400). A 404 never distinguishes a missing comment from one your installation cannot reach.

Cost: 5 points against the principal budget (ordinary write).

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_…)

Request body

Field Required Meaning
body yes Replacement comment text; max 65,536 Unicode code points
curl --request PATCH \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/comments/cmt_01k2ja2000e0080000000000e5' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "body": "Should the retry budget be configurable?"
}'

Response

200 returns the updated PullRequestComment (same shape as Get): id, nested thread, 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"
}

Only body changes on this call — thread resolution uses Update Pull Request Thread. Base URL: https://api.cursor.com/v1/origin.