{"meta":{"title":"REST API endpoints for user interactions","intro":"Use the REST API to temporarily restrict which type of user can comment, open issues, or create pull requests in your public repositories.","product":"REST API","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/en/enterprise-cloud@latest/rest/interactions","title":"Interactions"},{"href":"/en/enterprise-cloud@latest/rest/interactions/user","title":"User"}],"documentType":"article"},"body":"# REST API endpoints for user interactions\n\nUse the REST API to temporarily restrict which type of user can comment, open issues, or create pull requests in your public repositories.\n\n## About user interactions\n\nYou 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:\n\n* **Existing users:** When you limit interactions to `existing_users`, new users with accounts less than 24 hours old who have not previously contributed and are not collaborators will be temporarily restricted from interacting with your repositories.\n* **Contributors only:** When you limit interactions to `contributors_only`, users who have not previously contributed and are not collaborators will be temporarily restricted from interacting with your repositories.\n* **Collaborators only:** When you limit interactions to `collaborators_only`, users who are not collaborators will be temporarily restricted from interacting with your repositories.\n\nSetting 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](/en/enterprise-cloud@latest/rest/interactions/repos) interactions endpoints instead.\n\n> \\[!NOTE]\n> 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.\n\n## Get interaction restrictions for your public repositories\n\n```\nGET /user/interaction-limits\n```\n\nShows which type of GitHub user can interact with your public repositories and when the restriction expires.\n\n### HTTP response status codes\n\n* **200** - Default response\n\n* **204** - Response when there are no restrictions\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/user/interaction-limits\n```\n\n**Response schema (Status: 200):**\n\n* any of:\n  * **Interaction Limits**\n    * `limit`: required, string, enum: `existing_users`, `contributors_only`, `collaborators_only`\n    * `origin`: required, string\n    * `expires_at`: required, string, format: date-time\n  * **object**\n\n## Set interaction restrictions for your public repositories\n\n```\nPUT /user/interaction-limits\n```\n\nTemporarily 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Body parameters\n\n* **`limit`** (string) (required)\n  The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect.\n  Can be one of: `existing_users`, `contributors_only`, `collaborators_only`\n\n* **`expiry`** (string)\n  The duration of the interaction restriction. Default: one\\_day.\n  Can be one of: `one_day`, `three_days`, `one_week`, `one_month`, `six_months`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/user/interaction-limits \\\n  -d '{\n  \"limit\": \"collaborators_only\",\n  \"expiry\": \"one_month\"\n}'\n```\n\n**Response schema (Status: 200):**\n\n* `limit`: required, string, enum: `existing_users`, `contributors_only`, `collaborators_only`\n* `origin`: required, string\n* `expires_at`: required, string, format: date-time\n\n## Remove interaction restrictions from your public repositories\n\n```\nDELETE /user/interaction-limits\n```\n\nRemoves any interaction restrictions from your public repositories.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/user/interaction-limits\n```\n\n**Response schema (Status: 204):**"}