API / list-origin-labels-via-api

API

List Origin Labels via the API

List repository label definitions with GET https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/labels. Official reference: Origin API → List Labels (OpenAPI OriginService_ListLabels).

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:read. Availability: Early Beta per the API overview.

Labels are ordered by name. Default pageSize is 30; maximum is 100.

Cost: 1 point against the principal budget (ordinary read).

Path parameters

Param Required Meaning
ownerSlug yes Owning entity's unique slug
repoName yes Repo name, unique to the owner

Query parameters

Param Required Meaning
pageSize no Max labels (default 30, max 100)
pageToken no Opaque cursor from a previous nextPageToken
curl --request GET \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/labels?pageSize=30' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'

Response

The body carries labels and an optional nextPageToken (empty when no next page). Each label includes id (lbl_…), name, color (six-character hex without a leading #), and description.

Example shape from the OpenAPI:

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

Treat page tokens as opaque. Assigned labels also appear on each pull request from List Pull Requests.

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