Get the enterprises associated with an organization¶
GET /api/v8/org/{org}/enterprise
Call this endpoint to get the enterprises associated with an organization. Pass the organization's address path (the address path of the enterprise, organization, or user) and the endpoint returns the enterprise information associated with that organization.
Supported access tokens¶
- AtomGit user access tokens
Anonymous access allowed¶
This endpoint allows anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
org |
path | string | Yes | Namespace address to which the repository belongs (address path of the enterprise, organization, or user) |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | Yes | No | Enterprise ID |
name |
string | Yes | No | Enterprise name |
Error response¶
400 Invalid parameters
400 Organization is not associated with an enterprise
403 Access forbidden
Error field names and structure follow what the backend actually returns.
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
400 |
Invalid parameters (the organization does not exist or is not associated with an enterprise) |
403 |
Access forbidden (no permission for a non-public organization) |
Request example¶
Parameter notes¶
Replace <org> in the example with the organization's address path (the address path of the enterprise, organization, or user).
This endpoint allows anonymous access. When you have an AtomGit user access token, pass it as the access_token query parameter: ?access_token=<token>.
cURL¶
JavaScript¶
// Native fetch (Node.js 18+ / browsers)
const response = await fetch("https://api.atomgit.com/api/v8/org/<org>/enterprise", {
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/org/<org>/enterprise",
headers={
"Accept": "application/json",
},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
Error codes¶
| Error code | Description |
|---|---|
400 |
Invalid parameters (the organization does not exist or is not associated with an enterprise) |
403 |
Access forbidden (no permission for a non-public organization) |
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