v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2023-07-147873273.9 MB
teams

Create a discussion (Legacy)

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/teams/{team_id}/discussions

Path parameters

team_idinteger required

The unique identifier of the team.

Request body

titlestring required

The discussion post's title.

bodystring required

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.

Response

Response

bodystring required

The main text of the discussion.

body_htmlstring required
body_versionstring 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.

comments_countinteger required
comments_urlstring uri required
created_atstring date-time required
last_edited_atstring date-time nullable required
html_urlstring uri required
node_idstring required
numberinteger required

The unique sequence number of a team discussion.

pinnedboolean required

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

privateboolean required

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

team_urlstring uri required
titlestring required

The title of the discussion.

updated_atstring date-time required
urlstring uri required

Example response

{
  "author": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
    "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",
    "starred_at": "\"2020-07-09T00:17:55Z\""
  },
  "body": "Please suggest improvements to our workflow in comments.",
  "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>",
  "body_version": "0307116bbf7ced493b8d8a346c650b71",
  "comments_url": "https://api.github.com/organizations/1/team/2343027/discussions/1/comments",
  "created_at": "2018-01-25T18:56:31Z",
  "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1",
  "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==",
  "number": 42,
  "pinned": true,
  "private": true,
  "team_url": "https://api.github.com/organizations/1/team/2343027",
  "title": "How can we improve our workflow?",
  "updated_at": "2018-01-25T18:56:31Z",
  "url": "https://api.github.com/organizations/1/team/2343027/discussions/1"
}