API / create-origin-label-via-api

API

Create an Origin Label via the API

Define a repository label with POST https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/labels. Official reference: Origin API → Create Label (OpenAPI OriginService_CreateLabel). 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. Requesting :write also grants repository:labels:read. 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

Request body

Field Required Meaning
name yes Label name; leading/trailing whitespace trimmed; max 50 characters
color yes Six-character hex without a leading #
description no Optional text; max 255 characters

A name another label on the repository already uses returns AlreadyExists (HTTP 409 Conflict).

curl --request POST \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/labels' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "bug",
  "color": "d73a4a",
  "description": "Something isn'\''t working"
}'

Response

200 returns the created Label: id (lbl_…), name, color, and description.

{
  "id": "lbl_01k2ja2000e0080000000000m1",
  "name": "bug",
  "color": "d73a4a",
  "description": "Something isn't working"
}

Assign labels to pull requests with the pull-request label endpoints (repository:pull_requests:write). Base URL: https://api.cursor.com/v1/origin.