Organization interaction restrictions

The Organization Interactions API allows organization owners to temporarily restrict which users can comment, open issues, or create pull requests in the organization's public repositories. When restrictions are enabled, only the specified group of GitHub users will be able to participate in interactions. Restrictions expire 24 hours from the time they are set. Here's more about the groups of GitHub users:

  • Existing users: When you limit interactions to existing_users, new users with accounts less than 24 hours old who have not previously contributed and are not collaborators will be temporarily restricted in the organization.
  • Contributors only: When you limit interactions to contributors_only, users who have not previously contributed and are not collaborators will be temporarily restricted in the organization.
  • Collaborators only: When you limit interactions to collaborators_only, users who are not collaborators will be temporarily restricted in the organization.

Get interaction restrictions for an organization

Note: The Interactions APIs are currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.sombra-preview

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

Shows which group of GitHub users can interact with this organization and when the restriction expires. If there are no restrictions, you will see an empty response.

GET /orgs/:org/interaction-limits

Response

Status: 200 OK
{
  "limit": "collaborators_only",
  "origin": "organization",
  "expires_at": "2018-08-17T04:18:39Z"
}

Add or update interaction restrictions for an organization

Note: The Interactions APIs are currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.sombra-preview

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

Temporarily restricts interactions to certain GitHub users in any public repository in the given organization. You must be an organization owner to set these restrictions.

PUT /orgs/:org/interaction-limits

Parameters

Name Type Description
limit string Required. Specifies the group of GitHub users who can comment, open issues, or create pull requests in public repositories for the given organization. Must be one of: existing_users, contributors_only, or collaborators_only.

Example

{
  "limit": "collaborators_only"
}

Response

Status: 200 OK
{
  "limit": "collaborators_only",
  "origin": "organization",
  "expires_at": "2018-08-17T04:18:39Z"
}

Remove interaction restrictions for an organization

Note: The Interactions APIs are currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.sombra-preview

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.

DELETE /orgs/:org/interaction-limits

Response

Status: 204 No Content