Skip to main content
Ahora la API REST está versionada. Para obtener más información, consulta "Acerca del control de versiones de la API".

Puntos de conexión de la API de REST para interacciones de repositorio

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.

¿Quién puede utilizar esta característica?

People with owner or admin access to temporarily restrict which type of user can comment, open issues, or create pull requests in a public repository.

Acerca de las interacciones del repositorio

Las 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:

  • 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.
  • 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.
  • Solo colaboradores: al limitar las interacciones a collaborators_only, los usuarios que no son colaboradores se restringirán temporalmente. en el repositorio.

Si 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 u organización para cambiar el límite de interacción.

Get interaction restrictions for a repository

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.

Tokens de acceso granulares para "Get interaction restrictions for a repository"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" repository permissions (read)

Parámetros para "Get interaction restrictions for a repository"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
owner string Obligatorio

The account owner of the repository. The name is not case sensitive.

repo string Obligatorio

The name of the repository without the .git extension. The name is not case sensitive.

Códigos de estado de respuesta HTTP para "Get interaction restrictions for a repository"

código de estadoDescripción
200

OK

Ejemplos de código para "Get interaction restrictions for a repository"

Ejemplo de solicitud

get/repos/{owner}/{repo}/interaction-limits
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/interaction-limits

Response

Status: 200
{ "limit": "collaborators_only", "origin": "repository", "expires_at": "2018-08-17T04:18:39Z" }

Set interaction restrictions for a repository

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.

Tokens de acceso granulares para "Set interaction restrictions for a repository"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" repository permissions (write)

Parámetros para "Set interaction restrictions for a repository"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
owner string Obligatorio

The account owner of the repository. The name is not case sensitive.

repo string Obligatorio

The name of the repository without the .git extension. The name is not case sensitive.

Parámetros del cuerpo
Nombre, Tipo, Descripción
limit string Obligatorio

The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect.

Puede ser uno de los siguientes: existing_users, contributors_only, collaborators_only

expiry string

The duration of the interaction restriction. Default: one_day.

Puede ser uno de los siguientes: one_day, three_days, one_week, one_month, six_months

Códigos de estado de respuesta HTTP para "Set interaction restrictions for a repository"

código de estadoDescripción
200

OK

409

Conflict

Ejemplos de código para "Set interaction restrictions for a repository"

Ejemplo de solicitud

put/repos/{owner}/{repo}/interaction-limits
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/interaction-limits \ -d '{"limit":"collaborators_only","expiry":"one_day"}'

Response

Status: 200
{ "limit": "collaborators_only", "origin": "repository", "expires_at": "2018-08-17T04:18:39Z" }

Remove interaction restrictions for a repository

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.

Tokens de acceso granulares para "Remove interaction restrictions for a repository"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" repository permissions (write)

Parámetros para "Remove interaction restrictions for a repository"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
owner string Obligatorio

The account owner of the repository. The name is not case sensitive.

repo string Obligatorio

The name of the repository without the .git extension. The name is not case sensitive.

Códigos de estado de respuesta HTTP para "Remove interaction restrictions for a repository"

código de estadoDescripción
204

No Content

409

Conflict

Ejemplos de código para "Remove interaction restrictions for a repository"

Ejemplo de solicitud

delete/repos/{owner}/{repo}/interaction-limits
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/interaction-limits

Response

Status: 204

Get pull request creation cap bypass list for a repository

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 repository admins can view the bypass list.

Tokens de acceso granulares para "Get pull request creation cap bypass list for a repository"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" repository permissions (read)

Parámetros para "Get pull request creation cap bypass list for a repository"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
owner string Obligatorio

The account owner of the repository. The name is not case sensitive.

repo string Obligatorio

The name of the repository without the .git extension. The name is not case sensitive.

Códigos de estado de respuesta HTTP para "Get pull request creation cap bypass list for a repository"

código de estadoDescripción
200

OK

403

Forbidden

404

Resource not found

Ejemplos de código para "Get pull request creation cap bypass list for a repository"

Ejemplo de solicitud

get/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list

Response

Status: 200
[ { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false } ]

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

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 repository admins 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.

Tokens de acceso granulares para "Add users to the pull request creation cap bypass list for a repository"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" repository permissions (write)

Parámetros para "Add users to the pull request creation cap bypass list for a repository"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
owner string Obligatorio

The account owner of the repository. The name is not case sensitive.

repo string Obligatorio

The name of the repository without the .git extension. The name is not case sensitive.

Parámetros del cuerpo
Nombre, Tipo, Descripción
users array of strings Obligatorio

A list of user logins to add or remove from the bypass list.

Códigos de estado de respuesta HTTP para "Add users to the pull request creation cap bypass list for a repository"

código de estadoDescripción
204

No Content

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Ejemplos de código para "Add users to the pull request creation cap bypass list for a repository"

Ejemplo de solicitud

put/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list \ -d '{"users":["octocat","monalisa"]}'

Response

Status: 204

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

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 repository admins can modify the bypass list. You can remove a maximum of 100 users per request.

Tokens de acceso granulares para "Remove users from the pull request creation cap bypass list for a repository"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" repository permissions (write)

Parámetros para "Remove users from the pull request creation cap bypass list for a repository"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
owner string Obligatorio

The account owner of the repository. The name is not case sensitive.

repo string Obligatorio

The name of the repository without the .git extension. The name is not case sensitive.

Parámetros del cuerpo
Nombre, Tipo, Descripción
users array of strings Obligatorio

A list of user logins to add or remove from the bypass list.

Códigos de estado de respuesta HTTP para "Remove users from the pull request creation cap bypass list for a repository"

código de estadoDescripción
204

No Content

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Ejemplos de código para "Remove users from the pull request creation cap bypass list for a repository"

Ejemplo de solicitud

delete/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/interaction-limits/pulls/bypass-list \ -d '{"users":["octocat"]}'

Response

Status: 204