Get a single release of the repository¶
GET /api/v5/repos/{owner}/{repo}/releases/{tag}
Call this endpoint to get a single release of the repository.
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 |
access_token |
query | string | No | User authorization code |
temp_download_url |
query | string | No | Whether to return temporary download URLs for source archives and attachments; defaults to false |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
tag_name |
string | Yes | No | Tag name associated with the release |
target_commitish |
string | Yes | No | Target commit (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 | Yes | 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 | Login name |
author.name |
string | Yes | No | User name |
author.avatar_url |
string | Yes | No | Avatar URL |
author.html_url |
string | Yes | No | User profile URL |
author.type |
string | Yes | No | User type |
author.url |
string | Yes | No | User API URL |
assets array elements
| 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 |
assets[].id |
integer | No | Yes | Attachment ID |
Error response¶
400 Invalid parameters
401 Unauthenticated
404 Resource does not exist
The actual error response field names are determined by the backend response.
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Requires authentication |
403 |
Forbidden |
404 |
Not found |
Request example¶
Parameter details¶
The example uses anonymous access and does not require an access token. To access resources in a private repository, you can also append access_token=<token> to the URL.
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 of the release to get.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>",
{
headers: {
"Accept": "application/json",
},
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>",
headers={
"Accept": "application/json",
},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
{
"tag_name": "v1.0.0",
"target_commitish": "main",
"prerelease": false,
"name": "v1.0.0",
"body": "Initial release",
"author": {
"id": "123456",
"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": "2024-01-01T00:00:00Z",
"assets": [
{
"browser_download_url": "https://api.atomgit.com/octocat/Hello-World/releases/download/v1.0.0/app.zip",
"name": "app.zip",
"type": "application/zip",
"id": 1
}
],
"release_status": "published"
}
Error codes¶
| Error code | Description |
|---|---|
400 |
Invalid parameters or the request cannot be parsed |
401 |
Unauthenticated or invalid credentials (missing or invalid access token) |
403 |
Forbidden |
404 |
The requested release 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