---
title: "Create a release"
method: POST
path: "/repos/{owner}/{repo}/releases"
tags: ["repos"]
---

# Create a release

`POST /repos/{owner}/{repo}/releases`

Users with push access to the repository can create a release.

> [!NOTE]
> If the commit identified by `target_commitish` (or, when `target_commitish` is omitted, the latest commit on the default branch) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead.

OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/enterprise-cloud@latest/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)".

This endpoint triggers [notifications](https://docs.github.com/enterprise-cloud@latest/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-cloud@latest/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-cloud@latest/rest/guides/best-practices-for-using-the-rest-api)."

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- object
  - `tag_name` string, required — The name of the tag.
  - `target_commitish` string — 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.
  - `name` string — The name of the release.
  - `body` string — Text describing the contents of the tag.
  - `draft` boolean — `true` to create a draft (unpublished) release, `false` to create a published one.
  - `prerelease` boolean — `true` to identify the release as a prerelease. `false` to identify the release as a full release.
  - `discussion_category_name` string — 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](https://docs.github.com/enterprise-cloud@latest/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)."
  - `generate_release_notes` boolean — 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.
  - `make_latest` 'true' | 'false' | 'legacy' — 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.

## Response `201`

Response

- Release — A release.
  - `url` string, uri, required
  - `html_url` string, uri, required
  - `assets_url` string, uri, required
  - `upload_url` string, required
  - `tarball_url` string, uri, nullable, required
  - `zipball_url` string, uri, nullable, required
  - `id` integer, required
  - `node_id` string, required
  - `tag_name` string, required — The name of the tag.
  - `target_commitish` string, required — Specifies the commitish value that determines where the Git tag is created from.
  - `name` string, nullable, required
  - `body` string, nullable
  - `draft` boolean, required — true to create a draft (unpublished) release, false to create a published one.
  - `prerelease` boolean, required — Whether to identify the release as a prerelease or a full release.
  - `immutable` boolean — Whether or not the release is immutable.
  - `created_at` string, date-time, required
  - `published_at` string, date-time, nullable, required
  - `updated_at` string, date-time, nullable
  - `author` SimpleUser, required — A GitHub user.
    - `name` string, nullable
    - `email` string, nullable
    - `login` string, required
    - `id` integer, required
    - `node_id` string, required
    - `avatar_url` string, uri, required
    - `gravatar_id` string, nullable, required
    - `url` string, uri, required
    - `html_url` string, uri, required
    - `followers_url` string, uri, required
    - `following_url` string, required
    - `gists_url` string, required
    - `starred_url` string, required
    - `subscriptions_url` string, uri, required
    - `organizations_url` string, uri, required
    - `repos_url` string, uri, required
    - `events_url` string, required
    - `received_events_url` string, uri, required
    - `type` string, required
    - `site_admin` boolean, required
    - `starred_at` string
    - `user_view_type` string
  - `assets` ReleaseAsset[], required
    - `url` string, uri, required
    - `browser_download_url` string, uri, required
    - `id` integer, required
    - `node_id` string, required
    - `name` string, required — The file name of the asset.
    - `label` string, nullable, required
    - `state` 'uploaded' | 'open', required — State of the release asset.
    - `content_type` string, required
    - `size` integer, required
    - `digest` string, nullable, required
    - `download_count` integer, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `uploader` NullableSimpleUser, nullable, required — A GitHub user.
      - `name` string, nullable
      - `email` string, nullable
      - `login` string, required
      - `id` integer, required
      - `node_id` string, required
      - `avatar_url` string, uri, required
      - `gravatar_id` string, nullable, required
      - `url` string, uri, required
      - `html_url` string, uri, required
      - `followers_url` string, uri, required
      - `following_url` string, required
      - `gists_url` string, required
      - `starred_url` string, required
      - `subscriptions_url` string, uri, required
      - `organizations_url` string, uri, required
      - `repos_url` string, uri, required
      - `events_url` string, required
      - `received_events_url` string, uri, required
      - `type` string, required
      - `site_admin` boolean, required
      - `starred_at` string
      - `user_view_type` string
  - `body_html` string
  - `body_text` string
  - `mentions_count` integer
  - `discussion_url` string, uri — The URL of the release discussion.
  - `reactions` ReactionRollup
    - `url` string, uri, required
    - `total_count` integer, required
    - `+1` integer, required
    - `-1` integer, required
    - `laugh` integer, required
    - `confused` integer, required
    - `heart` integer, required
    - `hooray` integer, required
    - `eyes` integer, required
    - `rocket` integer, required

## Other responses

- `404` — Not Found if the discussion category name is invalid
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
