Skip to content

Update a repository release

PATCH /api/v5/repos/{owner}/{repo}/releases/{tag}

Call this endpoint to update a repository release.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint allows 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 (path)
tag path string Yes Tag name

Request Body:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "description": "Release name",
      "type": "string"
    },
    "body": {
      "description": "Release description",
      "type": "string"
    },
    "release_status": {
      "description": "Release status: `pre` (prerelease), `latest` (latest release)",
      "type": "string",
      "enum": ["pre", "latest"]
    }
  },
  "required": ["name", "body"]
}

Response parameters

Field Type Always returned Nullable Description
tag_name string Yes — Tag name associated with the release
target_commitish string Yes — Target commit identifier
prerelease boolean Yes — Whether this is a prerelease
name string Yes — Release name
body string Yes — Release description
author object Yes — Release author information
created_at string Yes — Release creation time
assets array Yes — Release attachment list
release_status string Yes — Release status (pre / latest)

author object

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

assets element object

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

Error response

This endpoint has no business error response. The structure of error responses is determined by the actual backend response.

HTTP status codes

Status code Description
200 Success (OK)
401 Requires authentication
403 Forbidden
404 Not found

Request example

Parameter details

Replace <owner> with the namespace address that owns the repository (enterprise, organization, or personal address path); replace <repo> with the repository path (path); replace <tag> with the tag name.

cURL

curl -X PATCH 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "name": "release1 name",
    "body": "release1 description",
    "release_status": "latest"
  }'

JavaScript

const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify({
    name: "release1 name",
    body: "release1 description",
    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.patch(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>",
    json={
        "name": "release1 name",
        "body": "release1 description",
        "release_status": "latest",
    },
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "tag_name": "v1.0.217",
  "target_commitish": "930401b0dd58a809fce34da091b8aa3d6083cb33",
  "prerelease": false,
  "name": "release1 name",
  "body": "release1 description",
  "author": {
    "id": "26593",
    "login": "fenglonghui",
    "name": "Long Hui",
    "avatar_url": "https://api.atomgit.com/avatar.png",
    "html_url": "https://api.atomgit.com/fenglonghui",
    "type": "User",
    "url": "https://api.atomgit.com/api/v5/users/fenglonghui"
  },
  "created_at": "2025-01-16T19:58:07+08:00",
  "assets": [
    {
      "browser_download_url": "https://api.atomgit.com/rust-learning/serde/-/archive/v1.0.217/serde-v1.0.217.zip",
      "name": "serde-v1.0.217.zip"
    },
    {
      "browser_download_url": "https://api.atomgit.com/rust-learning/serde/-/archive/v1.0.217/serde-v1.0.217.tar.gz",
      "name": "serde-v1.0.217.tar.gz"
    }
  ],
  "release_status": "latest"
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access token)
400 Invalid parameters or the request cannot be parsed
404 Request path does not exist
405 Request method not supported
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