API / create-origin-pull-request-review-via-api

API

Create an Origin Pull Request Review via the API

Create and submit a review on a pull request with POST https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/reviews. Official reference: Origin API → Create Pull Request Review (OpenAPI OriginService_CreatePullRequestReview).

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 review is submitted immediately. Optionally attach up to 50 comments in the same request; each comment uses the same targets Create Pull Request Comment takes (inline, file, threadId, or none for general discussion). When comments is set, every anchor is validated against the reviewed version's diff before anything is written. If one comment fails, the whole request fails with InvalidArgument (HTTP 400) and nothing is published. Comments become visible atomically with the review.

A new approve or request_changes review supersedes the caller's prior live decision review on the same pull request (that prior review is dismissed). Pull request authors cannot approve their own pull request. The call fails with FAILED_PRECONDITION while the caller has an unsubmitted draft review on the pull request. There is no idempotency key — call List Pull Request Reviews before retrying after an ambiguous transport failure. Pull request number is a JSON string. An unknown or unreachable pull returns 404. A 404 never distinguishes a missing pull 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
pullNumber yes Pull request number within the repository (string on the wire)

Request body

Field Required Meaning
verdict yes approve, request_changes, or comment (also accepts PULL_REQUEST_REVIEW_VERDICT_UNSPECIFIED)
body no Free-text review summary; may be empty
versionNumber no Pull request version number to review. Omit to review the latest version at call time. Comments anchor against this same version
comments no Comments published atomically with the review. Maximum 50

Comment entry (comments[])

Field Required Meaning
body yes Comment text; must contain a non-whitespace character
inline no Diff anchor (path, side, startLine, optional endLine). Cannot combine with threadId
file no Whole-file anchor (path). Cannot combine with inline or threadId
threadId no Existing thread id to reply to. Omit inline, file, and this field for a new general-discussion thread
curl --request POST \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/17/reviews' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "verdict": "approve",
  "body": "Approving. The telemetry schema matches the spec.",
  "versionNumber": "3"
}'

Response

200 returns the submitted review: id, author, verdict, body, submittedAt, and pullRequestVersion.

{
  "id": "rev_01k2ja2000e0080000000000f6",
  "author": {
    "user": {
      "id": "user_01k2ja2000e0080000000000c3",
      "email": "jane@acme.dev"
    }
  },
  "verdict": "approve",
  "body": "Approving. The telemetry schema matches the spec.",
  "submittedAt": "2026-08-02T15:00:00Z",
  "pullRequestVersion": {
    "number": "3",
    "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4",
    "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8",
    "createdAt": "2026-08-01T09:30:00Z"
  }
}

Update the body with Update Pull Request Review, or clear the verdict from review state with Dismiss Pull Request Review. Base URL: https://api.cursor.com/v1/origin.