API / update-origin-label-via-api

API

Update an Origin Label via the API

Change a label's name, color, or description with PATCH https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/labels/{labelName}. Address the label by its current name. Official reference: Origin API → Update Label (OpenAPI OriginService_UpdateLabel). Changelog entry: August 26, 2026.

Origin is in Early Beta and subject to change. Authenticate with an installation access token (oit_…) or a user access token that carries repository:labels:write. Availability: Early Beta per the API overview.

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
labelName yes Current label name; whitespace trimmed before lookup

Request body

Omitted fields stay unchanged.

Field Required Meaning
name no New name; max 50 characters after trim
color no Six-character hex without a leading #
description no Max 255 characters

Renaming to a name another label already uses returns AlreadyExists (HTTP 409 Conflict).

curl --request PATCH \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/labels/bug' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "defect",
  "color": "b60205",
  "description": "Confirmed defect"
}'

Response

200 returns the updated Label (id, name, color, description).

{
  "id": "lbl_01k2ja2000e0080000000000m1",
  "name": "defect",
  "color": "b60205",
  "description": "Confirmed defect"
}

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