GitHub v3 REST API

Delete a team (Legacy)

DEPRECATED

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Delete a team endpoint.

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.

delete
{protocol}://{hostname}/api/v3/teams/{team_id}

Path Parameters

team_idintegerrequired

Response

Response

delete/teams/{team_id}
 

List discussions (Legacy)

DEPRECATED

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List discussions endpoint.

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

get
{protocol}://{hostname}/api/v3/teams/{team_id}/discussions

Query Parameters

directionstring

One of asc (ascending) or desc (descending).

Allowed values:ascdesc

Default:desc

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

team_idintegerrequired

Response

200 application/json

Response

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

authorobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The main text of the discussion.

Example:Please suggest improvements to our workflow in comments.

body_htmlstringrequired

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

body_versionstringrequired

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_countintegerrequired

Example:0

comments_urlstring(uri)required

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

created_atstring(date-time)required

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

last_edited_atstring | null(date-time)required
html_urlstring(uri)required

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

node_idstringrequired

Example:MDE0OlRlYW1EaXNjdXNzaW9uMQ==

numberintegerrequired

The unique sequence number of a team discussion.

Example:42

pinnedbooleanrequired

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

Example:true

privatebooleanrequired

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

Example:true

team_urlstring(uri)required

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

titlestringrequired

The title of the discussion.

Example:How can we improve our workflow?

updated_atstring(date-time)required

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

urlstring(uri)required

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

reactionsobject
Show Child Parameters
get/teams/{team_id}/discussions
 
200 application/json

Create a discussion (Legacy)

DEPRECATED

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create a discussion endpoint.

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.

post
{protocol}://{hostname}/api/v3/teams/{team_id}/discussions

Path Parameters

team_idintegerrequired

Body

application/json
titlestringrequired

The discussion post’s title.

bodystringrequired

The discussion post’s body text.

privateboolean

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

Response

201 application/json

Response

Team Discussion

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

authorobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The main text of the discussion.

Example:Please suggest improvements to our workflow in comments.

body_htmlstringrequired

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

body_versionstringrequired

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_countintegerrequired

Example:0

comments_urlstring(uri)required

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

created_atstring(date-time)required

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

last_edited_atstring | null(date-time)required
html_urlstring(uri)required

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

node_idstringrequired

Example:MDE0OlRlYW1EaXNjdXNzaW9uMQ==

numberintegerrequired

The unique sequence number of a team discussion.

Example:42

pinnedbooleanrequired

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

Example:true

privatebooleanrequired

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

Example:true

team_urlstring(uri)required

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

titlestringrequired

The title of the discussion.

Example:How can we improve our workflow?

updated_atstring(date-time)required

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

urlstring(uri)required

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

reactionsobject
Show Child Parameters
post/teams/{team_id}/discussions

Body

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

Get a discussion (Legacy)

DEPRECATED

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Get a discussion endpoint.

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

get
{protocol}://{hostname}/api/v3/teams/{team_id}/discussions/{discussion_number}

Path Parameters

team_idintegerrequired
discussion_numberintegerrequired

Response

200 application/json

Response

Team Discussion

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

authorobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The main text of the discussion.

Example:Please suggest improvements to our workflow in comments.

body_htmlstringrequired

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

body_versionstringrequired

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_countintegerrequired

Example:0

comments_urlstring(uri)required

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

created_atstring(date-time)required

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

last_edited_atstring | null(date-time)required
html_urlstring(uri)required

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

node_idstringrequired

Example:MDE0OlRlYW1EaXNjdXNzaW9uMQ==

numberintegerrequired

The unique sequence number of a team discussion.

Example:42

pinnedbooleanrequired

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

Example:true

privatebooleanrequired

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

Example:true

team_urlstring(uri)required

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

titlestringrequired

The title of the discussion.

Example:How can we improve our workflow?

updated_atstring(date-time)required

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

urlstring(uri)required

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

reactionsobject
Show Child Parameters
get/teams/{team_id}/discussions/{discussion_number}
 
200 application/json

Update a discussion (Legacy)

DEPRECATED

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Update a discussion endpoint.

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.

patch
{protocol}://{hostname}/api/v3/teams/{team_id}/discussions/{discussion_number}

Path Parameters

team_idintegerrequired
discussion_numberintegerrequired

Body

application/json
titlestring

The discussion post’s title.

bodystring

The discussion post’s body text.

Response

200 application/json

Response

Team Discussion

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

authorobject | nullrequired

Simple User

Show Child Parameters
bodystringrequired

The main text of the discussion.

Example:Please suggest improvements to our workflow in comments.

body_htmlstringrequired

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

body_versionstringrequired

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_countintegerrequired

Example:0

comments_urlstring(uri)required

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

created_atstring(date-time)required

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

last_edited_atstring | null(date-time)required
html_urlstring(uri)required

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

node_idstringrequired

Example:MDE0OlRlYW1EaXNjdXNzaW9uMQ==

numberintegerrequired

The unique sequence number of a team discussion.

Example:42

pinnedbooleanrequired

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

Example:true

privatebooleanrequired

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

Example:true

team_urlstring(uri)required

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

titlestringrequired

The title of the discussion.

Example:How can we improve our workflow?

updated_atstring(date-time)required

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

urlstring(uri)required

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

reactionsobject
Show Child Parameters
patch/teams/{team_id}/discussions/{discussion_number}

Body

{ "title": "Welcome to our first team post" }
 
200 application/json