Skip to content

List all members of an organization

GET /api/v5/orgs/{org}/members

This endpoint returns the full member list of the specified organization. It supports pagination and filtering by member role (admin or regular member), and returns details such as each member's avatar, nickname, login name, and role.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
org path string Yes Enterprise path (path/login)
access_token query string Yes User authorization code
page query integer No Current page number; defaults to 1
per_page query integer No Number of items per page; maximum 100, default 20
role query string No Filter members by role (all / admin / member)

Request example

Parameter description

Description of the placeholders used in the examples:

Replace <org> with the organization path name (the address path of an enterprise, organization, or user); replace <token> with your AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/orgs/<org>/members?page=1&per_page=20&role=admin&access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const org = "<org>";
const token = "<token>";

const response = await fetch(
  `https://api.atomgit.com/api/v5/orgs/${org}/members?page=1&per_page=20&role=admin&access_token=${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

org = "<org>"
token = "<token>"

resp = requests.get(
    f"https://api.atomgit.com/api/v5/orgs/{org}/members",
    params={
        "page": 1,
        "per_page": 20,
        "role": "admin",
        "access_token": token,
    },
    headers={
        "Accept": "application/json",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response parameters

Field Type Always returned Nullable Description
avatar_url string No Yes Avatar URL
followers_url string No Yes Followers list URL
html_url string No Yes User profile URL
id string No Yes User ID
login string No Yes Login name
member_role string No Yes Member role
name string No Yes User nickname
type string No Yes User type (such as User)
url string No Yes API URL
user_id string No Yes User ID
object_id string No Yes Object ID

Note: The response body is an array of member objects; the table above lists the fields of each array element.

Error responses

Callers need to know what the response looks like on failure so that they can write error handling.

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

The actual error field names are those returned by the backend.

HTTP response status codes

Status code Description
200 Success (OK)
401 Requires authentication
403 Forbidden

Response example

Status code: 200

[
  {
    "avatar_url": "https://cdn-img.atomgit.com/ec/fb/430ecf07b9ee91bbbbf341d92a36783d06e69086f82ce8cf5a6406f79f1c9cf4.png",
    "followers_url": "https://api.atomgit.com/api/v5/users/dengmengmian/followers",
    "html_url": "https://api.atomgit.com/dengmengmian",
    "id": "268",
    "login": "dengmengmian",
    "member_role": "admin",
    "name": "Ma Fan",
    "type": "User",
    "url": "https://api.atomgit.com/api/v5/dengmengmian",
    "user_id": "268",
    "object_id": "8f9d2c1e0a4b7c3d9e2f1a6b"
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
400 Parameter error or the request cannot be parsed
404 The request path does not exist
405 The request method is not supported
429 Too many requests; the rate limit was triggered
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc