Organizations
- List your organizations
- List all organizations
- List user organizations
- Get an organization
- Edit an organization
List your organizations
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.
GET /user/orgs
Response
Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
[
{
"login": "github",
"id": 1,
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}
]
List all organizations
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.
GET /organizations
Parameters
Name | Type | Description |
---|---|---|
since |
string |
The integer ID of the last Organization that you've seen. |
Response
Status: 200 OK
Link: <https://api.github.com/organizations?since=135>; rel="next"
[
{
"login": "github",
"id": 1,
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}
]
List user organizations
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 your organizations API instead.
GET /users/:username/orgs
Response
Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
[
{
"login": "github",
"id": 1,
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}
]
Get an organization
GET /orgs/:org
Note: Many Organization response values require the user making the request to be authenticated, an organization owner, and have the admin:org scope authorized.
Note: Two additional fields, members_can_create_repositories
and default_repository_permission
, are currently available for developers to preview. During the preview period, the APIs may change without advance notice.
To use these fields you must provide a custom media type in the Accept
header:
application/vnd.github.korra-preview+json
Response with preview media type
Status: 200 OK
{
"login": "github",
"id": 1,
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization",
"name": "github",
"company": "GitHub",
"blog": "https://github.com/blog",
"location": "San Francisco",
"email": "octocat@github.com",
"public_repos": 2,
"public_gists": 1,
"followers": 20,
"following": 0,
"html_url": "https://github.com/octocat",
"created_at": "2008-01-14T04:33:35Z",
"type": "Organization",
"total_private_repos": 100,
"owned_private_repos": 100,
"private_gists": 81,
"disk_usage": 10000,
"collaborators": 8,
"billing_email": "support@github.com",
"plan": {
"name": "Medium",
"space": 400,
"private_repos": 20
},
"default_repository_settings": "read",
"members_can_create_repositories": "true"
}
Response
Status: 200 OK
{
"login": "github",
"id": 1,
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization",
"name": "github",
"company": "GitHub",
"blog": "https://github.com/blog",
"location": "San Francisco",
"email": "octocat@github.com",
"public_repos": 2,
"public_gists": 1,
"followers": 20,
"following": 0,
"html_url": "https://github.com/octocat",
"created_at": "2008-01-14T04:33:35Z",
"type": "Organization",
"total_private_repos": 100,
"owned_private_repos": 100,
"private_gists": 81,
"disk_usage": 10000,
"collaborators": 8,
"billing_email": "support@github.com",
"plan": {
"name": "Medium",
"space": 400,
"private_repos": 20
}
}
Edit an organization
PATCH /orgs/:org
Note: Two additional fields, members_can_create_repositories
and default_repository_permission
, are currently available for developers to preview. During the preview period, the APIs may change without advance notice.
To use these fields you must provide a custom media type in the Accept
header:
application/vnd.github.korra-preview+json
Input
Name | Type | Description |
---|---|---|
billing_email |
string |
Billing email address. This address is not publicized. |
company |
string |
The company name. |
email |
string |
The publicly visible email address. |
location |
string |
The location. |
name |
string |
The shorthand name of the company. |
description |
string |
The description of the company. |
default_repository_permission |
string |
Default permission level members have for organization repositories: * read - can pull, but not push to or administer this repository.* write - can pull and push, but not administer this repository.* admin - can pull, push and administer this repository.* none - no permissions granted by default.Default: read This parameter requires you to specify a custom media type. Please see the preview alert on this page for more information. |
members_can_create_repositories |
boolean |
Toggles ability of non-admin organization members to create repositories * true - all organization members can create repositories.* false - only admin members can create repositories.Default: true This parameter requires you to specify a custom media type. Please see the preview alert on this page for more information. |
Example
{
"billing_email": "support@github.com",
"blog": "https://github.com/blog",
"company": "GitHub",
"email": "support@github.com",
"location": "San Francisco",
"name": "github",
"description": "GitHub, the company."
}
Response
Status: 200 OK
{
"login": "github",
"id": 1,
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization",
"name": "github",
"company": "GitHub",
"blog": "https://github.com/blog",
"location": "San Francisco",
"email": "octocat@github.com",
"public_repos": 2,
"public_gists": 1,
"followers": 20,
"following": 0,
"html_url": "https://github.com/octocat",
"created_at": "2008-01-14T04:33:35Z",
"type": "Organization",
"total_private_repos": 100,
"owned_private_repos": 100,
"private_gists": 81,
"disk_usage": 10000,
"collaborators": 8,
"billing_email": "support@github.com",
"plan": {
"name": "Medium",
"space": 400,
"private_repos": 20
}
}
Example with preview media type
{
"billing_email": "support@github.com",
"blog": "https://github.com/blog",
"company": "GitHub",
"email": "support@github.com",
"location": "San Francisco",
"name": "github",
"description": "GitHub, the company.",
"default_repository_permission": "read",
"members_can_create_repositories": "true"
}
Response with preview media type
Status: 200 OK
{
"login": "github",
"id": 1,
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization",
"name": "github",
"company": "GitHub",
"blog": "https://github.com/blog",
"location": "San Francisco",
"email": "octocat@github.com",
"public_repos": 2,
"public_gists": 1,
"followers": 20,
"following": 0,
"html_url": "https://github.com/octocat",
"created_at": "2008-01-14T04:33:35Z",
"type": "Organization",
"total_private_repos": 100,
"owned_private_repos": 100,
"private_gists": 81,
"disk_usage": 10000,
"collaborators": 8,
"billing_email": "support@github.com",
"plan": {
"name": "Medium",
"space": 400,
"private_repos": 20
},
"default_repository_settings": "read",
"members_can_create_repositories": "true"
}