Skip to content

Get the permission mode of a project

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

Call this endpoint to get the permission mode of the project (the member permission management mode).

Supported access tokens

  • AtomGit user access tokens

Anonymous access allowed

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Namespace address to which the repository belongs (address path of the organization or user)
repo path string Yes Repository path (path)
access_token query string Yes User authorization code

Response parameters

Field Type Always returned Nullable Description
memberMgntMode integer Yes No Member permission management mode; enum: 1 inherited mode, 2 independent mode, 3 mixed mode

Error response

400 Invalid parameters

{
  "errorCode": 400,
  "errorCodeName": "BAD_REQUEST",
  "errorMessage": "Incorrect parameter type"
}

401 Unauthenticated

{
  "errorCode": 401,
  "errorCodeName": "UNAUTHORIZED",
  "errorMessage": "Unauthorized"
}

HTTP status codes

Status code Description
200 Success (OK)
400 Invalid parameters (Bad request)
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
404 Request path does not exist (Not found)
429 Too many requests; rate limit triggered (Too many requests)
500 Internal system error (Internal server error)

Request example

Parameter notes

  • Replace <owner> with the namespace address to which the repository belongs (address path of the organization or user);
  • 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>/transition?access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
  "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/transition?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

resp = requests.get(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/transition",
    params={"access_token": "<token>"},
    headers={
        "Accept": "application/json",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "memberMgntMode": 1
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access credentials)
400 Invalid parameters or the request cannot be parsed
403 Access forbidden (insufficient permission or not on the allowlist)
404 Request path does not exist
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