List all namespaces of the authorized user¶
GET /api/v5/user/namespaces
Call this endpoint to list all namespaces of the authorized user.
Supported access tokens¶
- AtomGit user access token (AtomGit user access tokens)
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
access_token |
query | string | Yes | User authorization code |
mode |
query | string | No | Participation mode: project(namespaces of all repositories the user participates in), intrant(namespaces the user has joined), all(both of the above); default intrant |
page |
query | integer | No | Current page number |
perPage |
query | integer | No | Number of projects per page |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | Yes | No | Namespace ID |
path |
string | Yes | No | Namespace path (path) |
name |
string | Yes | No | Namespace name |
html_url |
string | Yes | No | Namespace URL |
type |
string | Yes | No | Namespace type: user(user), group(organization) |
Error response¶
401 Unauthenticated
The actual error field names returned by the backend take precedence; the example is illustrative only.
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Requires authentication |
403 |
Forbidden |
Request example¶
Parameter notes¶
access_token is a required query parameter; all other parameters are optional. Replace the placeholders below with actual values and the call succeeds:
<token>Replace with your AtomGit user access token.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/user/namespaces?access_token=<token>' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/user/namespaces?access_token=<YOUR-TOKEN>", {
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/user/namespaces",
params={"access_token": "<YOUR-TOKEN>"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
[
{
"id": 1,
"path": "octocat",
"name": "octocat",
"html_url": "https://api.atomgit.com/octocat",
"type": "user"
},
{
"id": 2,
"path": "atomgit",
"name": "AtomGit",
"html_url": "https://api.atomgit.com/atomgit",
"type": "group"
}
]
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access token) |
400 |
Invalid parameters or unparseable request |
404 |
Request path does not exist |
405 |
Request method not supported |
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