API / create-origin-check-run-annotations-via-api

API

Create Origin Check Run Annotations via the API

Append annotations to an existing check run with POST https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/check-runs/{checkRunId}/annotations. Official reference: Origin API → Checks / Create Check Run Annotations (OpenAPI OriginService_CreateCheckRunAnnotations).

Origin is in Early Beta and subject to change. Authenticate with an installation access token (oit_…) that carries repository:checks:write. The write is attributed to the app that owns the authenticated installation. Availability: Early Beta per the API overview.

Each request atomically appends 1–25 annotations when the run's durable total would stay at or below 100. The operation is not request-idempotent: retrying after an ambiguous transport failure may append duplicates and consume capacity. Identical content is allowed. location is optional; omit it for a run-level note, and when present supply a coherent path and line range.

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

Field Required Meaning
annotations yes Array of 1–25 annotation inputs
annotations[].annotationLevel yes notice, warning, or failure
annotations[].message yes Non-empty message (max 65,535 UTF-8 bytes)
annotations[].title no Optional title (max 255 Unicode characters)
annotations[].rawDetails no Optional raw detail text (max 65,535 UTF-8 bytes)
annotations[].location no Optional source location
annotations[].location.path when location set Repository-relative path (max 4,096 UTF-8 bytes)
annotations[].location.startLine / endLine when location set Positive 1-based inclusive line numbers
annotations[].location.columns no Optional startColumn / endColumn for a single-line range only
curl --request POST \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-runs/cr_01k2ja2000e0080000000000g7/annotations' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "annotations": [
    {
      "annotationLevel": "warning",
      "message": "Deprecated API usage; migrate to the v2 client.",
      "title": "Deprecated API",
      "location": {
        "path": "src/telemetry.ts",
        "startLine": 42,
        "endLine": 42
      }
    }
  ]
}'

Response

The body returns the persisted annotations (ids prefixed cra_…), including checkRunId, level, message, title, timestamps, and location when supplied.

Example shape from the OpenAPI:

{
  "annotations": [
    {
      "id": "cra_01k2ja2000e0080000000000v1",
      "checkRunId": "cr_01k2ja2000e0080000000000g7",
      "annotationLevel": "warning",
      "message": "Deprecated API usage; migrate to the v2 client.",
      "title": "Deprecated API",
      "createdAt": "2026-08-02T14:45:00Z",
      "updatedAt": "2026-08-02T14:45:00Z",
      "location": {
        "path": "src/telemetry.ts",
        "startLine": 42,
        "endLine": 42
      }
    }
  ]
}

Upsert the check run first so you have a cr_… id, then append annotations in batches of at most 25 until you hit the 100-annotation ceiling.

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