Skip to content

Get all members of a repository

GET /api/v5/repos/{owner}/{repo}/collaborators

This endpoint retrieves all members of the specified repository and supports pagination by page number and page size. The response includes each member's basic profile (such as member ID, login name, avatar, and home page) together with permission details (pull, push, administrator or not), so that you can review the composition of the repository members and their access permissions.

Supported access tokens

  • AtomGit user access tokens

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Namespace address of the repository (address path of the organization or individual)
repo path string Yes Repository path (path)
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 is 100, default 20

Response parameters

The endpoint returns an array of member objects (array<object>), where each element represents one repository member. The fields are described below:

Member object

Field Type Always returned Nullable Description
id string Yes No Member ID
name string Yes No Member name
username string Yes No Member login name
nick_name — No Yes Nickname
state — No Yes User state
avatar — No Yes Avatar
avatar_url — No Yes Avatar URL
email — No Yes Email address
name_cn — No Yes Name in Chinese
web_url string Yes No Member home page URL
access_level — No Yes Access level
expires_at — No Yes Expiration time
limited — No Yes Whether the member is restricted
type string Yes No Member type (such as ProjectMember)
last_owner — No Yes Previous repository owner
is_current_source_member — No Yes Whether the member belongs to the current source
last_source_owner — No Yes Previous source owner
join_way — No Yes Join method
source_name — No Yes Source name
member_roles — No Yes Member roles
iam_id — No Yes IAM ID
committer_system_from — No Yes Committer system source
permissions object Yes No Permission information

permissions object

Field Type Always returned Nullable Description
permissions.pull — No Yes Permission to pull (pull)
permissions.push — No Yes Permission to push (push)
permissions.admin integer Yes No Whether the member is an administrator (the reference examples return the boolean values true/false)

Note: The reference documentation does not specify the exact type of some fields (their example values are null and are marked with — in the table). The actual types are those returned by the endpoint.

Error responses

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Invalid request parameters"
}

401 Unauthenticated

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

403 Access denied

{
  "error": "forbidden",
  "message": "You do not have permission to view the members of this repository"
}

Note: The error responses above are generic examples only; the actual field names are those returned by the backend.

HTTP status codes

Status code Description
200 Success (OK)
401 Authentication required (Requires authentication)
403 Access denied (Forbidden)

Request example

Parameter notes

The placeholders in the example mean the following:

Replace <owner> with the namespace address of the repository (address path of the organization or individual); replace <repo> with the repository path (path); replace <token> with your AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/collaborators?access_token=<token>&page=1&per_page=20' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const params = new URLSearchParams({
  access_token: "<YOUR-TOKEN>",
  page: "1",
  per_page: "20",
});

const response = await fetch(
  `https://api.atomgit.com/api/v5/repos/<owner>/<repo>/collaborators?${params}`,
  {
    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/repos/<owner>/<repo>/collaborators",
    params={
        "access_token": "<YOUR-TOKEN>",
        "page": 1,
        "per_page": 20,
    },
    headers={
        "Accept": "application/json",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": "708",
    "name": "Lzm_0916",
    "username": "Lzm_0916",
    "nick_name": null,
    "state": null,
    "avatar": null,
    "avatar_url": null,
    "email": null,
    "name_cn": null,
    "web_url": "https://api.atomgit.com/Lzm_0916",
    "access_level": null,
    "expires_at": null,
    "limited": null,
    "type": "ProjectMember",
    "last_owner": null,
    "is_current_source_member": null,
    "last_source_owner": null,
    "join_way": null,
    "source_name": null,
    "member_roles": null,
    "iam_id": null,
    "committer_system_from": null,
    "permissions": {
      "pull": null,
      "push": null,
      "admin": true
    }
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access token)
403 Access denied; no permission for the operation
404 Request path not found
429 Too many requests; rate limit triggered
500 Internal server error

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