{"meta":{"title":"Points de terminaison d’API REST pour les interactions de dépôt","intro":"Utilisez l’API REST pour restreindre temporairement le type d’utilisateur qui peut commenter, ouvrir des problèmes ou créer des demandes de tirage sur un référentiel public.","product":"API REST","breadcrumbs":[{"href":"/fr/rest","title":"API REST"},{"href":"/fr/rest/interactions","title":"Interactions"},{"href":"/fr/rest/interactions/repos","title":"Référentiel"}],"documentType":"article"},"body":"# Points de terminaison d’API REST pour les interactions de dépôt\n\nUtilisez l’API REST pour restreindre temporairement le type d’utilisateur qui peut commenter, ouvrir des problèmes ou créer des demandes de tirage sur un référentiel public.\n\n## À propos des interactions de référentiel\n\nLes personnes avec un accès propriétaire ou administrateur peuvent utiliser l’API REST pour restreindre temporairement le type d’utilisateur qui peut commenter, ouvrir des problèmes ou créer des demandes de tirage sur un référentiel public. Lorsque les restrictions sont activées, seul le type d'utilisateur GitHub spécifié pourra participer aux interactions. Les restrictions expirent automatiquement après une durée définie. Voici plus d’informations sur les types d’utilisateurs GitHub :\n\n* **Utilisateurs existants :** Lorsque vous limitez les interactions aux `existing_users`, les nouveaux utilisateurs avec des comptes de moins de 24 heures qui n’ont pas déjà contribué et qui ne sont pas collaborateurs seront temporairement limités. dans le référentiel.\n* **Contributeurs uniquement :** Lorsque vous limitez les interactions aux `contributors_only`, les utilisateurs qui n’ont pas déjà contribué et qui ne sont pas collaborateurs sont temporairement limités. dans le référentiel.\n* **Collaborateurs uniquement :** lorsque vous limitez les interactions en choisissant `collaborators_only`, les utilisateurs qui ne sont pas des collaborateurs sont temporairement limités dans le référentiel.\n\nSi une limite d’interaction est activée pour l’utilisateur ou l’organisation propriétaire du référentiel, la limite ne peut pas être modifiée pour le référentiel individuel. Utilisez plutôt des points de terminaison d’interaction [utilisateur](/fr/rest/interactions/user) ou d’[organisation](/fr/rest/interactions/orgs) pour modifier la limite d’interaction.\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):**"}