Delete a repository¶
DELETE /api/v5/repos/{owner}/{repo}
Deletes the specified repository. The target repository is located by its namespace address and repository path; on success it returns an empty object, and if the repository does not exist it returns the corresponding error message.
Supported access tokens¶
- AtomGit user access tokens
Anonymous access allowed¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Namespace address to which the repository belongs (address path of the organization or user) |
repo |
path | string | Yes | Repository path (path) |
access_token |
query | string | Yes | User authorization code |
Response parameters¶
On success the endpoint returns an empty object {} with no business fields.
Error response¶
Callers need to understand the failure response shape in order to write error handling. The error field names in the examples below follow what the backend actually returns.
401 Unauthenticated
404 Repository does not exist
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Authentication required (Requires authentication) |
403 |
Access forbidden (Forbidden) |
404 |
Repository does not exist (Not found) |
Request example¶
Parameter notes¶
Replace
<owner>with the namespace address to which the repository belongs (address path of the organization or user); replace<repo>with the repository path (path); replace<token>with your AtomGit user access token.
cURL¶
curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>?access_token=<token>' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>?access_token=<token>",
{
method: "DELETE",
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.delete(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>",
params={"access_token": "<token>"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access credentials) |
403 |
Access forbidden (no permission to delete this repository) |
404 |
Repository does not exist |
500 |
Internal system error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc