Skip to content

Create a repository release

POST /api/v5/repos/{owner}/{repo}/releases

Create a repository release. You must provide the tag name, release name, and description.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Namespace address that owns the repository (enterprise, organization, or personal address path)
repo path string Yes Repository path
access_token query string Yes User authorization code

Request Body:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "tag_name": {
      "description": "Tag name",
      "type": "string"
    },
    "name": {
      "description": "Release name",
      "type": "string"
    },
    "body": {
      "description": "Release description",
      "type": "string"
    },
    "target_commitish": {
      "description": "Branch name or commit SHA. If the tag does not exist and a new tag must be created, pass this parameter; if it is omitted, the latest commit on the default branch is used",
      "type": "string"
    },
    "release_status": {
      "description": "Release status. pre (prerelease), latest (latest release)",
      "type": "string",
      "enum": ["pre", "latest"]
    }
  },
  "required": ["tag_name", "name", "body"]
}

Response parameters

Field Type Always returned Nullable Description
tag_name string Yes No Tag name
target_commitish string Yes No Branch name or commit SHA
prerelease boolean Yes No Whether this is a prerelease
name string Yes No Release name
body string Yes No Release description
author object Yes No Release author information
created_at string Yes No Creation time
assets object[] Yes No Associated attachment list
release_status string Yes No Release status

author object

Field Type Always returned Nullable Description
author.id string Yes No User ID
author.login string Yes No User login name
author.name string Yes No User name
author.avatar_url string Yes No User avatar URL
author.html_url string Yes No User profile URL
author.type string Yes No User type
author.url string Yes No User information URL

assets object

Field Type Always returned Nullable Description
assets.browser_download_url string Yes No Browser download URL
assets.name string Yes No Attachment name
assets.type string Yes No Attachment type

Error response

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Invalid parameters or the request cannot be parsed"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

The actual error field names are determined by the backend response; the examples are for reference only.

HTTP status codes

Status code Description
200 Success (OK)
400 Bad request
401 Requires authentication
404 Not found
500 Internal server error

Request example

Parameter details

Required parameters include the path parameters owner and repo, the query parameter access_token, and the request body fields tag_name, name, and body. target_commitish and release_status are optional.

Replace <owner> with the namespace address that owns the repository (enterprise, organization, or personal address path); replace <repo> with the repository path; replace <token> with your AtomGit user access token.

cURL

curl -X POST 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases?access_token=<token>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "tag_name": "v1.0.0",
    "name": "v1.0.0",
    "body": "Release notes for v1.0.0",
    "target_commitish": "master",
    "release_status": "latest"
  }'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch(
  "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases?access_token=<token>",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Accept": "application/json"
    },
    body: JSON.stringify({
      tag_name: "v1.0.0",
      name: "v1.0.0",
      body: "Release notes for v1.0.0",
      target_commitish: "master",
      release_status: "latest"
    })
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.post(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases",
    params={"access_token": "<token>"},
    json={
        "tag_name": "v1.0.0",
        "name": "v1.0.0",
        "body": "Release notes for v1.0.0",
        "target_commitish": "master",
        "release_status": "latest",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "tag_name": "v1.0.0",
  "target_commitish": "master",
  "prerelease": false,
  "name": "v1.0.0",
  "body": "Release notes for v1.0.0",
  "author": {
    "id": "10001",
    "login": "octocat",
    "name": "octocat",
    "avatar_url": "https://api.atomgit.com/avatar.png",
    "html_url": "https://api.atomgit.com/octocat",
    "type": "User",
    "url": "https://api.atomgit.com/octocat"
  },
  "created_at": "2026-10-13T23:23:39+08:00",
  "assets": [
    {
      "browser_download_url": "https://api.atomgit.com/<owner>/<repo>/releases/download/v1.0.0/release.tar.gz",
      "name": "release.tar.gz",
      "type": "application/gzip"
    }
  ],
  "release_status": "latest"
}

Error codes

Error code Description
400 Invalid parameters or the request cannot be parsed
401 Unauthenticated or invalid credentials (missing or invalid access token)
404 Request path does not exist
429 Too many requests; rate limit triggered
500 Internal server error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc