octokit.orgs.blockUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
This endpoint triggers notifications.
octokit.orgs.cancelInvitation({org,invitation_id,});
name | required | description |
---|---|---|
org | yes | |
invitation_id | yes | invitation_id parameter |
See also: GitHub Developer Guide documentation.
octokit.orgs.checkBlockedUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Check if a user is, publicly or privately, a member of the organization.
octokit.orgs.checkMembershipForUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
octokit.orgs.checkPublicMembershipForUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "Converting an organization member to an outside collaborator".
octokit.orgs.convertMemberToOutsideCollaborator({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in abuse rate limiting. See "Abuse rate limits" and "Dealing with abuse rate limits" for details.
octokit.orgs.createInvitation({org,});
name | required | description |
---|---|---|
org | yes | |
invitee_id | no | Required unless you provide |
no | Required unless you provide | |
role | no | Specify role for new member. Can be one of: |
team_ids | no | Specify IDs for the teams you want to invite new members to. |
See also: GitHub Developer Guide documentation.
Here's how you can create a hook that posts payloads in JSON format:
octokit.orgs.createWebhook({org,name,config,config.url})
name | required | description |
---|---|---|
org | yes | |
name | yes | Must be passed as "web". |
config | yes | Key/value pairs to provide settings for this webhook. These are defined below. |
config.url | yes | The URL to which the payloads will be delivered. |
config.content_type | no | The media type used to serialize the payloads. Supported values include |
config.secret | no | If provided, the |
config.insecure_ssl | no | Determines whether the SSL certificate of the host for |
config.username | no | |
config.password | no | |
events | no | Determines what events the hook is triggered for. |
active | no | Determines if notifications are sent when the webhook is triggered. Set to |
See also: GitHub Developer Guide documentation.
octokit.orgs.deleteWebhook({org,hook_id,});
name | required | description |
---|---|---|
org | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
To see many of the organization response values, you need to be an authenticated organization owner with the admin:org
scope. When the value of two_factor_requirement_enabled
is true
, the organization requires all members, billing managers, and outside collaborators to enable two-factor authentication.
GitHub Apps with the Organization plan
permission can use this endpoint to retrieve information about an organization's GitHub plan. See "Authenticating with GitHub Apps" for details. For an example response, see 'Response with GitHub plan information' below."
octokit.orgs.get({org,});
name | required | description |
---|---|---|
org | yes |
See also: GitHub Developer Guide documentation.
octokit.orgs.getMembershipForAuthenticatedUser({org,});
name | required | description |
---|---|---|
org | yes |
See also: GitHub Developer Guide documentation.
In order to get a user's membership with an organization, the authenticated user must be an organization member.
octokit.orgs.getMembershipForUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Returns a webhook configured in an organization. To get only the webhook config
properties, see "Get a webhook configuration for an organization."
octokit.orgs.getWebhook({org,hook_id,});
name | required | description |
---|---|---|
org | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
Returns the webhook configuration for an organization. To get more information about the webhook, including the active
state and events
, use "Get an organization webhook ."
Access tokens must have the admin:org_hook
scope, and GitHub Apps must have the organization_hooks:read
permission.
octokit.orgs.getWebhookConfigForOrg({org,hook_id,});
name | required | description |
---|---|---|
org | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
Lists all organizations, in the order that they were created on GitHub.
Note: Pagination is powered exclusively by the since
parameter. Use the Link header to get the URL for the next page of organizations.
octokit.orgs.list();
name | required | description |
---|---|---|
since | no | An organization ID. Only return organizations with an ID greater than this ID. |
per_page | no | Results per page (max 100) |
See also: GitHub Developer Guide documentation.
Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with admin:read
scope to use this endpoint.
octokit.orgs.listAppInstallations({org,});
name | required | description |
---|---|---|
org | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
List the users blocked by an organization.
octokit.orgs.listBlockedUsers({org,});
name | required | description |
---|---|---|
org | yes |
See also: GitHub Developer Guide documentation.
The return hash contains failed_at
and failed_reason
fields which represent the time at which the invitation failed and the reason for the failure.
octokit.orgs.listFailedInvitations({org,});
name | required | description |
---|---|---|
org | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
List organizations for the authenticated user.
OAuth scope requirements
This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org
scope, you can publicize your organization membership with user
scope, etc.). Therefore, this API requires at least user
or read:org
scope. OAuth requests with insufficient scope receive a 403 Forbidden
response.
octokit.orgs.listForAuthenticatedUser();
name | required | description |
---|---|---|
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
List public organization memberships for the specified user.
This method only lists public memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the List organizations for the authenticated user API instead.
octokit.orgs.listForUser({username,});
name | required | description |
---|---|---|
username | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.
octokit.orgs.listInvitationTeams({org,invitation_id,});
name | required | description |
---|---|---|
org | yes | |
invitation_id | yes | invitation_id parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
octokit.orgs.listMembers({org,});
name | required | description |
---|---|---|
org | yes | |
filter | no | Filter members returned in the list. Can be one of: |
role | no | Filter members returned by their role. Can be one of: |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
octokit.orgs.listMembershipsForAuthenticatedUser();
name | required | description |
---|---|---|
state | no | Indicates the state of the memberships to return. Can be either |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
List all users who are outside collaborators of an organization.
octokit.orgs.listOutsideCollaborators({org,});
name | required | description |
---|---|---|
org | yes | |
filter | no | Filter the list of outside collaborators. Can be one of: |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
The return hash contains a role
field which refers to the Organization Invitation role and will be one of the following values: direct_member
, admin
, billing_manager
, hiring_manager
, or reinstate
. If the invitee is not a GitHub member, the login
field in the return hash will be null
.
octokit.orgs.listPendingInvitations({org,});
name | required | description |
---|---|---|
org | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Members of an organization can choose to have their membership publicized or not.
octokit.orgs.listPublicMembers({org,});
name | required | description |
---|---|---|
org | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
octokit.orgs.listWebhooks({org,});
name | required | description |
---|---|---|
org | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
This will trigger a ping event to be sent to the hook.
octokit.orgs.pingWebhook({org,hook_id,});
name | required | description |
---|---|---|
org | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.
octokit.orgs.removeMember({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
In order to remove a user's membership with an organization, the authenticated user must be an organization owner.
If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.
octokit.orgs.removeMembershipForUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Removing a user from this list will remove them from all the organization's repositories.
octokit.orgs.removeOutsideCollaborator({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
octokit.orgs.removePublicMembershipForAuthenticatedUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Only authenticated organization owners can add a member to the organization or update the member's role.
pending
until they accept the invitation.role
parameter. If the authenticated user changes a member's role to admin
, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to member
, no email will be sent.Rate limits
To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.
octokit.orgs.setMembershipForUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes | |
role | no | The role to give the user in the organization. Can be one of: |
See also: GitHub Developer Guide documentation.
The user can publicize their own membership. (A user cannot publicize the membership for another user.)
Note that you'll need to set Content-Length
to zero when calling out to this endpoint. For more information, see "HTTP verbs."
octokit.orgs.setPublicMembershipForAuthenticatedUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
octokit.orgs.unblockUser({org,username,});
name | required | description |
---|---|---|
org | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Parameter Deprecation Notice: GitHub will replace and discontinue members_allowed_repository_creation_type
in favor of more granular permissions. The new input parameters are members_can_create_public_repositories
, members_can_create_private_repositories
for all organizations and members_can_create_internal_repositories
for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the blog post.
Enables an authenticated organization owner with the admin:org
scope to update the organization's profile and member privileges.
octokit.orgs.update({org,});
name | required | description |
---|---|---|
org | yes | |
billing_email | no | Billing email address. This address is not publicized. |
company | no | The company name. |
no | The publicly visible email address. | |
twitter_username | no | The Twitter username of the company. |
location | no | The location. |
name | no | The shorthand name of the company. |
description | no | The description of the company. |
has_organization_projects | no | Toggles whether an organization can use organization projects. |
has_repository_projects | no | Toggles whether repositories that belong to the organization can use repository projects. |
default_repository_permission | no | Default permission level members have for organization repositories: |
members_can_create_repositories | no | Toggles the ability of non-admin organization members to create repositories. Can be one of: |
members_can_create_internal_repositories | no | Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of: |
members_can_create_private_repositories | no | Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of: |
members_can_create_public_repositories | no | Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of: |
members_allowed_repository_creation_type | no | Specifies which types of repositories non-admin organization members can create. Can be one of: |
members_can_create_pages | no | Toggles whether organization members can create GitHub Pages sites. Can be one of: |
members_can_create_public_pages | no | Toggles whether organization members can create public GitHub Pages sites. Can be one of: |
members_can_create_private_pages | no | Toggles whether organization members can create private GitHub Pages sites. Can be one of: |
blog | no |
See also: GitHub Developer Guide documentation.
octokit.orgs.updateMembershipForAuthenticatedUser({org,state,});
name | required | description |
---|---|---|
org | yes | |
state | yes | The state that the membership should be in. Only |
See also: GitHub Developer Guide documentation.
Updates a webhook configured in an organization. When you update a webhook, the secret
will be overwritten. If you previously had a secret
set, you must provide the same secret
or set a new secret
or the secret will be removed. If you are only updating individual webhook config
properties, use "Update a webhook configuration for an organization."
octokit.orgs.updateWebhook({org,hook_id,config.url})
name | required | description |
---|---|---|
org | yes | |
hook_id | yes | |
config | no | Key/value pairs to provide settings for this webhook. These are defined below. |
config.url | yes | The URL to which the payloads will be delivered. |
config.content_type | no | The media type used to serialize the payloads. Supported values include |
config.secret | no | If provided, the |
config.insecure_ssl | no | Determines whether the SSL certificate of the host for |
events | no | Determines what events the hook is triggered for. |
active | no | Determines if notifications are sent when the webhook is triggered. Set to |
name | no |
See also: GitHub Developer Guide documentation.
Updates the webhook configuration for an organization. To update more information about the webhook, including the active
state and events
, use "Update an organization webhook ."
Access tokens must have the admin:org_hook
scope, and GitHub Apps must have the organization_hooks:write
permission.
octokit.orgs.updateWebhookConfigForOrg({org,hook_id,});
name | required | description |
---|---|---|
org | yes | |
hook_id | yes | |
url | no | The URL to which the payloads will be delivered. |
content_type | no | The media type used to serialize the payloads. Supported values include |
secret | no | If provided, the |
insecure_ssl | no | Determines whether the SSL certificate of the host for |
See also: GitHub Developer Guide documentation.