
Remove an Origin Pull Request Label via the API
Remove one label from a pull request with DELETE https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/labels/{labelName}. Official reference: Origin API → Remove Pull Request Label (OpenAPI OriginService_RemovePullRequestLabel).
Origin is in Early Beta and subject to change. Authenticate with an installation access token (oit_…) or a user access token that carries repository:pull_requests:write. Availability: Early Beta per the API overview.
A label that is not assigned to the pull returns 404, as does an unknown or unreachable pull. A 404 never distinguishes a missing resource from one your installation cannot reach. Pull request number is a JSON string.
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 |
pullNumber |
yes | Pull request number within the repository (string on the wire) |
labelName |
yes | Name of the label to remove |
curl --request DELETE \
--url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/17/labels/bug' \
--header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'
Response
200 returns labels remaining on the pull request, ordered by name. Each entry carries id, name, color, and description.
{
"labels": [
{
"id": "lbl_01k2ja2000e0080000000000m1",
"name": "needs-review",
"color": "fbca04",
"description": "Needs a human pass"
}
]
}
To clear every label in one call, use Remove All Pull Request Labels or Set with an empty labels array. Base URL: https://api.cursor.com/v1/origin.