REST API endpoints for repository interactions

Use the REST API to temporarily restrict which type of user can comment, open issues, or create pull requests in a public repository.

About repository interactions

People with owner or admin access can use the REST API to temporarily restrict which type of user can comment, open issues, or create pull requests in a public repository. When restrictions are enabled, only the specified type of GitHub user will be able to participate in interactions. Restrictions automatically expire after a defined duration. Here's more about the types of GitHub users:

If an interaction limit is enabled for the user or organization that owns the repository, the limit cannot be changed for the individual repository. Instead, use the User or Organization interactions endpoints to change the interaction limit.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

Get interaction restrictions for a repository

GET /repos/{owner}/{repo}/interaction-limits

Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/interaction-limits

Response schema (Status: 200):

Set interaction restrictions for a repository

PUT /repos/{owner}/{repo}/interaction-limits

Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a 409 Conflict response and will not be able to use this endpoint to change the interaction limit for a single repository.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example request body

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/interaction-limits \
  -d '{
  "limit": "collaborators_only",
  "expiry": "one_day"
}'

Response schema (Status: 200):

Remove interaction restrictions for a repository

DELETE /repos/{owner}/{repo}/interaction-limits

Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a 409 Conflict response and will not be able to use this endpoint to change the interaction limit for a single repository.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/interaction-limits

Response schema (Status: 204):

Get pull request creation cap bypass list for a repository

GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list

Lists the users that are on the pull request creation cap bypass list for a
repository. Users on this list can create pull requests regardless of any
configured pull request creation cap.
Only users with maintainer permissions can view the bypass list.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list

Response schema (Status: 200):

Array of Simple User:

Add users to the pull request creation cap bypass list for a repository

PUT /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list

Adds users to the pull request creation cap bypass list for a repository.
Users on this list can create pull requests regardless of any configured
pull request creation cap.
Only users with maintainer permissions can modify the bypass list.
You can add a maximum of 100 users per request.
The bypass list can only hold a maximum of 100 users.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example request body

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list \
  -d '{
  "users": [
    "octocat",
    "monalisa"
  ]
}'

Response schema (Status: 204):

Remove users from the pull request creation cap bypass list for a repository

DELETE /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list

Removes users from the pull request creation cap bypass list for a repository.
Removed users will be subject to any configured pull request creation cap.
Only users with maintainer permissions can modify the bypass list.
You can remove a maximum of 100 users per request.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example request body

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list \
  -d '{
  "users": [
    "octocat"
  ]
}'

Response schema (Status: 204):

Get pull request creation cap for a repository

GET /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap

Gets the pull request creation cap configuration for a repository.
The cap limits the number of open pull requests a user can have at one time.
Only users with admin access to the repository can view the cap configuration.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/creation-cap

Response schema (Status: 200):

Update pull request creation cap for a repository

PATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap

Updates the pull request creation cap for a repository. The cap limits the number
of open pull requests a user can have at one time.
Only users with admin access to the repository can configure the cap.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example request body

Request:

curl -L \
  -X PATCH \
  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/creation-cap \
  -d '{
  "enabled": true,
  "max_open_pull_requests": 1,
  "include_drafts": true
}'

Response schema (Status: 200):

Same response schema as Get pull request creation cap for a repository.