Sample - GitHub REST API
PUT/repos/{owner}/{repo}/interaction-limits

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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 2 body fields
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
limitstringrequired
The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect.
Allowed:existing_userscontributors_onlycollaborators_only
expirystringoptional
The duration of the interaction restriction. Default: `one_day`.
Allowed:one_daythree_daysone_weekone_monthsix_months

2 status codes
200Response
limitstringrequired
The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect.
Allowed:existing_userscontributors_onlycollaborators_only
originstringrequired
expires_atstringrequired
409Response

Error handling

A 409 is returned: Response.