← All tags

Orgs API Reference

Interact with organizations.

108 endpoints tagged orgs, each listing its parameters and possible responses. Search or scroll the index below to jump to a specific endpoint.

No endpoints match your search.

List organizations

GET /organizations

Lists all organizations, in the order that they were created.

Parameters

NameInRequiredDescription
sincequerynoAn organization ID. Only return organizations with an ID greater than this ID.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno

Get an organization

GET /orgs/{org}

Gets information about an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

Update an organization

PATCH /orgs/{org}

Updates the organization's profile and member privileges.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
422Validation failedyes
409Conflictyes

Delete an organization

DELETE /orgs/{org}

Deletes an organization and all its repositories.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
202Acceptedyes
404Resource not foundyes
403Forbiddenyes

Create an artifact deployment record

POST /orgs/{org}/artifacts/metadata/deployment-record

Create or update deployment records for an artifact associated

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Artifact deployment record stored successfully.yes
403Forbiddenyes
404Resource not foundyes

Set cluster deployment records

POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}

Set deployment records for a given cluster.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
clusterpathyesThe cluster name.

Responses

StatusDescriptionHas JSON body
200Deployment records created or updated successfully. yes
403Forbiddenyes
404Resource not foundyes

Create artifact metadata storage record

POST /orgs/{org}/artifacts/metadata/storage-record

Create metadata storage records for artifacts associated with an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Artifact metadata storage record stored successfully.yes
403Forbiddenyes
404Resource not foundyes

List artifact deployment records

GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records

List deployment records for an artifact metadata associated with an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
subject_digestpathyesThe SHA256 digest of the artifact, in the form sha256:HEX_DIGEST.

Responses

StatusDescriptionHas JSON body
200Successful responseyes

List artifact storage records

GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records

List artifact storage records with a given subject digest for repositories owned by an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
subject_digestpathyesThe parameter should be set to the attestation's subject's SHA256 digest, in the form sha256:HEX_DIGEST.

Responses

StatusDescriptionHas JSON body
200Responseyes

List attestations by bulk subject digests

POST /orgs/{org}/attestations/bulk-list

List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization.

Parameters

NameInRequiredDescription
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
beforequerynoA cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API."
afterquerynoA cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API."
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes

Delete attestations in bulk

POST /orgs/{org}/attestations/delete-request

Delete artifact attestations in bulk by either subject digests or unique ID.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseno
404Resource not foundyes

Delete attestations by subject digest

DELETE /orgs/{org}/attestations/digest/{subject_digest}

Delete an artifact attestation by subject digest.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
subject_digestpathyesSubject Digest

Responses

StatusDescriptionHas JSON body
200Responseno
204Responseno
404Resource not foundyes

List attestation repositories

GET /orgs/{org}/attestations/repositories

List repositories owned by the provided organization that have created at least one attested artifact

Parameters

NameInRequiredDescription
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
beforequerynoA cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API."
afterquerynoA cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API."
orgpathyesThe organization name. The name is not case sensitive.
predicate_typequerynoOptional filter for fetching attestations with a given predicate type.

Responses

StatusDescriptionHas JSON body
200Responseyes

Delete attestations by ID

DELETE /orgs/{org}/attestations/{attestation_id}

Delete an artifact attestation by unique ID that is associated with a repository owned by an org.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
attestation_idpathyesAttestation ID

Responses

StatusDescriptionHas JSON body
200Responseno
204Responseno
403Forbiddenyes
404Resource not foundyes

List attestations

GET /orgs/{org}/attestations/{subject_digest}

List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.

Parameters

NameInRequiredDescription
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
beforequerynoA cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API."
afterquerynoA cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API."
orgpathyesThe organization name. The name is not case sensitive.
subject_digestpathyesThe parameter should be set to the attestation's subject's SHA256 digest, in the form sha256:HEX_DIGEST.
predicate_typequerynoOptional filter for fetching attestations with a given predicate type.

Responses

StatusDescriptionHas JSON body
200Responseyes

List users blocked by an organization

GET /orgs/{org}/blocks

List the users blocked by an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Check if a user is blocked by an organization

GET /orgs/{org}/blocks/{username}

Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204If the user is blockedno
404If the user is not blockedyes

Block a user from an organization

PUT /orgs/{org}/blocks/{username}

Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno
422Validation failed, or the endpoint has been spammed.yes

Unblock a user from an organization

DELETE /orgs/{org}/blocks/{username}

Unblocks the given user on behalf of the specified organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno

List failed organization invitations

GET /orgs/{org}/failed_invitations

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.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

List organization webhooks

GET /orgs/{org}/hooks

List webhooks for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

Create an organization webhook

POST /orgs/{org}/hooks

Create a hook that posts payloads in JSON format.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201Responseyes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes

Get an organization webhook

GET /orgs/{org}/hooks/{hook_id}

Returns a webhook configured in an organization. To get only the webhook

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

Update an organization webhook

PATCH /orgs/{org}/hooks/{hook_id}

Updates a webhook configured in an organization. When you update a webhook,

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.

Responses

StatusDescriptionHas JSON body
200Responseyes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes

Delete an organization webhook

DELETE /orgs/{org}/hooks/{hook_id}

Delete a webhook for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes

Get a webhook configuration for an organization

GET /orgs/{org}/hooks/{hook_id}/config

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 ."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.

Responses

StatusDescriptionHas JSON body
200Responseyes

Update a webhook configuration for an organization

PATCH /orgs/{org}/hooks/{hook_id}/config

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 ."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.

Responses

StatusDescriptionHas JSON body
200Responseyes

List deliveries for an organization webhook

GET /orgs/{org}/hooks/{hook_id}/deliveries

Returns a list of webhook deliveries for a webhook configured in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
cursorquerynoUsed for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the link header for the next and previous page cursors.
statusquerynoReturns webhook deliveries filtered by delivery outcome classification based on status_code range. A status of success returns deliveries with a status_code in the 200-399 range (inclusive). A status of failure returns deliveries with a status_code in the 400-599 range (inclusive).

Responses

StatusDescriptionHas JSON body
200Responseyes
400Bad Requestyes
422Validation failed, or the endpoint has been spammed.yes

Get a webhook delivery for an organization webhook

GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}

Returns a delivery for a webhook configured in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.
delivery_idpathyes

Responses

StatusDescriptionHas JSON body
200Responseyes
400Bad Requestyes
422Validation failed, or the endpoint has been spammed.yes

Redeliver a delivery for an organization webhook

POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts

Redeliver a delivery for a webhook configured in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.
delivery_idpathyes

Responses

StatusDescriptionHas JSON body
202Acceptedyes
400Bad Requestyes
422Validation failed, or the endpoint has been spammed.yes

Ping an organization webhook

POST /orgs/{org}/hooks/{hook_id}/pings

This will trigger a ping event

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
hook_idpathyesThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes

Get route stats by actor

GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}

Get API request count statistics for an actor broken down by route within a specified time frame.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
actor_typepathyesThe type of the actor
actor_idpathyesThe ID of the actor
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
directionquerynoThe direction to sort the results by.
sortquerynoThe property to sort the results by.
api_route_substringquerynoProviding a substring will filter results where the API route contains the substring. This is a case-insensitive search.

Responses

StatusDescriptionHas JSON body
200Responseyes

Get subject stats

GET /orgs/{org}/insights/api/subject-stats

Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
directionquerynoThe direction to sort the results by.
sortquerynoThe property to sort the results by.
subject_name_substringquerynoProviding a substring will filter results where the subject name contains the substring. This is a case-insensitive search.

Responses

StatusDescriptionHas JSON body
200Responseyes

Get summary stats

GET /orgs/{org}/insights/api/summary-stats

Get overall statistics of API requests made within an organization by all users and apps within a specified time frame.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

Responses

StatusDescriptionHas JSON body
200Responseyes

Get summary stats by user

GET /orgs/{org}/insights/api/summary-stats/users/{user_id}

Get overall statistics of API requests within the organization for a user.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
user_idpathyesThe ID of the user to query for stats
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

Responses

StatusDescriptionHas JSON body
200Responseyes

Get summary stats by actor

GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}

Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
actor_typepathyesThe type of the actor
actor_idpathyesThe ID of the actor

Responses

StatusDescriptionHas JSON body
200Responseyes

Get time stats

GET /orgs/{org}/insights/api/time-stats

Get the number of API requests and rate-limited requests made within an organization over a specified time period.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
timestamp_incrementqueryyesThe increment of time used to breakdown the query results (5m, 10m, 1h, etc.)

Responses

StatusDescriptionHas JSON body
200Responseyes

Get time stats by user

GET /orgs/{org}/insights/api/time-stats/users/{user_id}

Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
user_idpathyesThe ID of the user to query for stats
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
timestamp_incrementqueryyesThe increment of time used to breakdown the query results (5m, 10m, 1h, etc.)

Responses

StatusDescriptionHas JSON body
200Responseyes

Get time stats by actor

GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}

Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
actor_typepathyesThe type of the actor
actor_idpathyesThe ID of the actor
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
timestamp_incrementqueryyesThe increment of time used to breakdown the query results (5m, 10m, 1h, etc.)

Responses

StatusDescriptionHas JSON body
200Responseyes

Get user stats

GET /orgs/{org}/insights/api/user-stats/{user_id}

Get API usage statistics within an organization for a user broken down by the type of access.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
user_idpathyesThe ID of the user to query for stats
min_timestampqueryyesThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
max_timestampquerynoThe maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
directionquerynoThe direction to sort the results by.
sortquerynoThe property to sort the results by.
actor_name_substringquerynoProviding a substring will filter results where the actor name contains the substring. This is a case-insensitive search.

Responses

StatusDescriptionHas JSON body
200Responseyes

List app installations for an organization

GET /orgs/{org}/installations

Lists all GitHub Apps in an organization. The installation count includes

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

List pending organization invitations

GET /orgs/{org}/invitations

The return hash contains a role field which refers to the Organization

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
rolequerynoFilter invitations by their member role.
invitation_sourcequerynoFilter invitations by their invitation source.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

Create an organization invitation

POST /orgs/{org}/invitations

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.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201Responseyes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes

Cancel an organization invitation

DELETE /orgs/{org}/invitations/{invitation_id}

Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
invitation_idpathyesThe unique identifier of the invitation.

Responses

StatusDescriptionHas JSON body
204Responseno
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes

List organization invitation teams

GET /orgs/{org}/invitations/{invitation_id}/teams

List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
invitation_idpathyesThe unique identifier of the invitation.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

List issue fields for an organization

GET /orgs/{org}/issue-fields

Lists all issue fields for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

Create issue field for an organization

POST /orgs/{org}/issue-fields

Creates a new issue field for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

Update issue field for an organization

PATCH /orgs/{org}/issue-fields/{issue_field_id}

Updates an issue field for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
issue_field_idpathyesThe unique identifier of the issue field.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

Delete issue field for an organization

DELETE /orgs/{org}/issue-fields/{issue_field_id}

Deletes an issue field for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
issue_field_idpathyesThe unique identifier of the issue field.

Responses

StatusDescriptionHas JSON body
204A header with no content is returned.no
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

List issue types for an organization

GET /orgs/{org}/issue-types

Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

Create issue type for an organization

POST /orgs/{org}/issue-types

Create a new issue type for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

Update issue type for an organization

PUT /orgs/{org}/issue-types/{issue_type_id}

Updates an issue type for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
issue_type_idpathyesThe unique identifier of the issue type.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

Delete issue type for an organization

DELETE /orgs/{org}/issue-types/{issue_type_id}

Deletes an issue type for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
issue_type_idpathyesThe unique identifier of the issue type.

Responses

StatusDescriptionHas JSON body
204Responseno
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes

List organization members

GET /orgs/{org}/members

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.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
filterquerynoFilter members returned in the list. 2fa_disabled means that only members without two-factor authentication enabled will be returned. 2fa_insecure means that only members with insecure 2FA methods will be returned. These options are only available for organization owners.
rolequerynoFilter members returned by their role.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
422Validation failed, or the endpoint has been spammed.yes

Check organization membership for a user

GET /orgs/{org}/members/{username}

Check if a user is, publicly or privately, a member of the organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Response if requester is an organization member and user is a memberno
302Response if requester is not an organization memberno
404Not Found if requester is an organization member and user is not a memberno

Remove an organization member

DELETE /orgs/{org}/members/{username}

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.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno
403Forbiddenyes

Get organization membership for a user

GET /orgs/{org}/memberships/{username}

In order to get a user's membership with an organization, the authenticated user must be an organization member. The state parameter in the response can be used to identify the user's membership status.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
403Forbiddenyes

Set organization membership for a user

PUT /orgs/{org}/memberships/{username}

Only authenticated organization owners can add a member to the organization or update the member's role.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
200Responseyes
422Validation failed, or the endpoint has been spammed.yes
403Forbiddenyes

Remove organization membership for a user

DELETE /orgs/{org}/memberships/{username}

In order to remove a user's membership with an organization, the authenticated user must be an organization owner.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno
403Forbiddenyes
404Resource not foundyes

Get all organization roles for an organization

GET /orgs/{org}/organization-roles

Lists the organization roles available in this organization. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Response - list of organization rolesyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

Remove all organization roles for a team

DELETE /orgs/{org}/organization-roles/teams/{team_slug}

Removes all assigned organization roles from a team. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
team_slugpathyesThe slug of the team name.

Responses

StatusDescriptionHas JSON body
204Responseno

Assign an organization role to a team

PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}

Assigns an organization role to a team in an organization. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
team_slugpathyesThe slug of the team name.
role_idpathyesThe unique identifier of the role.

Responses

StatusDescriptionHas JSON body
204Responseno
404Response if the organization, team or role does not exist.no
422Response if the organization roles feature is not enabled for the organization, or validation failed.no

Remove an organization role from a team

DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}

Removes an organization role from a team. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
team_slugpathyesThe slug of the team name.
role_idpathyesThe unique identifier of the role.

Responses

StatusDescriptionHas JSON body
204Responseno

Remove all organization roles for a user

DELETE /orgs/{org}/organization-roles/users/{username}

Revokes all assigned organization roles from a user. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno

Assign an organization role to a user

PUT /orgs/{org}/organization-roles/users/{username}/{role_id}

Assigns an organization role to a member of an organization. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.
role_idpathyesThe unique identifier of the role.

Responses

StatusDescriptionHas JSON body
204Responseno
404Response if the organization, user or role does not exist.no
422Response if the organization roles feature is not enabled enabled for the organization, the validation failed, or the user is not an organization member.no

Remove an organization role from a user

DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}

Remove an organization role from a user. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.
role_idpathyesThe unique identifier of the role.

Responses

StatusDescriptionHas JSON body
204Responseno

Get an organization role

GET /orgs/{org}/organization-roles/{role_id}

Gets an organization role that is available to this organization. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
role_idpathyesThe unique identifier of the role.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

List teams that are assigned to an organization role

GET /orgs/{org}/organization-roles/{role_id}/teams

Lists the teams that are assigned to an organization role. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
role_idpathyesThe unique identifier of the role.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Response - List of assigned teamsyes
404Response if the organization or role does not exist.no
422Response if the organization roles feature is not enabled or validation failed.no

List users that are assigned to an organization role

GET /orgs/{org}/organization-roles/{role_id}/users

Lists organization members that are assigned to an organization role. For more information on organization roles, see "Using organization roles."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
role_idpathyesThe unique identifier of the role.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Response - List of assigned usersyes
404Response if the organization or role does not exist.no
422Response if the organization roles feature is not enabled or validation failed.no

List outside collaborators for an organization

GET /orgs/{org}/outside_collaborators

List all users who are outside collaborators of an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
filterquerynoFilter the list of outside collaborators. 2fa_disabled means that only outside collaborators without two-factor authentication enabled will be returned. 2fa_insecure means that only outside collaborators with insecure 2FA methods will be returned.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Convert an organization member to outside collaborator

PUT /orgs/{org}/outside_collaborators/{username}

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". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "Enforcing repository management policies in your enterprise."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
202User is getting converted asynchronouslyyes
204User was convertedno
403Forbidden if user is the last owner of the organization, not a member of the organization, or if the enterprise enforces a policy for inviting outside collaborators. For more information, see "Enforcing repository management policies in your enterprise."no
404Resource not foundyes

Remove outside collaborator from an organization

DELETE /orgs/{org}/outside_collaborators/{username}

Removing a user from this list will remove them from all the organization's repositories.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno
422Unprocessable Entity if user is a member of the organizationyes

List requests to access organization resources with fine-grained personal access tokens

GET /orgs/{org}/personal-access-token-requests

Lists requests from organization members to access organization resources with a fine-grained personal access token.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
sortquerynoThe property by which to sort the results.
directionquerynoThe direction to sort the results by.
ownerquerynoA list of owner usernames to use to filter the results.
repositoryquerynoThe name of the repository to use to filter the results.
permissionquerynoThe permission to use to filter the results.
last_used_beforequerynoOnly show fine-grained personal access tokens used before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
last_used_afterquerynoOnly show fine-grained personal access tokens used after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
token_idquerynoThe ID of the token

Responses

StatusDescriptionHas JSON body
500Internal Erroryes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes
403Forbiddenyes
200Responseyes

Review requests to access organization resources with fine-grained personal access tokens

POST /orgs/{org}/personal-access-token-requests

Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
500Internal Erroryes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes
403Forbiddenyes
202Acceptedyes

Review a request to access organization resources with a fine-grained personal access token

POST /orgs/{org}/personal-access-token-requests/{pat_request_id}

Approves or denies a pending request to access organization resources via a fine-grained personal access token.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
pat_request_idpathyesUnique identifier of the request for access via fine-grained personal access token.

Responses

StatusDescriptionHas JSON body
500Internal Erroryes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes
403Forbiddenyes
204A header with no content is returned.no

List repositories requested to be accessed by a fine-grained personal access token

GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories

Lists the repositories a fine-grained personal access token request is requesting access to.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
pat_request_idpathyesUnique identifier of the request for access via fine-grained personal access token.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
500Internal Erroryes
404Resource not foundyes
403Forbiddenyes
200Responseyes

List fine-grained personal access tokens with access to organization resources

GET /orgs/{org}/personal-access-tokens

Lists approved fine-grained personal access tokens owned by organization members that can access organization resources.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
sortquerynoThe property by which to sort the results.
directionquerynoThe direction to sort the results by.
ownerquerynoA list of owner usernames to use to filter the results.
repositoryquerynoThe name of the repository to use to filter the results.
permissionquerynoThe permission to use to filter the results.
last_used_beforequerynoOnly show fine-grained personal access tokens used before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
last_used_afterquerynoOnly show fine-grained personal access tokens used after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
token_idquerynoThe ID of the token

Responses

StatusDescriptionHas JSON body
500Internal Erroryes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes
403Forbiddenyes
200Responseyes

Update the access to organization resources via fine-grained personal access tokens

POST /orgs/{org}/personal-access-tokens

Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
500Internal Erroryes
404Resource not foundyes
202Acceptedyes
403Forbiddenyes
422Validation failed, or the endpoint has been spammed.yes

Update the access a fine-grained personal access token has to organization resources

POST /orgs/{org}/personal-access-tokens/{pat_id}

Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
pat_idpathyesThe unique identifier of the fine-grained personal access token.

Responses

StatusDescriptionHas JSON body
500Internal Erroryes
404Resource not foundyes
204A header with no content is returned.no
403Forbiddenyes
422Validation failed, or the endpoint has been spammed.yes

List repositories a fine-grained personal access token has access to

GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories

Lists the repositories a fine-grained personal access token has access to.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
pat_idpathyesUnique identifier of the fine-grained personal access token.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
500Internal Erroryes
404Resource not foundyes
403Forbiddenyes
200Responseyes

Get all custom properties for an organization

GET /orgs/{org}/properties/schema

Gets all custom properties defined for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
404Resource not foundyes

Create or update custom properties for an organization

PATCH /orgs/{org}/properties/schema

Creates new or updates existing custom properties defined for an organization in a batch.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
404Resource not foundyes

Get a custom property for an organization

GET /orgs/{org}/properties/schema/{custom_property_name}

Gets a custom property that is defined for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
custom_property_namepathyesThe custom property name

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
404Resource not foundyes

Create or update a custom property for an organization

PUT /orgs/{org}/properties/schema/{custom_property_name}

Creates a new or updates an existing custom property that is defined for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
custom_property_namepathyesThe custom property name

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
404Resource not foundyes

Remove a custom property for an organization

DELETE /orgs/{org}/properties/schema/{custom_property_name}

Removes a custom property that is defined for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
custom_property_namepathyesThe custom property name

Responses

StatusDescriptionHas JSON body
204A header with no content is returned.no
403Forbiddenyes
404Resource not foundyes

List custom property values for organization repositories

GET /orgs/{org}/properties/values

Lists organization repositories with all of their custom property values.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
repository_queryquerynoFinds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see Constructing a search query. See "Searching for repositories" for a detailed list of qualifiers.

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
404Resource not foundyes

Create or update custom property values for organization repositories

PATCH /orgs/{org}/properties/values

Create new or update existing custom property values for repositories in a batch that belong to an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
204No Content when custom property values are successfully created or updatedno
403Forbiddenyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

List public organization members

GET /orgs/{org}/public_members

Members of an organization can choose to have their membership publicized or not.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Check public organization membership for a user

GET /orgs/{org}/public_members/{username}

Check if the provided user is a public member of the organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Response if user is a public memberno
404Not Found if user is not a public memberno

Set public organization membership for the authenticated user

PUT /orgs/{org}/public_members/{username}

The user can publicize their own membership. (A user cannot publicize the membership for another user.)

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno
403Forbiddenyes

Remove public organization membership for the authenticated user

DELETE /orgs/{org}/public_members/{username}

Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno

Get organization ruleset history

GET /orgs/{org}/rulesets/{ruleset_id}/history

Get the history of an organization ruleset.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
ruleset_idpathyesThe ID of the ruleset.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
500Internal Erroryes

Get organization ruleset version

GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}

Get a version of an organization ruleset.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
ruleset_idpathyesThe ID of the ruleset.
version_idpathyesThe ID of the version

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
500Internal Erroryes

List security manager teams

GET /orgs/{org}/security-managers

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes

Add a security manager team

PUT /orgs/{org}/security-managers/teams/{team_slug}

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
team_slugpathyesThe slug of the team name.

Responses

StatusDescriptionHas JSON body
204Responseno

Remove a security manager team

DELETE /orgs/{org}/security-managers/teams/{team_slug}

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
team_slugpathyesThe slug of the team name.

Responses

StatusDescriptionHas JSON body
204Responseno

Get immutable releases settings for an organization

GET /orgs/{org}/settings/immutable-releases

Gets the immutable releases policy for repositories in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Immutable releases settings responseyes

Set immutable releases settings for an organization

PUT /orgs/{org}/settings/immutable-releases

Sets the immutable releases policy for repositories in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
204Responseno

List selected repositories for immutable releases enforcement

GET /orgs/{org}/settings/immutable-releases/repositories

List all of the repositories that have been selected for immutable releases enforcement in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Set selected repositories for immutable releases enforcement

PUT /orgs/{org}/settings/immutable-releases/repositories

Replaces all repositories that have been selected for immutable releases enforcement in an organization. To use this endpoint, the organization immutable releases policy for enforced_repositories must be configured to selected.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
204Responseno

Enable a selected repository for immutable releases in an organization

PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}

Adds a repository to the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for enforced_repositories must be configured to selected.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
repository_idpathyesThe unique identifier of the repository.

Responses

StatusDescriptionHas JSON body
204Responseno

Disable a selected repository for immutable releases in an organization

DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}

Removes a repository from the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for enforced_repositories must be configured to selected.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
repository_idpathyesThe unique identifier of the repository.

Responses

StatusDescriptionHas JSON body
204Responseno

Enable or disable a security feature for an organization

POST /orgs/{org}/{security_product}/{enablement}

Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "Managing security managers in your organization."

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
security_productpathyesThe security feature to enable or disable.
enablementpathyesThe action to take.

Responses

StatusDescriptionHas JSON body
204Action startedno
422The action could not be taken due to an in progress enablement, or a policy is preventing enablementno

List organization memberships for the authenticated user

GET /user/memberships/orgs

Lists all of the authenticated user's organization memberships.

Parameters

NameInRequiredDescription
statequerynoIndicates the state of the memberships to return. If not specified, the API returns both active and pending memberships.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno
403Forbiddenyes
401Requires authenticationyes
422Validation failed, or the endpoint has been spammed.yes

Get an organization membership for the authenticated user

GET /user/memberships/orgs/{org}

If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a 404 is returned. This endpoint will return a 403 if the request is made by a GitHub App that is blocked by the organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
404Resource not foundyes

Update an organization membership for the authenticated user

PATCH /user/memberships/orgs/{org}

Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200The user's organization invitation was accepted synchronously.yes
202The acceptance of the user's organization invitation is being processed asynchronously.yes
403Forbiddenyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

List organizations for the authenticated user

GET /user/orgs

List organizations for the authenticated user.

Parameters

NameInRequiredDescription
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno
403Forbiddenyes
401Requires authenticationyes

List organizations for a user

GET /users/{username}/orgs

List public organization memberships for the specified user.

Parameters

NameInRequiredDescription
usernamepathyesThe handle for the GitHub user account.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes