Delete a release attachment¶
DELETE /api/v5/repos/{owner}/{repo}/releases/{tag}/attach_files/{attach_file_id}
Call this endpoint to delete a release attachment.
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 |
tag |
path | string | Yes | Tag name |
attach_file_id |
path | string | Yes | Attachment ID |
access_token |
query | string | Yes | User authorization code |
Response parameters¶
After the attachment is deleted successfully, this endpoint returns 204 No Content with no response body.
Error response¶
400 Invalid parameters
401 Unauthenticated
404 Resource does not exist
The actual error field names are determined by the backend response.
HTTP status codes¶
| Status code | Description |
|---|---|
204 |
Success (No Content) |
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; replace<tag>with the release tag name; replace<attach_file_id>with the attachment ID; replace<token>with your AtomGit user access token.
cURL¶
curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>/attach_files/<attach_file_id>?access_token=<token>' \
-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>/attach_files/<attach_file_id>?access_token=<token>", {
method: "DELETE",
headers: {
"Accept": "application/json",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
console.log("Deleted successfully");
Python¶
import requests
resp = requests.delete(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>/attach_files/<attach_file_id>",
params={"access_token": "<token>"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.status_code)
Response example¶
Status code: 204
This endpoint returns 204 No Content with no response body.
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access token) |
403 |
Forbidden (no permission) |
404 |
The requested resource 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