REST API endpoints for user interactions

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

About user interactions

You can use the REST API to temporarily restrict which type of user can comment, open issues, or create pull requests on your public repositories. 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:

Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. To set different interaction limits for individual repositories owned by the user, use the Repository interactions endpoints instead.

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 your public repositories

GET /user/interaction-limits

Shows which type of GitHub user can interact with your public repositories and when the restriction expires.

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/interaction-limits

Response schema (Status: 200):

Set interaction restrictions for your public repositories

PUT /user/interaction-limits

Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user.

Parameters

Headers

Body parameters

HTTP response status codes

Code examples

Example

Request:

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

Response schema (Status: 200):

Remove interaction restrictions from your public repositories

DELETE /user/interaction-limits

Removes any interaction restrictions from your public repositories.

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/user/interaction-limits

Response schema (Status: 204):