Delete a single repository milestone¶
DELETE /api/v5/repos/{owner}/{repo}/milestones/{number}
This endpoint deletes a single milestone in the specified repository. On success it returns an empty response body; if the target milestone does not exist, it returns a 404 error.
Access token support¶
- AtomGit user access token (AtomGit user access tokens)
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Address of the namespace that owns the repository (the address path of an enterprise, organization, or personal namespace) |
repo |
path | string | Yes | Repository path (path) |
number |
path | integer | Yes | Milestone serial number (number) |
access_token |
query | string | Yes | User authorization code |
Response parameters¶
On success, the endpoint returns an empty response body ({}) with no response body fields.
Error response¶
401 Unauthenticated
{
"error_code": 401,
"error_code_name": "UNAUTHORIZED",
"error_message": "Unauthorized",
"trace_id": "<trace-id>"
}
404 Not found
{
"error_code": 404,
"error_code_name": "NOT_FOUND",
"error_message": "Not Found",
"trace_id": "<trace-id>"
}
403 Forbidden
{
"error_code": 403,
"error_code_name": "FORBIDDEN",
"error_message": "Forbidden",
"trace_id": "<trace-id>"
}
429 Too many requests
{
"error_code": 429,
"error_code_name": "TOO_MANY_REQUESTS",
"error_message": "Too Many Requests",
"trace_id": "<trace-id>"
}
The error response field names are subject to the actual backend response.
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK); a successful deletion returns an empty response body |
401 |
Requires authentication; the access token is missing or invalid |
403 |
Forbidden; the token has insufficient permissions |
404 |
Not found; the repository or milestone does not exist |
429 |
Too many requests; rate limit triggered |
500 |
Internal system error |
Request example¶
Parameter description¶
Replace
<owner>with the address of the namespace that owns the repository (the address path of an enterprise, organization, or personal namespace); replace<repo>with the repository path (path); replace<number>with the milestone serial number; replace<token>with your AtomGit user access token.
cURL¶
curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/milestones/<number>?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>/milestones/<number>?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>/milestones/<number>",
params={"access_token": "<token>"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print("Deleted successfully")
Response example¶
Status code: 200
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing/invalid access token) |
403 |
Forbidden (the token has insufficient permissions) |
404 |
The request path does not exist or the milestone does not exist |
429 |
Too many requests; rate limit triggered |
500 |
Internal system error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc