| title | Organizations | GitHub API |
|---|
- TOC {:toc}
List organizations for the authenticated user.
Currently, OAuth requests always receive the user's public organization memberships, regardless of the OAuth scopes associated with the request. If the OAuth authorization has user or read:org scope, the response also includes private organization memberships.
With the new Organization Permissions API (described below), this method will only return 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 will require at least user or read:org scope. OAuth requests with insufficient scope will receive a 403 Forbidden response.
We're currently offering a migration period allowing applications to opt in to the Organization Permissions API. This functionality will soon apply to all API consumers. Please see the blog post for full details.
To access the API during the migration period, you must provide a custom media type in the Accept header:
application/vnd.github.moondragon+json
GET /user/orgs
<%= headers 200, :pagination => default_pagination_rels %> <%= json(:org) { |h| [h] } %>
List public organization memberships for the specified user.
Currently, if you make an authenticated call, you can also list your private memberships in organizations (but only for the currently authenticated user).
With the new Organization Permissions API (described below), this method will only list 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.
We're currently offering a migration period allowing applications to opt in to the Organization Permissions API. This functionality will soon apply to all API consumers. Please see the blog post for full details.
To access the API during the migration period, you must provide a custom media type in the Accept header:
application/vnd.github.moondragon+json
GET /users/:username/orgs
<%= headers 200, :pagination => default_pagination_rels %> <%= json(:org) { |h| [h] } %>
GET /orgs/:org
<%= headers 200 %> <%= json(:full_org) %>
PATCH /orgs/:org
| 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. |
<%= json
: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."
%>
<%= headers 200 %> <%= json(:private_org) %>