Skip to content

Get project protected tag details

GET /api/v5/repos/{owner}/{repo}/protected_tags/{tag_name}

This endpoint gets the details of a protected tag in the specified repository. It returns the tag name, the minimum role level allowed to create (push) the tag, and the corresponding role level description.

Access token support

  • AtomGit user access token (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 to which the repository belongs (address path of the organization or user)
repo path string Yes Repository path (path)
tag_name path string Yes Tag name
access_token query string Yes User authorization code

Response parameters

Field Type Always returned Nullable Description
name string Yes No Tag name of the protected tag
create_access_level integer Yes Yes Minimum role level allowed to create (push) this protected tag; enum: 0 (no one), 30 (Developer, Maintainer, Administrator), 40 (Maintainer, Administrator)
create_access_level_desc string Yes Yes Role level description corresponding to create_access_level, such as Developer, Maintainer, Administrator

Error responses

In addition to a successful response, this endpoint may return the following error responses (the actual error field names prevail):

401 Unauthenticated

{
  "error_code": 401,
  "error_code_name": "UNAUTHORIZED",
  "error_message": "Bad credentials",
  "trace_id": "string"
}

404 Tag not found

{
  "error_code": 404,
  "error_code_name": "NOT_PATH",
  "error_message": "Tag not found: tag_name",
  "trace_id": "string"
}

400 Invalid parameter

{
  "error_code": 400,
  "error_code_name": "PARAMETER_ERROR",
  "error_message": "Invalid parameter",
  "trace_id": "string"
}

HTTP response status codes

Status code Description
200 Success (OK)
400 Invalid parameter (Bad request)
401 Authentication required (Requires authentication)
404 Not found (Not found)
429 Too many requests; rate limit triggered (Too many requests)
500 Internal system error (Internal server error)

Request example

Parameter description

  • 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 <tag_name> with the tag name of the protected tag;
  • replace <token> with your AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/protected_tags/<tag_name>?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>/protected_tags/<tag_name>?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>/protected_tags/<tag_name>",
    params={"access_token": "<token>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "name": "tag_name",
  "create_access_level": 30,
  "create_access_level_desc": "Developer, Maintainer, Administrator"
}

Error codes

Error code Description
400 Invalid parameter or the request could not be parsed
401 Unauthenticated or invalid credentials (missing or invalid access credentials)
404 The request path does not exist, or the corresponding tag was not found
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