{"meta":{"title":"Points de terminaison de l'API REST pour les lancements","intro":"Utilisez l’API REST pour créer, modifier et supprimer des versions.","product":"API REST","breadcrumbs":[{"href":"/fr/rest","title":"API REST"},{"href":"/fr/rest/releases","title":"Publications"},{"href":"/fr/rest/releases/releases","title":"Publications"}],"documentType":"article"},"body":"# Points de terminaison de l'API REST pour les lancements\n\nUtilisez l’API REST pour créer, modifier et supprimer des versions.\n\n> [!NOTE]\n> Ces points de terminaison remplacent ceux qui permettaient auparavant de gérer les téléchargements. Vous pouvez récupérer le nombre de téléchargements et l’URL de téléchargement du navigateur à partir de ces points de terminaison.\n\n> [!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2022-11-28`. Curl examples below omit these standard headers for brevity.\n\n\n## List releases\n\n```\nGET /repos/{owner}/{repo}/releases\n```\n\nThis returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the Repository Tags API.\nInformation about published releases are available to everyone. Only users with push access will receive listings for draft releases.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n- **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - OK\n\n\n- **404** - Resource not found\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/releases\n```\n\n**Response schema (Status: 200):**\n\nArray of `Release`:\n  * `url`: required, string, format: uri\n  * `html_url`: required, string, format: uri\n  * `assets_url`: required, string, format: uri\n  * `upload_url`: required, string\n  * `tarball_url`: required, string or null, format: uri\n  * `zipball_url`: required, string or null, format: uri\n  * `id`: required, integer\n  * `node_id`: required, string\n  * `tag_name`: required, string\n  * `target_commitish`: required, string\n  * `name`: required, string or null\n  * `body`: string or null\n  * `draft`: required, boolean\n  * `prerelease`: required, boolean\n  * `immutable`: boolean\n  * `created_at`: required, string, format: date-time\n  * `published_at`: required, string or null, format: date-time\n  * `updated_at`: string or null, format: date-time\n  * `author`: required, `Simple User`:\n    * `name`: string or null\n    * `email`: string or null\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `node_id`: required, string\n    * `avatar_url`: required, string, format: uri\n    * `gravatar_id`: required, string or null\n    * `url`: required, string, format: uri\n    * `html_url`: required, string, format: uri\n    * `followers_url`: required, string, format: uri\n    * `following_url`: required, string\n    * `gists_url`: required, string\n    * `starred_url`: required, string\n    * `subscriptions_url`: required, string, format: uri\n    * `organizations_url`: required, string, format: uri\n    * `repos_url`: required, string, format: uri\n    * `events_url`: required, string\n    * `received_events_url`: required, string, format: uri\n    * `type`: required, string\n    * `site_admin`: required, boolean\n    * `starred_at`: string\n    * `user_view_type`: string\n  * `assets`: required, array of `Release Asset`:\n    * `url`: required, string, format: uri\n    * `browser_download_url`: required, string, format: uri\n    * `id`: required, integer\n    * `node_id`: required, string\n    * `name`: required, string\n    * `label`: required, string or null\n    * `state`: required, string, enum: `uploaded`, `open`\n    * `content_type`: required, string\n    * `size`: required, integer\n    * `digest`: required, string or null\n    * `download_count`: required, integer\n    * `created_at`: required, string, format: date-time\n    * `updated_at`: required, string, format: date-time\n    * `uploader`: required, any of:\n      * **null**\n      * **Simple User**\n        * `name`: string or null\n        * `email`: string or null\n        * `login`: required, string\n        * `id`: required, integer, format: int64\n        * `node_id`: required, string\n        * `avatar_url`: required, string, format: uri\n        * `gravatar_id`: required, string or null\n        * `url`: required, string, format: uri\n        * `html_url`: required, string, format: uri\n        * `followers_url`: required, string, format: uri\n        * `following_url`: required, string\n        * `gists_url`: required, string\n        * `starred_url`: required, string\n        * `subscriptions_url`: required, string, format: uri\n        * `organizations_url`: required, string, format: uri\n        * `repos_url`: required, string, format: uri\n        * `events_url`: required, string\n        * `received_events_url`: required, string, format: uri\n        * `type`: required, string\n        * `site_admin`: required, boolean\n        * `starred_at`: string\n        * `user_view_type`: string\n  * `body_html`: string\n  * `body_text`: string\n  * `mentions_count`: integer\n  * `discussion_url`: string, format: uri\n  * `reactions`: `Reaction Rollup`:\n    * `url`: required, string, format: uri\n    * `total_count`: required, integer\n    * `+1`: required, integer\n    * `-1`: required, integer\n    * `laugh`: required, integer\n    * `confused`: required, integer\n    * `heart`: required, integer\n    * `hooray`: required, integer\n    * `eyes`: required, integer\n    * `rocket`: required, integer\n\n\n\n\n\n## Create a release\n\n```\nPOST /repos/{owner}/{repo}/releases\n```\n\nUsers with push access to the repository can create a release.\nThis endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see \"Rate limits for the API\" and \"Best practices for using the REST API.\"\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n\n\n\n#### Body parameters\n\n- **`tag_name`** (string) (required)\n  The name of the tag.\n\n- **`target_commitish`** (string)\n  Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch.\n\n- **`name`** (string)\n  The name of the release.\n\n- **`body`** (string)\n  Text describing the contents of the tag.\n\n- **`draft`** (boolean)\n  true to create a draft (unpublished) release, false to create a published one.\n  Default: `false`\n\n- **`prerelease`** (boolean)\n  true to identify the release as a prerelease. false to identify the release as a full release.\n  Default: `false`\n\n- **`discussion_category_name`** (string)\n  If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see \"Managing categories for discussions in your repository.\"\n\n- **`generate_release_notes`** (boolean)\n  Whether to automatically generate the name and body for this release. If name is specified, the specified name will be used; otherwise, a name will be automatically generated. If body is specified, the body will be pre-pended to the automatically generated notes.\n  Default: `false`\n\n- **`make_latest`** (string)\n  Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Defaults to true for newly published releases. legacy specifies that the latest release should be determined based on the release creation date and higher semantic version.\n  Default: `true`\n  Can be one of: `true`, `false`, `legacy`\n\n\n\n\n\n### HTTP response status codes\n\n\n- **201** - Created\n\n\n- **404** - Not Found if the discussion category name is invalid\n\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/repos/OWNER/REPO/releases \\\n  -d '{\n  \"tag_name\": \"v1.0.0\",\n  \"target_commitish\": \"master\",\n  \"name\": \"v1.0.0\",\n  \"body\": \"Description of the release\",\n  \"draft\": false,\n  \"prerelease\": false,\n  \"generate_release_notes\": false\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `url`: required, string, format: uri\n* `html_url`: required, string, format: uri\n* `assets_url`: required, string, format: uri\n* `upload_url`: required, string\n* `tarball_url`: required, string or null, format: uri\n* `zipball_url`: required, string or null, format: uri\n* `id`: required, integer\n* `node_id`: required, string\n* `tag_name`: required, string\n* `target_commitish`: required, string\n* `name`: required, string or null\n* `body`: string or null\n* `draft`: required, boolean\n* `prerelease`: required, boolean\n* `immutable`: boolean\n* `created_at`: required, string, format: date-time\n* `published_at`: required, string or null, format: date-time\n* `updated_at`: string or null, format: date-time\n* `author`: required, `Simple User`:\n  * `name`: string or null\n  * `email`: string or null\n  * `login`: required, string\n  * `id`: required, integer, format: int64\n  * `node_id`: required, string\n  * `avatar_url`: required, string, format: uri\n  * `gravatar_id`: required, string or null\n  * `url`: required, string, format: uri\n  * `html_url`: required, string, format: uri\n  * `followers_url`: required, string, format: uri\n  * `following_url`: required, string\n  * `gists_url`: required, string\n  * `starred_url`: required, string\n  * `subscriptions_url`: required, string, format: uri\n  * `organizations_url`: required, string, format: uri\n  * `repos_url`: required, string, format: uri\n  * `events_url`: required, string\n  * `received_events_url`: required, string, format: uri\n  * `type`: required, string\n  * `site_admin`: required, boolean\n  * `starred_at`: string\n  * `user_view_type`: string\n* `assets`: required, array of `Release Asset`:\n  * `url`: required, string, format: uri\n  * `browser_download_url`: required, string, format: uri\n  * `id`: required, integer\n  * `node_id`: required, string\n  * `name`: required, string\n  * `label`: required, string or null\n  * `state`: required, string, enum: `uploaded`, `open`\n  * `content_type`: required, string\n  * `size`: required, integer\n  * `digest`: required, string or null\n  * `download_count`: required, integer\n  * `created_at`: required, string, format: date-time\n  * `updated_at`: required, string, format: date-time\n  * `uploader`: required, any of:\n    * **null**\n    * **Simple User**\n      * `name`: string or null\n      * `email`: string or null\n      * `login`: required, string\n      * `id`: required, integer, format: int64\n      * `node_id`: required, string\n      * `avatar_url`: required, string, format: uri\n      * `gravatar_id`: required, string or null\n      * `url`: required, string, format: uri\n      * `html_url`: required, string, format: uri\n      * `followers_url`: required, string, format: uri\n      * `following_url`: required, string\n      * `gists_url`: required, string\n      * `starred_url`: required, string\n      * `subscriptions_url`: required, string, format: uri\n      * `organizations_url`: required, string, format: uri\n      * `repos_url`: required, string, format: uri\n      * `events_url`: required, string\n      * `received_events_url`: required, string, format: uri\n      * `type`: required, string\n      * `site_admin`: required, boolean\n      * `starred_at`: string\n      * `user_view_type`: string\n* `body_html`: string\n* `body_text`: string\n* `mentions_count`: integer\n* `discussion_url`: string, format: uri\n* `reactions`: `Reaction Rollup`:\n  * `url`: required, string, format: uri\n  * `total_count`: required, integer\n  * `+1`: required, integer\n  * `-1`: required, integer\n  * `laugh`: required, integer\n  * `confused`: required, integer\n  * `heart`: required, integer\n  * `hooray`: required, integer\n  * `eyes`: required, integer\n  * `rocket`: required, integer\n\n\n\n\n\n## Generate release notes content for a release\n\n```\nPOST /repos/{owner}/{repo}/releases/generate-notes\n```\n\nGenerate a name and body describing a release. The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n\n\n\n#### Body parameters\n\n- **`tag_name`** (string) (required)\n  The tag name for the release. This can be an existing tag or a new one.\n\n- **`target_commitish`** (string)\n  Specifies the commitish value that will be the target for the release's tag. Required if the supplied tag_name does not reference an existing tag. Ignored if the tag_name already exists.\n\n- **`previous_tag_name`** (string)\n  The name of the previous tag to use as the starting point for the release notes. Use to manually specify the range for the set of changes considered as part this release.\n\n- **`configuration_file_path`** (string)\n  Specifies a path to a file in the repository containing configuration settings used for generating the release notes. If unspecified, the configuration file located in the repository at '.github/release.yml' or '.github/release.yaml' will be used. If that is not present, the default configuration will be used.\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - Name and body of generated release notes\n\n\n- **404** - Resource not found\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/repos/OWNER/REPO/releases/generate-notes \\\n  -d '{\n  \"tag_name\": \"v1.0.0\",\n  \"target_commitish\": \"main\",\n  \"previous_tag_name\": \"v0.9.2\",\n  \"configuration_file_path\": \".github/custom_release_config.yml\"\n}'\n```\n\n**Response schema (Status: 200):**\n\n* `name`: required, string\n* `body`: required, string\n\n\n\n\n\n## Get the latest release\n\n```\nGET /repos/{owner}/{repo}/releases/latest\n```\n\nView the latest published full release for the repository.\nThe latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute. The created_at attribute is the date of the commit used for the release, and not the date when the release was drafted or published.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - OK\n\n\n- **404** - Resource not found\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/releases/latest\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a release](#create-a-release).\n\n\n\n\n\n## Get a release by tag name\n\n```\nGET /repos/{owner}/{repo}/releases/tags/{tag}\n```\n\nGet a published release with the specified tag.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`tag`** (string) (required)\n  tag parameter\n\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - OK\n\n\n- **404** - Resource not found\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/releases/tags/TAG\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a release](#create-a-release).\n\n\n\n\n\n## Get a release\n\n```\nGET /repos/{owner}/{repo}/releases/{release_id}\n```\n\nGets a public release with the specified release ID.\nNote\n\nThis returns an upload_url key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource. For more information, see \"Getting started with the REST API.\"\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`release_id`** (integer) (required)\n  The unique identifier of the release.\n\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - Note: This returns an upload_url key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource. For more information, see \"Getting started with the REST API.\"\n\n\n- **401** - Unauthorized\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/releases/RELEASE_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a release](#create-a-release).\n\n\n\n\n\n## Update a release\n\n```\nPATCH /repos/{owner}/{repo}/releases/{release_id}\n```\n\nUsers with push access to the repository can edit a release.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`release_id`** (integer) (required)\n  The unique identifier of the release.\n\n\n\n\n#### Body parameters\n\n- **`tag_name`** (string)\n  The name of the tag.\n\n- **`target_commitish`** (string)\n  Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch.\n\n- **`name`** (string)\n  The name of the release.\n\n- **`body`** (string)\n  Text describing the contents of the tag.\n\n- **`draft`** (boolean)\n  true makes the release a draft, and false publishes the release.\n\n- **`prerelease`** (boolean)\n  true to identify the release as a prerelease, false to identify the release as a full release.\n\n- **`make_latest`** (string)\n  Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Defaults to true for newly published releases. legacy specifies that the latest release should be determined based on the release creation date and higher semantic version.\n  Default: `true`\n  Can be one of: `true`, `false`, `legacy`\n\n- **`discussion_category_name`** (string)\n  If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored. For more information, see \"Managing categories for discussions in your repository.\"\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - OK\n\n\n- **404** - Not Found if the discussion category name is invalid\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/repos/OWNER/REPO/releases/RELEASE_ID \\\n  -d '{\n  \"tag_name\": \"v1.0.0\",\n  \"target_commitish\": \"master\",\n  \"name\": \"v1.0.0\",\n  \"body\": \"Description of the release\",\n  \"draft\": false,\n  \"prerelease\": false\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a release](#create-a-release).\n\n\n\n\n\n## Delete a release\n\n```\nDELETE /repos/{owner}/{repo}/releases/{release_id}\n```\n\nUsers with push access to the repository can delete a release.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`release_id`** (integer) (required)\n  The unique identifier of the release.\n\n\n\n\n\n\n### HTTP response status codes\n\n\n- **204** - No Content\n\n\n- **404** - Resource not found\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/repos/OWNER/REPO/releases/RELEASE_ID\n```\n\n**Response schema (Status: 204):**"}