API / remove-origin-pull-request-requested-reviewers-via-api

API

Remove Origin Pull Request Requested Reviewers via the API

Remove requested reviews from users and groups on a pull request with DELETE https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/requested_reviewers. Official reference: Origin API → Remove Pull Request Requested Reviewers (OpenAPI OriginService_RemovePullRequestRequestedReviewers).

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

Identifiers resolve against the repository's reviewer candidates by public id, user email, or group slug. Display names do not resolve. An unknown or ambiguous identifier returns InvalidArgument (HTTP 400) naming the identifier. At least one non-empty entry is required across users and groups. Removing a user or group that is not currently requested is a no-op. An identifier that is no longer a reviewer candidate is still accepted when it is a stable public id (user_… or grp_…), so a reviewer who left the repository can be cleared. Pull request number is a JSON string. An unknown or unreachable pull returns 404. A 404 never distinguishes a missing pull from one your installation cannot reach.

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)

Request body

Field Required Meaning
users no User identifiers (user_… id or email) to remove
groups no Group identifiers (grp_… id, qualified group slug, or group slug) to remove

At least one of users or groups must contain a non-empty entry.

curl --request DELETE \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/17/requested_reviewers' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "users": [
    "user_01k2ja2000e0080000000000c3"
  ],
  "groups": [
    "grp_01k2ja2000e0080000000000n2"
  ]
}'

Response

Successful requests return 204 No Content with an empty body.

204 No Content

Confirm the pending set with List Pull Request Requested Reviewers. Base URL: https://api.cursor.com/v1/origin.