API / rerequest-origin-check-run-via-api

API

Rerequest an Origin Check Run via the API

Ask the app that reported a check run to run it again with POST https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/check-runs/{checkRunId}/rerequest. Official reference: Origin API → Checks / Rerequest Check Run (OpenAPI OriginService_RerequestCheckRun).

Origin is in Early Beta and subject to change. Authenticate with an installation access token (oit_…) or a user access token that carries repository:contents:write. Any principal with contents write may re-request a re-requestable run, whichever app reported it. Availability: Early Beta per the API overview.

Origin records the request on the run (rerequestedAt, and status becomes rerequested while conclusion and the timings still describe the superseded attempt) and notifies the owning app through the repository.check_run.rerequested webhook. The app answers by posting a fresh run for the same head SHA and key — a new run, or an update of this one — which clears rerequestedAt and stores the posted status.

The run must be completed, must have been declared re-requestable (isRerequestable), must be the current attempt for its key, and must belong to the current head of an open pull request; otherwise the call fails with FAILED_PRECONDITION. One re-request may be outstanding per run: while rerequestedAt is set, a repeat fails with ALREADY_EXISTS (HTTP 409); once the owning app has answered, the run may be re-requested again.

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
checkRunId yes Server-assigned check-run id (cr_…)

Request body

Send an empty JSON object. No fields are accepted.

curl --request POST \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-runs/cr_01k2ja2000e0080000000000g7/rerequest' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{}'

Response

The body is the updated CheckRun with status rerequested, rerequestedAt set, and rerequestedBy naming the caller. conclusion still reflects the superseded attempt until the owning app posts a fresh result.

Example shape from the OpenAPI:

{
  "id": "cr_01k2ja2000e0080000000000g7",
  "repository": {
    "id": "repo_01k2ja2000e0080000000000q4",
    "name": "rocket",
    "owner": {
      "slug": "acme",
      "id": "ns_01k2ja2000e0080000000000p3",
      "type": "team"
    }
  },
  "checkSuite": {
    "id": "crg_01k2ja2000e0080000000000h8"
  },
  "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4",
  "key": "ci-8842-unit-tests",
  "name": "unit-tests",
  "status": "rerequested",
  "conclusion": "failure",
  "detailsUrl": "https://ci.acme.dev/runs/8842",
  "externalUpdatedAt": "2026-08-02T14:44:30Z",
  "startedAt": "2026-08-02T14:40:00Z",
  "completedAt": "2026-08-02T14:44:30Z",
  "createdAt": "2026-08-01T09:30:00Z",
  "updatedAt": "2026-08-02T15:02:10Z",
  "externalId": "run-8842",
  "actor": {
    "app": {
      "id": "app_01k2ja2000e0080000000000a1",
      "displayName": "Acme CI"
    }
  },
  "output": {
    "title": "Unit tests",
    "summary": "3 of 128 tests failed."
  },
  "isRerequestable": true,
  "rerequestedAt": "2026-08-02T15:02:10Z",
  "rerequestedBy": {
    "user": {
      "id": "user_01k2ja2000e0080000000000c3",
      "email": "jane@acme.dev"
    }
  }
}

Set isRerequestable: true when you upsert the run if your app will answer repository.check_run.rerequested; without that declaration this endpoint fails with FAILED_PRECONDITION.

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