リポジトリ インタラクション用の REST API エンドポイント
この REST API を使って、パブリック リポジトリ内でコメントする、issue を開く、または pull request を作成することができるユーザーの種類を一時的に制限します。
リポジトリ インタラクションについて
所有者または管理者のアクセス権を持つユーザーは、この REST API を使って、パブリック リポジトリ内でコメントする、issue を開く、または pull request を作成することができるユーザーの種類を一時的に制限することができます。 制限が有効化されると、指定した種類の GitHub ユーザーのみがインタラクションに参加できるようになります。 制限は、定義された期間の後に自動的に期限切れになります。 GitHub ユーザーのタイプについては以下を参照してください。
- リポジトリのExisting users(既存のユーザー): インタラクションを
existing_usersに制限すると、24 時間以下しか経過していないアカウントの新規ユーザーで、以前にコントリビューションしておらず、コラボレーターでもないユーザーは、一時的に制限されます。 - リポジトリのContributors only (共同作成者のみ): 対話を
contributors_onlyに制限すると、以前に投稿していない共同作成者ではないユーザーは一時的に制限されます - リポジトリのCollaborators only(コラボレーターのみ): インタラクションを
collaborators_onlyに制限すると、コラボレーターではないユーザーは一時的に制限されます
リポジトリを所有しているユーザまたはOrganizationについてインタラクション制限を有効にしている場合、個々のリポジトリについてその制限を変更することはできません。 代わりに、User または Organization インタラクション エンドポイントを使って、インタラクションの制限を変更します。
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.
fine_grained_access
works_with_fine_grained_tokens:
permission_set:
- "Administration" repository permissions (read)
"Get interaction restrictions for a repository" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
owner string 必須The account owner of the repository. The name is not case sensitive. |
repo string 必須The name of the repository without the |
http_status_code
| status_code | 説明 |
|---|---|
200 | OK |
code_samples
request_example
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-limitsResponse
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.
fine_grained_access
works_with_fine_grained_tokens:
permission_set:
- "Administration" repository permissions (write)
"Set interaction restrictions for a repository" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
owner string 必須The account owner of the repository. The name is not case sensitive. |
repo string 必須The name of the repository without the |
| 名前, タイプ, 説明 |
|---|
limit string 必須The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. 次のいずれかにできます: |
expiry string The duration of the interaction restriction. Default: 次のいずれかにできます: |
http_status_code
| status_code | 説明 |
|---|---|
200 | OK |
409 | Conflict |
code_samples
request_example
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.
fine_grained_access
works_with_fine_grained_tokens:
permission_set:
- "Administration" repository permissions (write)
"Remove interaction restrictions for a repository" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
owner string 必須The account owner of the repository. The name is not case sensitive. |
repo string 必須The name of the repository without the |
http_status_code
| status_code | 説明 |
|---|---|
204 | No Content |
409 | Conflict |
code_samples
request_example
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-limitsResponse
Status: 204