v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
interactions

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.

put/repos/{owner}/{repo}/interaction-limits

Path parameters

ownerstring required

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

repostring required

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

Request body

limit'existing_users' | 'contributors_only' | 'collaborators_only' required

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

expiry'one_day' | 'three_days' | 'one_week' | 'one_month' | 'six_months'

The duration of the interaction restriction. Default: one_day.

Example request

{
  "limit": "collaborators_only",
  "expiry": "one_month"
}

Response

Response

limit'existing_users' | 'contributors_only' | 'collaborators_only' required

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

originstring required
expires_atstring date-time required

Example response

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