GitHub v3 REST API

Get an organization

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 Enterprise Server plan. See “Authenticating with GitHub Apps” for details. For an example response, see ‘Response with GitHub Enterprise Server plan information’ below."

get
http://HOSTNAME/api/v3/orgs/{org}

Path Parameters

orgstringrequired

Response

application/json

Response

Organization Full

Organization Full

loginstringrequired

Example:github

idintegerrequired

Example:1

node_idstringrequired

Example:MDEyOk9yZ2FuaXphdGlvbjE=

urlstring(uri)required

Example:https://api.github.com/orgs/github

repos_urlstring(uri)required

Example:https://api.github.com/orgs/github/repos

events_urlstring(uri)required

Example:https://api.github.com/orgs/github/events

hooks_urlstringrequired

Example:https://api.github.com/orgs/github/hooks

issues_urlstringrequired

Example:https://api.github.com/orgs/github/issues

members_urlstringrequired

Example:https://api.github.com/orgs/github/members{/member}

public_members_urlstringrequired

Example:https://api.github.com/orgs/github/public_members{/member}

avatar_urlstringrequired

Example:https://github.com/images/error/octocat_happy.gif

descriptionstring | nullrequired

Example:A great organization

namestring

Example:github

companystring

Example:GitHub

blogstring(uri)

Example:https://github.com/blog

locationstring

Example:San Francisco

emailstring(email)

Example:octocat@github.com

twitter_usernamestring | null

Example:github

is_verifiedboolean

Example:true

has_organization_projectsbooleanrequired

Example:true

has_repository_projectsbooleanrequired

Example:true

public_reposintegerrequired

Example:2

public_gistsintegerrequired

Example:1

followersintegerrequired

Example:20

followingintegerrequired

Example:0

html_urlstring(uri)required

Example:https://github.com/octocat

created_atstring(date-time)required

Example:2008-01-14T04:33:35Z

typestringrequired

Example:Organization

total_private_reposinteger

Example:100

owned_private_reposinteger

Example:100

private_gistsinteger | null

Example:81

disk_usageinteger | null

Example:10000

collaboratorsinteger | null

Example:8

billing_emailstring | null(email)

Example:org@example.com

planobject
Show Child Parameters
default_repository_permissionstring | null
members_can_create_repositoriesboolean | null

Example:true

two_factor_requirement_enabledboolean | null

Example:true

members_allowed_repository_creation_typestring

Example:all

members_can_create_public_repositoriesboolean

Example:true

members_can_create_private_repositoriesboolean

Example:true

members_can_create_internal_repositoriesboolean

Example:true

members_can_create_pagesboolean

Example:true

members_can_create_public_pagesboolean

Example:true

members_can_create_private_pagesboolean

Example:true

members_can_fork_private_repositoriesboolean | null

Example:false

updated_atstring(date-time)required
get/orgs/{org}
 
application/json

Update an organization

Parameter Deprecation Notice: GitHub Enterprise Server 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.

patch
http://HOSTNAME/api/v3/orgs/{org}

Path Parameters

orgstringrequired

Body

application/json
billing_emailstring

Billing email address. This address is not publicized.

companystring

The company name.

emailstring

The publicly visible email address.

twitter_usernamestring

The Twitter username of the company.

locationstring

The location.

namestring

The shorthand name of the company.

descriptionstring

The description of the company.

has_organization_projectsboolean

Toggles whether an organization can use organization projects.

has_repository_projectsboolean

Toggles whether repositories that belong to the organization can use repository projects.

default_repository_permissionstring

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.

Allowed values:readwriteadminnone

Default:read

members_can_create_repositoriesboolean

Toggles the ability of non-admin organization members to create repositories. Can be one of:
* true - all organization members can create repositories.
* false - only organization owners can create repositories.
Default: true
Note: A parameter can override this parameter. See members_allowed_repository_creation_type in this table for details. Note: A parameter can override this parameter. See members_allowed_repository_creation_type in this table for details.

Default:true

members_can_create_internal_repositoriesboolean

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:
* true - all organization members can create internal repositories.
* false - only organization owners can create internal repositories.
Default: true. For more information, see “Restricting repository creation in your organization” in the GitHub Help documentation.

members_can_create_private_repositoriesboolean

Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of:
* true - all organization members can create private repositories.
* false - only organization owners can create private repositories.
Default: true. For more information, see “Restricting repository creation in your organization” in the GitHub Help documentation.

members_can_create_public_repositoriesboolean

Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of:
* true - all organization members can create public repositories.
* false - only organization owners can create public repositories.
Default: true. For more information, see “Restricting repository creation in your organization” in the GitHub Help documentation.

members_allowed_repository_creation_typestring

Specifies which types of repositories non-admin organization members can create. Can be one of:
* all - all organization members can create public and private repositories.
* private - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud.
* none - only admin members can create repositories.
Note: This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in members_can_create_repositories. See the parameter deprecation notice in the operation description for details.

Allowed values:allprivatenone

members_can_create_pagesboolean

Toggles whether organization members can create GitHub Pages sites. Can be one of:
* true - all organization members can create GitHub Pages sites.
* false - no organization members can create GitHub Pages sites. Existing published sites will not be impacted.

Default:true

members_can_fork_private_repositoriesboolean

Toggles whether organization members can fork private organization repositories. Can be one of:
* true - all organization members can fork private repositories within the organization.
* false - no organization members can fork private repositories within the organization.

Default:false

blogstring

Example:"http://github.blog"

Response

application/json

Response

Organization Full

Organization Full

loginstringrequired

Example:github

idintegerrequired

Example:1

node_idstringrequired

Example:MDEyOk9yZ2FuaXphdGlvbjE=

urlstring(uri)required

Example:https://api.github.com/orgs/github

repos_urlstring(uri)required

Example:https://api.github.com/orgs/github/repos

events_urlstring(uri)required

Example:https://api.github.com/orgs/github/events

hooks_urlstringrequired

Example:https://api.github.com/orgs/github/hooks

issues_urlstringrequired

Example:https://api.github.com/orgs/github/issues

members_urlstringrequired

Example:https://api.github.com/orgs/github/members{/member}

public_members_urlstringrequired

Example:https://api.github.com/orgs/github/public_members{/member}

avatar_urlstringrequired

Example:https://github.com/images/error/octocat_happy.gif

descriptionstring | nullrequired

Example:A great organization

namestring

Example:github

companystring

Example:GitHub

blogstring(uri)

Example:https://github.com/blog

locationstring

Example:San Francisco

emailstring(email)

Example:octocat@github.com

twitter_usernamestring | null

Example:github

is_verifiedboolean

Example:true

has_organization_projectsbooleanrequired

Example:true

has_repository_projectsbooleanrequired

Example:true

public_reposintegerrequired

Example:2

public_gistsintegerrequired

Example:1

followersintegerrequired

Example:20

followingintegerrequired

Example:0

html_urlstring(uri)required

Example:https://github.com/octocat

created_atstring(date-time)required

Example:2008-01-14T04:33:35Z

typestringrequired

Example:Organization

total_private_reposinteger

Example:100

owned_private_reposinteger

Example:100

private_gistsinteger | null

Example:81

disk_usageinteger | null

Example:10000

collaboratorsinteger | null

Example:8

billing_emailstring | null(email)

Example:org@example.com

planobject
Show Child Parameters
default_repository_permissionstring | null
members_can_create_repositoriesboolean | null

Example:true

two_factor_requirement_enabledboolean | null

Example:true

members_allowed_repository_creation_typestring

Example:all

members_can_create_public_repositoriesboolean

Example:true

members_can_create_private_repositoriesboolean

Example:true

members_can_create_internal_repositoriesboolean

Example:true

members_can_create_pagesboolean

Example:true

members_can_create_public_pagesboolean

Example:true

members_can_create_private_pagesboolean

Example:true

members_can_fork_private_repositoriesboolean | null

Example:false

updated_atstring(date-time)required
patch/orgs/{org}

Body

{ "billing_email": "mona@github.com", "company": "GitHub", "email": "mona@github.com", "twitter_username": "github", "location": "San Francisco", "name": "github", "description": "GitHub, the company.", "default_repository_permission": "read", "members_can_create_repositories": true, "members_allowed_repository_creation_type": "all" }
 
application/json

List organization webhooks

get
http://HOSTNAME/api/v3/orgs/{org}/hooks

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

orgstringrequired

Response

application/json

Response

Org Hook

idintegerrequired

Example:1

urlstring(uri)required

Example:https://api.github.com/orgs/octocat/hooks/1

ping_urlstring(uri)required

Example:https://api.github.com/orgs/octocat/hooks/1/pings

namestringrequired

Example:web

eventsarray[string]required

Example:["push","pull_request"]

activebooleanrequired

Example:true

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

Example:2011-09-06T20:39:23Z

created_atstring(date-time)required

Example:2011-09-06T17:26:27Z

typestringrequired
get/orgs/{org}/hooks
 
application/json

Create an organization webhook

Here’s how you can create a hook that posts payloads in JSON format:

post
http://HOSTNAME/api/v3/orgs/{org}/hooks

Path Parameters

orgstringrequired

Body

application/json
namestringrequired

Must be passed as “web”.

configobjectrequired

Key/value pairs to provide settings for this webhook. These are defined below.

Show Child Parameters
eventsarray[string]

Determines what events the hook is triggered for.

Default:push

activeboolean

Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.

Default:true

Response

application/json

Response

Org Hook

Org Hook

idintegerrequired

Example:1

urlstring(uri)required

Example:https://api.github.com/orgs/octocat/hooks/1

ping_urlstring(uri)required

Example:https://api.github.com/orgs/octocat/hooks/1/pings

namestringrequired

Example:web

eventsarray[string]required

Example:["push","pull_request"]

activebooleanrequired

Example:true

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

Example:2011-09-06T20:39:23Z

created_atstring(date-time)required

Example:2011-09-06T17:26:27Z

typestringrequired
post/orgs/{org}/hooks

Body

{ "name": "web", "active": true, "events": [ "push", "pull_request" ], "config": { "url": "http://example.com/webhook", "content_type": "json" } }
 
application/json

Get an organization webhook

Returns a webhook configured in an organization. To get only the webhook config properties, see “Get a webhook configuration for an organization.”

get
http://HOSTNAME/api/v3/orgs/{org}/hooks/{hook_id}

Path Parameters

orgstringrequired
hook_idintegerrequired

Response

application/json

Response

Org Hook

Org Hook

idintegerrequired

Example:1

urlstring(uri)required

Example:https://api.github.com/orgs/octocat/hooks/1

ping_urlstring(uri)required

Example:https://api.github.com/orgs/octocat/hooks/1/pings

namestringrequired

Example:web

eventsarray[string]required

Example:["push","pull_request"]

activebooleanrequired

Example:true

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

Example:2011-09-06T20:39:23Z

created_atstring(date-time)required

Example:2011-09-06T17:26:27Z

typestringrequired
get/orgs/{org}/hooks/{hook_id}
 
application/json