Get enterprise custom roles¶
GET /api/v8/enterprise/{enterprise_id}/customized_roles
Call this endpoint to get enterprise custom roles.
Supported access tokens¶
- AtomGit user access tokens
Anonymous access allowed¶
This endpoint allows anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
enterprise_id |
path | string | Yes | Enterprise ID |
access_token |
query | string | No | User authorization code |
Response parameters¶
The response body is an array of custom role objects (array); each element contains the following fields:
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
string | Yes | — | Role ID |
name |
string | Yes | — | Role name |
name_cn |
string | Yes | — | Role name in Chinese |
product_id |
string | Yes | — | Product ID |
access_level |
integer | Yes | — | Access level |
created_at |
string | Yes | — | Creation time |
role_type |
string | Yes | — | Role type |
updated_at |
string | Yes | — | Update time |
description |
string | Yes | — | Role description |
mgnt_mode |
integer | Yes | — | Management mode |
member_count |
integer | Yes | — | Number of members |
Error response¶
This endpoint has no business-level error response.
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
Request example¶
Parameter notes¶
Replace
<enterprise_id>with the enterprise ID; this endpoint allows anonymous access, and you may also send an AtomGit user access token (optional; append?access_token=<token>to the URL).
cURL¶
curl -X GET 'https://api.atomgit.com/api/v8/enterprise/<enterprise_id>/customized_roles' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browsers)
const response = await fetch("https://api.atomgit.com/api/v8/enterprise/<enterprise_id>/customized_roles", {
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/v8/enterprise/<enterprise_id>/customized_roles",
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc