---
title: "Set the scopes for a pull request"
method: PUT
path: "/repos/{owner}/{repository}/pulls/{number}/scopes"
tags: ["pull_requests"]
---

# Set the scopes for a pull request

`PUT /repos/{owner}/{repository}/pulls/{number}/scopes`

Set the scopes for a pull request.

This addresses the scopes by pull request number alone, so the report cannot say
which revision it was computed for, and the last one to arrive wins whatever
head that was. Prefer `PUT /repos/{owner}/{repository}/commits/{sha}/scopes`,
which names the revision.

## Path parameters

- `number` integer, required — The pull request number
- `owner` string, required — The owner of the repository
- `repository` string, required — The name of the repository

## Request body

- ScopesBody
  - `scopes` string[], required
  - `all_scopes` boolean

## Response `204`

Successful Response

## Other responses

- `403` — Forbidden
- `404` — Not found
- `409` — Conflict
- `422` — Unprocessable entity

## Changes

- **2026-08-13** `29857c6146cf` — 3 info
  - the endpoint scheme security `CIApplicationKey` was added to the API
  - the endpoint scheme security `ApplicationAuth` was removed from the API
  - the endpoint scheme security `GitHubTokenBearerAuth` was removed from the API

[Change history](https://skmtc.dev/mergify/apis/mergify-api/changes/repos/:owner/:repository/pulls/:number/scopes/put.md)

---

[API](https://skmtc.dev/mergify/apis/mergify-api.md) · [All operations](https://skmtc.dev/mergify/apis/mergify-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mergify/mergify-api/revisions/d8cf048803ed/schema)
