Skip to content

Get repository settings

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

The user calls this endpoint to get repository settings.

Access token support

  • AtomGit user 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 Address path of the namespace the repository belongs to (the address path of an enterprise, organization, or individual)
repo path string Yes Repository path (path)
access_token query string Yes User authorization code

Response parameters

Field Type Always returned Nullable Description
forbidden_developer_create_branch boolean Yes No Whether developers are prohibited from creating branches
forbidden_developer_create_tag boolean Yes No Whether developers are prohibited from creating tags
forbidden_committer_create_branch boolean Yes No Whether committers are prohibited from creating branches
generate_pre_merge_ref boolean Yes No Whether to generate the pre-merge ref
forbidden_gitlab_access boolean Yes No Whether GitLab access is prohibited
rebase_disable_trigger_webhook boolean Yes No Whether triggering Webhooks is disabled during rebase
action_pipeline_enabled boolean Yes No Whether Actions pipelines are enabled
block_cross_repo_pr_trigger boolean Yes No Whether cross-repository Pull Request triggering is blocked
show_branch_creator boolean Yes No Whether to show branch creator information, corresponding to the "Show branch creator information" checkbox on the page
disable_fork boolean No No Whether Fork is prohibited
include_lfs_objects boolean No No Whether LFS objects are included

Note: The set of response fields may vary by repository; fields such as disable_fork and include_lfs_objects appear only in some responses; the actual response takes precedence.

Error response

This endpoint requires authentication; it returns 401 when access_token is missing or invalid; the actual error field names are subject to what the backend returns.

401 Unauthenticated

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

HTTP response status codes

Status code Description
200 Success (OK)
401 Authentication required (Requires authentication)
403 Forbidden
404 Repository or resource not found
500 Internal system error

Request example

Parameter description

Replace <owner> with the address path of the namespace the repository belongs to (the address path of an enterprise, 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>/repo_settings?access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch(
  "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/repo_settings?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>/repo_settings",
    params={"access_token": "<token>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "forbidden_developer_create_branch": true,
  "forbidden_developer_create_tag": true,
  "forbidden_committer_create_branch": true,
  "generate_pre_merge_ref": true,
  "forbidden_gitlab_access": true,
  "rebase_disable_trigger_webhook": true,
  "action_pipeline_enabled": true,
  "block_cross_repo_pr_trigger": true,
  "show_branch_creator": true
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
400 Parameter error or the request cannot be parsed
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