{"meta":{"title":"Puntos de conexión de la API de REST para interacciones de repositorio","intro":"Usa la API REST para restringir temporalmente qué tipo de usuario puede comentar, abrir incidencias o crear solicitudes de incorporación de cambios en un repositorio público.","product":"REST API","breadcrumbs":[{"href":"/es/rest","title":"REST API"},{"href":"/es/rest/interactions","title":"Interacciones"},{"href":"/es/rest/interactions/repos","title":"Repositorio"}],"documentType":"article"},"body":"# Puntos de conexión de la API de REST para interacciones de repositorio\n\nUsa la API REST para restringir temporalmente qué tipo de usuario puede comentar, abrir incidencias o crear solicitudes de incorporación de cambios en un repositorio público.\n\n## Acerca de las interacciones del repositorio\n\nLas personas con acceso administrativo o de propietario pueden usar la API REST para restringir temporalmente qué tipo de usuario puede comentar, abrir incidencias o crear solicitudes de incorporación de cambios en un repositorio público. Cuando se habilitan las restricciones, solo el tipo de usuario de GitHub que hayas especificado podrá participar en las interacciones. Las restricciones expiran automáticamente después de una duración definida. Aquí puede obtener más información sobre los tipos de usuario de GitHub:\n\n* **Usuarios existentes:** al limitar las interacciones a `existing_users`, los nuevos usuarios con cuentas con menos de 24 horas de antigüedad que no hayan contribuido previamente y no sean colaboradores se restringirán temporalmente. en el repositorio.\n* **Solo colaboradores:** cuando limita las interacciones a `contributors_only`, se restringe temporalmente a los usuarios que no han contribuido previamente y no son colaboradores. en el repositorio.\n* **Solo colaboradores:** al limitar las interacciones a `collaborators_only`, los usuarios que no son colaboradores se restringirán temporalmente. en el repositorio.\n\nSi se habilita un límite de interacción para el usuario u organización a la que pertenece el repositorio, éste no podrá cambiarse para el repositorio individual. En su lugar, use los puntos de conexión de interacciones de [usuario](/es/rest/interactions/user) u [organización](/es/rest/interactions/orgs) para cambiar el límite de interacción.\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 a repository\n\n```\nGET /repos/{owner}/{repo}/interaction-limits\n```\n\nShows 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/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 a repository\n\n```\nPUT /repos/{owner}/{repo}/interaction-limits\n```\n\nTemporarily 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\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* **409** - Conflict\n\n### Code examples\n\n#### Example request body\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/repos/OWNER/REPO/interaction-limits \\\n  -d '{\n  \"limit\": \"collaborators_only\",\n  \"expiry\": \"one_day\"\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 for a repository\n\n```\nDELETE /repos/{owner}/{repo}/interaction-limits\n```\n\nRemoves 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **409** - Conflict\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/repos/OWNER/REPO/interaction-limits\n```\n\n**Response schema (Status: 204):**\n\n## Get pull request creation cap bypass list for a repository\n\n```\nGET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list\n```\n\nLists the users that are on the pull request creation cap bypass list for a\nrepository. Users on this list can create pull requests regardless of any\nconfigured pull request creation cap.\nOnly users with maintainer permissions can view the bypass list.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list\n```\n\n**Response schema (Status: 200):**\n\nArray of `Simple User`:\n\n* `name`: string or null\n* `email`: string or null\n* `login`: required, string\n* `id`: required, integer, format: int64\n* `node_id`: required, string\n* `avatar_url`: required, string, format: uri\n* `gravatar_id`: required, string or null\n* `url`: required, string, format: uri\n* `html_url`: required, string, format: uri\n* `followers_url`: required, string, format: uri\n* `following_url`: required, string\n* `gists_url`: required, string\n* `starred_url`: required, string\n* `subscriptions_url`: required, string, format: uri\n* `organizations_url`: required, string, format: uri\n* `repos_url`: required, string, format: uri\n* `events_url`: required, string\n* `received_events_url`: required, string, format: uri\n* `type`: required, string\n* `site_admin`: required, boolean\n* `starred_at`: string\n* `user_view_type`: string\n\n## Add users to the pull request creation cap bypass list for a repository\n\n```\nPUT /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list\n```\n\nAdds users to the pull request creation cap bypass list for a repository.\nUsers on this list can create pull requests regardless of any configured\npull request creation cap.\nOnly users with maintainer permissions can modify the bypass list.\nYou can add a maximum of 100 users per request.\nThe bypass list can only hold a maximum of 100 users.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n#### Body parameters\n\n* **`users`** (array of strings) (required)\n  A list of user logins to add or remove from the bypass list.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example request body\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list \\\n  -d '{\n  \"users\": [\n    \"octocat\",\n    \"monalisa\"\n  ]\n}'\n```\n\n**Response schema (Status: 204):**\n\n## Remove users from the pull request creation cap bypass list for a repository\n\n```\nDELETE /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list\n```\n\nRemoves users from the pull request creation cap bypass list for a repository.\nRemoved users will be subject to any configured pull request creation cap.\nOnly users with maintainer permissions can modify the bypass list.\nYou can remove a maximum of 100 users per request.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n#### Body parameters\n\n* **`users`** (array of strings) (required)\n  A list of user logins to add or remove from the bypass list.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example request body\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list \\\n  -d '{\n  \"users\": [\n    \"octocat\"\n  ]\n}'\n```\n\n**Response schema (Status: 204):**\n\n## Get pull request creation cap for a repository\n\n```\nGET /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap\n```\n\nGets the pull request creation cap configuration for a repository.\nThe cap limits the number of open pull requests a user can have at one time.\nOnly users with admin access to the repository can view the cap configuration.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **405** - Method Not Allowed\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/creation-cap\n```\n\n**Response schema (Status: 200):**\n\n* `enabled`: required, boolean\n* `max_open_pull_requests`: required, integer, minimum: 1, maximum: 1000\n\n## Update pull request creation cap for a repository\n\n```\nPATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap\n```\n\nUpdates the pull request creation cap for a repository. The cap limits the number\nof open pull requests a user can have at one time.\nOnly users with admin access to the repository can configure the cap.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n#### Body parameters\n\n* **`enabled`** (boolean) (required)\n  Whether the pull request creation cap is enabled\n\n* **`max_open_pull_requests`** (integer)\n  The maximum number of open pull requests a user can have at one time\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **405** - Method Not Allowed\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example request body\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/creation-cap \\\n  -d '{\n  \"enabled\": true,\n  \"max_open_pull_requests\": 1\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get pull request creation cap for a repository](#get-pull-request-creation-cap-for-a-repository)."}