Interact with GitHub Teams.

Get an external group

get /orgs/{org}/external-group/{group_id}

Displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.

org

string

required

The organization name. The name is not case sensitive.

group_id

int

required

The unique identifier of the group.

Response

Examples Schema

Response

{
  "group_id": "123",
  "group_name": "Octocat admins",
  "updated_at": "2021-01-24T11:31:04-06:00",
  "teams": [
    {
      "team_id": 1,
      "team_name": "team-test"
    },
    {
      "team_id": 2,
      "team_name": "team-test2"
    }
  ],
  "members": [
    {
      "member_id": 1,
      "member_login": "mona-lisa_eocsaxrs",
      "member_name": "Mona Lisa",
      "member_email": "mona_lisa@github.com"
    },
    {
      "member_id": 2,
      "member_login": "octo-lisa_eocsaxrs",
      "member_name": "Octo Lisa",
      "member_email": "octo_lisa@github.com"
    }
  ]
}

group_id

int

required

The internal ID of the group

Example
1

group_name

string

required

The display name for the group

Example
"group-azuread-test"

updated_at

string

The date when the group was last updated_at

Example
"2021-01-03 22:27:15:000 -700"

teams

array[object]

required

An array of teams linked to this group

Example
[ { "team_id": 1, "team_name": "team-test" }, { "team_id": 2, "team_name": "team-test2" } ]

object

team_id

int

required

The id for a team

Example
1

team_name

string

required

The name of the team

Example
"team-test"

members

array[object]

required

An array of external members linked to this group

Example
[ { "member_id": 1, "member_login": "mona-lisa_eocsaxrs", "member_name": "Mona Lisa", "member_email": "mona_lisa@github.com" }, { "member_id": 2, "member_login": "octo-lisa_eocsaxrs", "member_name": "Octo Lisa", "member_email": "octo_lisa@github.com" } ]

object

member_id

int

required

The internal user ID of the identity

Example
1

member_login

string

required

The handle/login for the user

Example
"mona-lisa_eocsaxrs"

member_name

string

required

The user display name/profile name

Example
"Mona Lisa"

member_email

string

required

An email attached to a user

Example
"mona_lisa@github.com"

List external groups in an organization

get /orgs/{org}/external-groups

Lists external groups available in an organization. You can query the groups using the display_name parameter, only groups with a group_name containing the text provided in the display_name parameter will be returned. You can also limit your page results using the per_page parameter. GitHub Enterprise Server generates a url-encoded page token using a cursor value for where the next page begins. For more information on cursor pagination, see "Offset and Cursor Pagination explained."

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.

org

string

required

The organization name. The name is not case sensitive.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page token

display_name

string

Limits the list to groups containing the text in the group name

Response

Examples Schema

Response

{
  "groups": [
    {
      "group_id": "123",
      "group_name": "Octocat admins",
      "updated_at": "2021-01-24T11:31:04-06:00"
    },
    {
      "group_id": "456",
      "group_name": "Octocat docs members",
      "updated_at": "2021-03-24T11:31:04-06:00"
    }
  ]
}

groups

array[object]

An array of external groups available to be mapped to a team

Example
[ { "group_id": 1, "group_name": "group-azuread-test", "updated_at": "2021-01-03 22:27:15:000 -700" }, { "group_id": 2, "group_name": "group-azuread-test2", "updated_at": "2021-06-03 22:27:15:000 -700" } ]

object

group_id

int

required

The internal ID of the group

Example
1

group_name

string

required

The display name of the group

Example
"group-azuread-test"

updated_at

string

required

The time of the last update for this group

Example
"2019-06-03 22:27:15:000 -700"

Link

string

List teams

get /orgs/{org}/teams

Lists all teams in an organization that are visible to the authenticated user.

org

string

required

The organization name. The name is not case sensitive.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "id": 1,
    "node_id": "MDQ6VGVhbTE=",
    "url": "https://api.github.com/teams/1",
    "html_url": "https://github.com/orgs/github/teams/justice-league",
    "name": "Justice League",
    "slug": "justice-league",
    "description": "A great team.",
    "privacy": "closed",
    "permission": "admin",
    "members_url": "https://api.github.com/teams/1/members{/member}",
    "repositories_url": "https://api.github.com/teams/1/repos",
    "parent": null
  }
]

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

array[object (Team)]

Team

object (Team)

Groups of organization members that gives permissions on specified repositories.

id

int

required

node_id

string

required

name

string

required

slug

string

required

description

string or null

required

privacy

string

permission

string

required

permissions

object (permissions)

pull

boolean

required

triage

boolean

required

push

boolean

required

maintain

boolean

required

admin

boolean

required

url

string

uri

required

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

members_url

string

required

repositories_url

string

uri

required

parent

object (parent) or null

required

Groups of organization members that gives permissions on specified repositories.

id

int

required

Unique identifier of the team

Example
1

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

name

string

required

Name of the team

Example
"Justice League"

description

string or null

required

Description of the team

Example
"A great team."

permission

string

required

Permission that the team will have for its repositories

Example
"admin"

privacy

string

The level of privacy this team should have

Example
"closed"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

slug

string

required

Example
"justice-league"

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

Link

string

message

string

documentation_url

string

url

string

status

string

Create a team

post /orgs/{org}/teams

To create a team, the authenticated user must be a member or owner of {org}. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "Setting team creation permissions."

When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of maintainers. For more information, see "About teams".

org

string

required

The organization name. The name is not case sensitive.

name

string

required

The name of the team.

description

string

The description of the team.

maintainers

array[string]

List GitHub IDs for organization members who will become team maintainers.

string

repo_names

array[string]

The full name (e.g., "organization-name/repository-name") of repositories to add the team to.

string

privacy

string

The level of privacy this team should have. The options are:
For a non-nested team:

  • secret - only visible to organization owners and members of this team.
  • closed - visible to all members of this organization.
    Default: secret
    For a parent or child team:
  • closed - visible to all members of this organization.
    Default for child team: closed
Enum
  • secret
  • closed

permission

string

Deprecated. The permission that new repositories will be added to the team with when none is specified.

Default
"pull"
Enum
  • pull
  • push

parent_team_id

int

The ID of a team to set as the parent team.

ldap_dn

string

The distinguished name (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the "Update LDAP mapping for a team" endpoint to change the LDAP DN. For more information, see "Using LDAP."

Request

{
  "name": "Justice League",
  "description": "A great team",
  "permission": "push",
  "privacy": "closed"
}

Response

Examples Schema

Response

{
  "id": 1,
  "node_id": "MDQ6VGVhbTE=",
  "url": "https://api.github.com/teams/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league",
  "name": "Justice League",
  "slug": "justice-league",
  "description": "A great team.",
  "privacy": "closed",
  "permission": "admin",
  "members_url": "https://api.github.com/teams/1/members{/member}",
  "repositories_url": "https://api.github.com/teams/1/repos",
  "members_count": 3,
  "repos_count": 10,
  "created_at": "2017-07-14T16:53:42Z",
  "updated_at": "2017-08-17T12:37:15Z",
  "organization": {
    "login": "github",
    "id": 1,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
    "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",
    "has_organization_projects": true,
    "has_repository_projects": true,
    "public_repos": 2,
    "public_gists": 1,
    "followers": 20,
    "following": 0,
    "html_url": "https://github.com/octocat",
    "created_at": "2008-01-14T04:33:35Z",
    "updated_at": "2017-08-17T12:37:15Z",
    "type": "Organization"
  },
  "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com"
}

Validation failed, or the endpoint has been spammed.

{
  "message": "string",
  "documentation_url": "string",
  "errors": [
    {
      "resource": "string",
      "field": "string",
      "message": "string",
      "code": "string",
      "index": 123,
      "value": "string"
    }
  ]
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

id

int

required

Unique identifier of the team

Example
42

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

name

string

required

Name of the team

Example
"Developers"

slug

string

required

Example
"justice-league"

description

string or null

required

Example
"A great team."

privacy

string

The level of privacy this team should have

Enum
  • closed
  • secret
Example
"closed"

permission

string

required

Permission that the team will have for its repositories

Example
"push"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

parent

object (parent) or null

Groups of organization members that gives permissions on specified repositories.

id

int

required

Unique identifier of the team

Example
1

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

name

string

required

Name of the team

Example
"Justice League"

description

string or null

required

Description of the team

Example
"A great team."

permission

string

required

Permission that the team will have for its repositories

Example
"admin"

privacy

string

The level of privacy this team should have

Example
"closed"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

slug

string

required

Example
"justice-league"

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

members_count

int

required

Example
3

repos_count

int

required

Example
10

created_at

string

date-time

required

Example
"2017-07-14T16:53:42Z"

updated_at

string

date-time

required

Example
"2017-08-17T12:37:15Z"

organization

object (organization)

required

Team Organization

login

string

required

Example
"github"

id

int

required

Example
1

node_id

string

required

Example
"MDEyOk9yZ2FuaXphdGlvbjE="

url

string

uri

required

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

repos_url

string

uri

required

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

events_url

string

uri

required

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

hooks_url

string

required

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

issues_url

string

required

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

members_url

string

required

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

public_members_url

string

required

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

avatar_url

string

required

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

description

string or null

required

Example
"A great organization"

name

string

Example
"github"

company

string

Example
"GitHub"

blog

string

uri

Example
"https://github.com/blog"

location

string

Example
"San Francisco"

email

string

email

Example
"octocat@github.com"

twitter_username

string or null

Example
"github"

is_verified

boolean

Example
true

has_organization_projects

boolean

required

Example
true

has_repository_projects

boolean

required

Example
true

public_repos

int

required

Example
2

public_gists

int

required

Example
1

followers

int

required

Example
20

following

int

required

Example
0

html_url

string

uri

required

Example
"https://github.com/octocat"

created_at

string

date-time

required

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

type

string

required

Example
"Organization"

total_private_repos

int

Example
100

owned_private_repos

int

Example
100

private_gists

int or null

Example
81

disk_usage

int or null

Example
10000

collaborators

int or null

Example
8

billing_email

string or null

email

Example
"org@example.com"

plan

object (plan)

name

string

required

space

int

required

private_repos

int

required

filled_seats

int

seats

int

default_repository_permission

string or null

members_can_create_repositories

boolean or null

Example
true

two_factor_requirement_enabled

boolean or null

Example
true

members_allowed_repository_creation_type

string

Example
"all"

members_can_create_public_repositories

boolean

Example
true

members_can_create_private_repositories

boolean

Example
true

members_can_create_internal_repositories

boolean

Example
true

members_can_create_pages

boolean

Example
true

members_can_create_public_pages

boolean

Example
true

members_can_create_private_pages

boolean

Example
true

members_can_fork_private_repositories

boolean or null

Example
false

web_commit_signoff_required

boolean

Example
false

updated_at

string

date-time

required

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

message

string

required

documentation_url

string

required

errors

array[object]

object

resource

string

field

string

message

string

code

string

required

index

int

value

One Of

string or null

int or null

array[string] or null

string

message

string

documentation_url

string

url

string

status

string

Get a team by name

get /orgs/{org}/teams/{team_slug}

Gets a team using the team's slug. To create the slug, GitHub Enterprise Server replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a - separator. For example, "My TEam Näme" would become my-team-name.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

Response

Examples Schema

Response

{
  "id": 1,
  "node_id": "MDQ6VGVhbTE=",
  "url": "https://api.github.com/teams/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league",
  "name": "Justice League",
  "slug": "justice-league",
  "description": "A great team.",
  "privacy": "closed",
  "permission": "admin",
  "members_url": "https://api.github.com/teams/1/members{/member}",
  "repositories_url": "https://api.github.com/teams/1/repos",
  "members_count": 3,
  "repos_count": 10,
  "created_at": "2017-07-14T16:53:42Z",
  "updated_at": "2017-08-17T12:37:15Z",
  "organization": {
    "login": "github",
    "id": 1,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
    "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",
    "has_organization_projects": true,
    "has_repository_projects": true,
    "public_repos": 2,
    "public_gists": 1,
    "followers": 20,
    "following": 0,
    "html_url": "https://github.com/octocat",
    "created_at": "2008-01-14T04:33:35Z",
    "updated_at": "2017-08-17T12:37:15Z",
    "type": "Organization"
  },
  "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com"
}

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

id

int

required

Unique identifier of the team

Example
42

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

name

string

required

Name of the team

Example
"Developers"

slug

string

required

Example
"justice-league"

description

string or null

required

Example
"A great team."

privacy

string

The level of privacy this team should have

Enum
  • closed
  • secret
Example
"closed"

permission

string

required

Permission that the team will have for its repositories

Example
"push"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

parent

object (parent) or null

Groups of organization members that gives permissions on specified repositories.

id

int

required

Unique identifier of the team

Example
1

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

name

string

required

Name of the team

Example
"Justice League"

description

string or null

required

Description of the team

Example
"A great team."

permission

string

required

Permission that the team will have for its repositories

Example
"admin"

privacy

string

The level of privacy this team should have

Example
"closed"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

slug

string

required

Example
"justice-league"

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

members_count

int

required

Example
3

repos_count

int

required

Example
10

created_at

string

date-time

required

Example
"2017-07-14T16:53:42Z"

updated_at

string

date-time

required

Example
"2017-08-17T12:37:15Z"

organization

object (organization)

required

Team Organization

login

string

required

Example
"github"

id

int

required

Example
1

node_id

string

required

Example
"MDEyOk9yZ2FuaXphdGlvbjE="

url

string

uri

required

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

repos_url

string

uri

required

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

events_url

string

uri

required

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

hooks_url

string

required

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

issues_url

string

required

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

members_url

string

required

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

public_members_url

string

required

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

avatar_url

string

required

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

description

string or null

required

Example
"A great organization"

name

string

Example
"github"

company

string

Example
"GitHub"

blog

string

uri

Example
"https://github.com/blog"

location

string

Example
"San Francisco"

email

string

email

Example
"octocat@github.com"

twitter_username

string or null

Example
"github"

is_verified

boolean

Example
true

has_organization_projects

boolean

required

Example
true

has_repository_projects

boolean

required

Example
true

public_repos

int

required

Example
2

public_gists

int

required

Example
1

followers

int

required

Example
20

following

int

required

Example
0

html_url

string

uri

required

Example
"https://github.com/octocat"

created_at

string

date-time

required

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

type

string

required

Example
"Organization"

total_private_repos

int

Example
100

owned_private_repos

int

Example
100

private_gists

int or null

Example
81

disk_usage

int or null

Example
10000

collaborators

int or null

Example
8

billing_email

string or null

email

Example
"org@example.com"

plan

object (plan)

name

string

required

space

int

required

private_repos

int

required

filled_seats

int

seats

int

default_repository_permission

string or null

members_can_create_repositories

boolean or null

Example
true

two_factor_requirement_enabled

boolean or null

Example
true

members_allowed_repository_creation_type

string

Example
"all"

members_can_create_public_repositories

boolean

Example
true

members_can_create_private_repositories

boolean

Example
true

members_can_create_internal_repositories

boolean

Example
true

members_can_create_pages

boolean

Example
true

members_can_create_public_pages

boolean

Example
true

members_can_create_private_pages

boolean

Example
true

members_can_fork_private_repositories

boolean or null

Example
false

web_commit_signoff_required

boolean

Example
false

updated_at

string

date-time

required

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

message

string

documentation_url

string

url

string

status

string

Delete a team

delete /orgs/{org}/teams/{team_slug}

To delete a team, the authenticated user must be an organization owner or team maintainer.

If you are an organization owner, deleting a parent team will delete all of its child teams as well.

Note: You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

Response

Examples Schema

Response

Empty response

No schema

Update a team

patch /orgs/{org}/teams/{team_slug}

To edit a team, the authenticated user must either be an organization owner or a team maintainer.

Note: You can also specify a team by org_id and team_id using the route PATCH /organizations/{org_id}/team/{team_id}.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

name

string

The name of the team.

description

string

The description of the team.

privacy

string

The level of privacy this team should have. Editing teams without specifying this parameter leaves privacy intact. When a team is nested, the privacy for parent teams cannot be secret. The options are:
For a non-nested team:

  • secret - only visible to organization owners and members of this team.
  • closed - visible to all members of this organization.
    For a parent or child team:
  • closed - visible to all members of this organization.
Enum
  • secret
  • closed

permission

string

Deprecated. The permission that new repositories will be added to the team with when none is specified.

Default
"pull"
Enum
  • pull
  • push
  • admin

parent_team_id

int or null

The ID of a team to set as the parent team.

Request

{
  "name": "new team name",
  "description": "new team description",
  "privacy": "closed"
}

Response

Examples Schema

Response when the updated information already exists

{
  "id": 1,
  "node_id": "MDQ6VGVhbTE=",
  "url": "https://api.github.com/teams/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league",
  "name": "Justice League",
  "slug": "justice-league",
  "description": "A great team.",
  "privacy": "closed",
  "permission": "admin",
  "members_url": "https://api.github.com/teams/1/members{/member}",
  "repositories_url": "https://api.github.com/teams/1/repos",
  "members_count": 3,
  "repos_count": 10,
  "created_at": "2017-07-14T16:53:42Z",
  "updated_at": "2017-08-17T12:37:15Z",
  "organization": {
    "login": "github",
    "id": 1,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
    "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",
    "has_organization_projects": true,
    "has_repository_projects": true,
    "public_repos": 2,
    "public_gists": 1,
    "followers": 20,
    "following": 0,
    "html_url": "https://github.com/octocat",
    "created_at": "2008-01-14T04:33:35Z",
    "updated_at": "2017-08-17T12:37:15Z",
    "type": "Organization"
  },
  "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com"
}

Response

{
  "id": 1,
  "node_id": "MDQ6VGVhbTE=",
  "url": "https://api.github.com/teams/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league",
  "name": "Justice League",
  "slug": "justice-league",
  "description": "A great team.",
  "privacy": "closed",
  "permission": "admin",
  "members_url": "https://api.github.com/teams/1/members{/member}",
  "repositories_url": "https://api.github.com/teams/1/repos",
  "members_count": 3,
  "repos_count": 10,
  "created_at": "2017-07-14T16:53:42Z",
  "updated_at": "2017-08-17T12:37:15Z",
  "organization": {
    "login": "github",
    "id": 1,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
    "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",
    "has_organization_projects": true,
    "has_repository_projects": true,
    "public_repos": 2,
    "public_gists": 1,
    "followers": 20,
    "following": 0,
    "html_url": "https://github.com/octocat",
    "created_at": "2008-01-14T04:33:35Z",
    "updated_at": "2017-08-17T12:37:15Z",
    "type": "Organization"
  },
  "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com"
}

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Validation failed, or the endpoint has been spammed.

{
  "message": "string",
  "documentation_url": "string",
  "errors": [
    {
      "resource": "string",
      "field": "string",
      "message": "string",
      "code": "string",
      "index": 123,
      "value": "string"
    }
  ]
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

id

int

required

Unique identifier of the team

Example
42

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

name

string

required

Name of the team

Example
"Developers"

slug

string

required

Example
"justice-league"

description

string or null

required

Example
"A great team."

privacy

string

The level of privacy this team should have

Enum
  • closed
  • secret
Example
"closed"

permission

string

required

Permission that the team will have for its repositories

Example
"push"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

parent

object (parent) or null

Groups of organization members that gives permissions on specified repositories.

id

int

required

Unique identifier of the team

Example
1

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

name

string

required

Name of the team

Example
"Justice League"

description

string or null

required

Description of the team

Example
"A great team."

permission

string

required

Permission that the team will have for its repositories

Example
"admin"

privacy

string

The level of privacy this team should have

Example
"closed"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

slug

string

required

Example
"justice-league"

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

members_count

int

required

Example
3

repos_count

int

required

Example
10

created_at

string

date-time

required

Example
"2017-07-14T16:53:42Z"

updated_at

string

date-time

required

Example
"2017-08-17T12:37:15Z"

organization

object (organization)

required

Team Organization

login

string

required

Example
"github"

id

int

required

Example
1

node_id

string

required

Example
"MDEyOk9yZ2FuaXphdGlvbjE="

url

string

uri

required

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

repos_url

string

uri

required

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

events_url

string

uri

required

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

hooks_url

string

required

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

issues_url

string

required

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

members_url

string

required

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

public_members_url

string

required

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

avatar_url

string

required

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

description

string or null

required

Example
"A great organization"

name

string

Example
"github"

company

string

Example
"GitHub"

blog

string

uri

Example
"https://github.com/blog"

location

string

Example
"San Francisco"

email

string

email

Example
"octocat@github.com"

twitter_username

string or null

Example
"github"

is_verified

boolean

Example
true

has_organization_projects

boolean

required

Example
true

has_repository_projects

boolean

required

Example
true

public_repos

int

required

Example
2

public_gists

int

required

Example
1

followers

int

required

Example
20

following

int

required

Example
0

html_url

string

uri

required

Example
"https://github.com/octocat"

created_at

string

date-time

required

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

type

string

required

Example
"Organization"

total_private_repos

int

Example
100

owned_private_repos

int

Example
100

private_gists

int or null

Example
81

disk_usage

int or null

Example
10000

collaborators

int or null

Example
8

billing_email

string or null

email

Example
"org@example.com"

plan

object (plan)

name

string

required

space

int

required

private_repos

int

required

filled_seats

int

seats

int

default_repository_permission

string or null

members_can_create_repositories

boolean or null

Example
true

two_factor_requirement_enabled

boolean or null

Example
true

members_allowed_repository_creation_type

string

Example
"all"

members_can_create_public_repositories

boolean

Example
true

members_can_create_private_repositories

boolean

Example
true

members_can_create_internal_repositories

boolean

Example
true

members_can_create_pages

boolean

Example
true

members_can_create_public_pages

boolean

Example
true

members_can_create_private_pages

boolean

Example
true

members_can_fork_private_repositories

boolean or null

Example
false

web_commit_signoff_required

boolean

Example
false

updated_at

string

date-time

required

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

id

int

required

Unique identifier of the team

Example
42

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

name

string

required

Name of the team

Example
"Developers"

slug

string

required

Example
"justice-league"

description

string or null

required

Example
"A great team."

privacy

string

The level of privacy this team should have

Enum
  • closed
  • secret
Example
"closed"

permission

string

required

Permission that the team will have for its repositories

Example
"push"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

parent

object (parent) or null

Groups of organization members that gives permissions on specified repositories.

id

int

required

Unique identifier of the team

Example
1

node_id

string

required

Example
"MDQ6VGVhbTE="

url

string

uri

required

URL for the team

Example
"https://api.github.com/organizations/1/team/1"

members_url

string

required

Example
"https://api.github.com/organizations/1/team/1/members{/member}"

name

string

required

Name of the team

Example
"Justice League"

description

string or null

required

Description of the team

Example
"A great team."

permission

string

required

Permission that the team will have for its repositories

Example
"admin"

privacy

string

The level of privacy this team should have

Example
"closed"

html_url

string

uri

required

Example
"https://github.com/orgs/rails/teams/core"

repositories_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/1/repos"

slug

string

required

Example
"justice-league"

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

members_count

int

required

Example
3

repos_count

int

required

Example
10

created_at

string

date-time

required

Example
"2017-07-14T16:53:42Z"

updated_at

string

date-time

required

Example
"2017-08-17T12:37:15Z"

organization

object (organization)

required

Team Organization

login

string

required

Example
"github"

id

int

required

Example
1

node_id

string

required

Example
"MDEyOk9yZ2FuaXphdGlvbjE="

url

string

uri

required

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

repos_url

string

uri

required

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

events_url

string

uri

required

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

hooks_url

string

required

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

issues_url

string

required

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

members_url

string

required

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

public_members_url

string

required

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

avatar_url

string

required

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

description

string or null

required

Example
"A great organization"

name

string

Example
"github"

company

string

Example
"GitHub"

blog

string

uri

Example
"https://github.com/blog"

location

string

Example
"San Francisco"

email

string

email

Example
"octocat@github.com"

twitter_username

string or null

Example
"github"

is_verified

boolean

Example
true

has_organization_projects

boolean

required

Example
true

has_repository_projects

boolean

required

Example
true

public_repos

int

required

Example
2

public_gists

int

required

Example
1

followers

int

required

Example
20

following

int

required

Example
0

html_url

string

uri

required

Example
"https://github.com/octocat"

created_at

string

date-time

required

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

type

string

required

Example
"Organization"

total_private_repos

int

Example
100

owned_private_repos

int

Example
100

private_gists

int or null

Example
81

disk_usage

int or null

Example
10000

collaborators

int or null

Example
8

billing_email

string or null

email

Example
"org@example.com"

plan

object (plan)

name

string

required

space

int

required

private_repos

int

required

filled_seats

int

seats

int

default_repository_permission

string or null

members_can_create_repositories

boolean or null

Example
true

two_factor_requirement_enabled

boolean or null

Example
true

members_allowed_repository_creation_type

string

Example
"all"

members_can_create_public_repositories

boolean

Example
true

members_can_create_private_repositories

boolean

Example
true

members_can_create_internal_repositories

boolean

Example
true

members_can_create_pages

boolean

Example
true

members_can_create_public_pages

boolean

Example
true

members_can_create_private_pages

boolean

Example
true

members_can_fork_private_repositories

boolean or null

Example
false

web_commit_signoff_required

boolean

Example
false

updated_at

string

date-time

required

ldap_dn

string

Distinguished Name (DN) that team maps to within LDAP environment

Example
"uid=example,ou=users,dc=github,dc=com"

message

string

documentation_url

string

url

string

status

string

message

string

required

documentation_url

string

required

errors

array[object]

object

resource

string

field

string

message

string

code

string

required

index

int

value

One Of

string or null

int or null

array[string] or null

string

message

string

documentation_url

string

url

string

status

string

List discussions

get /orgs/{org}/teams/{team_slug}/discussions

List all discussions on a team's page. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

direction

string

The direction to sort the results by.

Default
"desc"
Enum
  • asc
  • desc

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

pinned

string

Pinned discussions only filter

Response

Examples Schema

Response

[
  {
    "author": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "body": "Hi! This is an area for us to collaborate as a team.",
    "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>",
    "body_version": "0d495416a700fb06133c612575d92bfb",
    "comments_count": 0,
    "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments",
    "created_at": "2018-01-25T18:56:31Z",
    "last_edited_at": null,
    "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1",
    "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==",
    "number": 1,
    "pinned": false,
    "private": false,
    "team_url": "https://api.github.com/teams/2343027",
    "title": "Our first team post",
    "updated_at": "2018-01-25T18:56:31Z",
    "url": "https://api.github.com/teams/2343027/discussions/1",
    "reactions": {
      "url": "https://api.github.com/teams/2343027/discussions/1/reactions",
      "total_count": 5,
      "+1": 3,
      "-1": 1,
      "laugh": 0,
      "confused": 0,
      "heart": 1,
      "hooray": 0,
      "eyes": 1,
      "rocket": 1
    }
  }
]

array[object (Team Discussion)]

Team Discussion

object (Team Discussion)

A team discussion is a persistent record of a free-form conversation within a team.

author

object (author) or null

required

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

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

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

body

string

required

The main text of the discussion.

Example
"Please suggest improvements to our workflow in comments."

body_html

string

required

Example
"<p>Hi! This is an area for us to collaborate as a team</p>"

body_version

string

required

The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.

Example
"0307116bbf7ced493b8d8a346c650b71"

comments_count

int

required

Example
0

comments_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027/discussions/1/comments"

created_at

string

date-time

required

Example
"2018-01-25T18:56:31Z"

last_edited_at

string or null

date-time

required

html_url

string

uri

required

Example
"https://github.com/orgs/github/teams/justice-league/discussions/1"

node_id

string

required

Example
"MDE0OlRlYW1EaXNjdXNzaW9uMQ=="

number

int

required

The unique sequence number of a team discussion.

Example
42

pinned

boolean

required

Whether or not this discussion should be pinned for easy retrieval.

Example
true

private

boolean

required

Whether or not this discussion should be restricted to team members and organization administrators.

Example
true

team_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027"

title

string

required

The title of the discussion.

Example
"How can we improve our workflow?"

updated_at

string

date-time

required

Example
"2018-01-25T18:56:31Z"

url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027/discussions/1"

reactions

object (reactions)

url

string

uri

required

total_count

int

required

+1

int

required

-1

int

required

laugh

int

required

confused

int

required

heart

int

required

hooray

int

required

eyes

int

required

rocket

int

required

Link

string

Create a discussion

post /orgs/{org}/teams/{team_slug}/discussions

Creates a new discussion post on a team's page. OAuth access tokens require the write:discussion scope.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.

Note: You can also specify a team by org_id and team_id using the route POST /organizations/{org_id}/team/{team_id}/discussions.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

title

string

required

The discussion post's title.

body

string

required

The discussion post's body text.

private

boolean

Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to true to create a private post.

Default
false

Request

{
  "title": "Our first team post",
  "body": "Hi! This is an area for us to collaborate as a team."
}

Response

Examples Schema

Response

{
  "author": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "body": "Hi! This is an area for us to collaborate as a team.",
  "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>",
  "body_version": "0d495416a700fb06133c612575d92bfb",
  "comments_count": 0,
  "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments",
  "created_at": "2018-01-25T18:56:31Z",
  "last_edited_at": null,
  "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1",
  "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==",
  "number": 1,
  "pinned": false,
  "private": false,
  "team_url": "https://api.github.com/teams/2343027",
  "title": "Our first team post",
  "updated_at": "2018-01-25T18:56:31Z",
  "url": "https://api.github.com/teams/2343027/discussions/1",
  "reactions": {
    "url": "https://api.github.com/teams/2343027/discussions/1/reactions",
    "total_count": 5,
    "+1": 3,
    "-1": 1,
    "laugh": 0,
    "confused": 0,
    "heart": 1,
    "hooray": 0,
    "eyes": 1,
    "rocket": 1
  }
}

author

object (author) or null

required

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

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

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

body

string

required

The main text of the discussion.

Example
"Please suggest improvements to our workflow in comments."

body_html

string

required

Example
"<p>Hi! This is an area for us to collaborate as a team</p>"

body_version

string

required

The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.

Example
"0307116bbf7ced493b8d8a346c650b71"

comments_count

int

required

Example
0

comments_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027/discussions/1/comments"

created_at

string

date-time

required

Example
"2018-01-25T18:56:31Z"

last_edited_at

string or null

date-time

required

html_url

string

uri

required

Example
"https://github.com/orgs/github/teams/justice-league/discussions/1"

node_id

string

required

Example
"MDE0OlRlYW1EaXNjdXNzaW9uMQ=="

number

int

required

The unique sequence number of a team discussion.

Example
42

pinned

boolean

required

Whether or not this discussion should be pinned for easy retrieval.

Example
true

private

boolean

required

Whether or not this discussion should be restricted to team members and organization administrators.

Example
true

team_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027"

title

string

required

The title of the discussion.

Example
"How can we improve our workflow?"

updated_at

string

date-time

required

Example
"2018-01-25T18:56:31Z"

url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027/discussions/1"

reactions

object (reactions)

url

string

uri

required

total_count

int

required

+1

int

required

-1

int

required

laugh

int

required

confused

int

required

heart

int

required

hooray

int

required

eyes

int

required

rocket

int

required

Get a discussion

get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}

Get a specific discussion on a team's page. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

discussion_number

int

required

The number that identifies the discussion.

Response

Examples Schema

Response

{
  "author": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "body": "Hi! This is an area for us to collaborate as a team.",
  "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>",
  "body_version": "0d495416a700fb06133c612575d92bfb",
  "comments_count": 0,
  "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments",
  "created_at": "2018-01-25T18:56:31Z",
  "last_edited_at": null,
  "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1",
  "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==",
  "number": 1,
  "pinned": false,
  "private": false,
  "team_url": "https://api.github.com/teams/2343027",
  "title": "Our first team post",
  "updated_at": "2018-01-25T18:56:31Z",
  "url": "https://api.github.com/teams/2343027/discussions/1",
  "reactions": {
    "url": "https://api.github.com/teams/2343027/discussions/1/reactions",
    "total_count": 5,
    "+1": 3,
    "-1": 1,
    "laugh": 0,
    "confused": 0,
    "heart": 1,
    "hooray": 0,
    "eyes": 1,
    "rocket": 1
  }
}

author

object (author) or null

required

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

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

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

body

string

required

The main text of the discussion.

Example
"Please suggest improvements to our workflow in comments."

body_html

string

required

Example
"<p>Hi! This is an area for us to collaborate as a team</p>"

body_version

string

required

The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.

Example
"0307116bbf7ced493b8d8a346c650b71"

comments_count

int

required

Example
0

comments_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027/discussions/1/comments"

created_at

string

date-time

required

Example
"2018-01-25T18:56:31Z"

last_edited_at

string or null

date-time

required

html_url

string

uri

required

Example
"https://github.com/orgs/github/teams/justice-league/discussions/1"

node_id

string

required

Example
"MDE0OlRlYW1EaXNjdXNzaW9uMQ=="

number

int

required

The unique sequence number of a team discussion.

Example
42

pinned

boolean

required

Whether or not this discussion should be pinned for easy retrieval.

Example
true

private

boolean

required

Whether or not this discussion should be restricted to team members and organization administrators.

Example
true

team_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027"

title

string

required

The title of the discussion.

Example
"How can we improve our workflow?"

updated_at

string

date-time

required

Example
"2018-01-25T18:56:31Z"

url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027/discussions/1"

reactions

object (reactions)

url

string

uri

required

total_count

int

required

+1

int

required

-1

int

required

laugh

int

required

confused

int

required

heart

int

required

hooray

int

required

eyes

int

required

rocket

int

required

Delete a discussion

delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}

Delete a discussion from a team's page. OAuth access tokens require the write:discussion scope.

Note: You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

discussion_number

int

required

The number that identifies the discussion.

Response

Examples Schema

Response

Empty response

No schema

Update a discussion

patch /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}

Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the write:discussion scope.

Note: You can also specify a team by org_id and team_id using the route PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

discussion_number

int

required

The number that identifies the discussion.

title

string

The discussion post's title.

body

string

The discussion post's body text.

Request

{
  "title": "Welcome to our first team post"
}

Response

Examples Schema

Response

{
  "author": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "body": "Hi! This is an area for us to collaborate as a team.",
  "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>",
  "body_version": "0d495416a700fb06133c612575d92bfb",
  "comments_count": 1,
  "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments",
  "created_at": "2018-01-25T18:56:31Z",
  "last_edited_at": "2018-01-26T18:22:20Z",
  "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1",
  "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==",
  "number": 1,
  "pinned": false,
  "private": false,
  "team_url": "https://api.github.com/teams/2343027",
  "title": "Welcome to our first team post",
  "updated_at": "2018-01-26T18:22:20Z",
  "url": "https://api.github.com/teams/2343027/discussions/1",
  "reactions": {
    "url": "https://api.github.com/teams/2343027/discussions/1/reactions",
    "total_count": 5,
    "+1": 3,
    "-1": 1,
    "laugh": 0,
    "confused": 0,
    "heart": 1,
    "hooray": 0,
    "eyes": 1,
    "rocket": 1
  }
}

author

object (author) or null

required

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

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

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

body

string

required

The main text of the discussion.

Example
"Please suggest improvements to our workflow in comments."

body_html

string

required

Example
"<p>Hi! This is an area for us to collaborate as a team</p>"

body_version

string

required

The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.

Example
"0307116bbf7ced493b8d8a346c650b71"

comments_count

int

required

Example
0

comments_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027/discussions/1/comments"

created_at

string

date-time

required

Example
"2018-01-25T18:56:31Z"

last_edited_at

string or null

date-time

required

html_url

string

uri

required

Example
"https://github.com/orgs/github/teams/justice-league/discussions/1"

node_id

string

required

Example
"MDE0OlRlYW1EaXNjdXNzaW9uMQ=="

number

int

required

The unique sequence number of a team discussion.

Example
42

pinned

boolean

required

Whether or not this discussion should be pinned for easy retrieval.

Example
true

private

boolean

required

Whether or not this discussion should be restricted to team members and organization administrators.

Example
true

team_url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027"

title

string

required

The title of the discussion.

Example
"How can we improve our workflow?"

updated_at

string

date-time

required

Example
"2018-01-25T18:56:31Z"

url

string

uri

required

Example
"https://api.github.com/organizations/1/team/2343027/discussions/1"

reactions

object (reactions)

url

string

uri

required

total_count

int

required

+1

int

required

-1

int

required

laugh

int

required

confused

int

required

heart

int

required

hooray

int

required

eyes

int

required

rocket

int

required

List discussion comments

get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments

List all comments on a team discussion. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments.

org

string

required

The organization name. The name is not case sensitive.

team_slug

string

required

The slug of the team name.

discussion_number

int

required

The number that identifies the discussion.

direction

string

The direction to sort the results by.

Default
"desc"
Enum
  • asc
  • desc

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "author": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "body": "Do you like apples?",
    "body_html": "<p>Do you like apples?<