Skip to content

Set interaction restrictions for a repository

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

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.

API method documentation

owner
required
string

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

repo
required
string

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

Media type application/json
Interaction Restrictions

Limit interactions to a specific type of user for a specified duration

object
limit
required

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

string
Allowed values: existing_users contributors_only collaborators_only
expiry

The duration of the interaction restriction. Default: one_day.

string
Allowed values: one_day three_days one_week one_month six_months
Examples
Example default

Example request body

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

Response

Media type application/json
Interaction Limits

Interaction limit settings.

object
limit
required

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

string
Allowed values: existing_users contributors_only collaborators_only
origin
required
string
expires_at
required
string format: date-time
Examples
Example default
{
"limit": "collaborators_only",
"origin": "repository",
"expires_at": "2018-08-17T04:18:39Z"
}

Response