GitLab CI/CD protected_tags API

Operations about protected_tags

Operations 4

GET /api/v4/projects/{id}/protected_tags Get a project's protected tags #
POST /api/v4/projects/{id}/protected_tags Protect a single tag or wildcard #
GET /api/v4/projects/{id}/protected_tags/{name} Get a single protected tag #
DELETE /api/v4/projects/{id}/protected_tags/{name} Unprotect a single tag #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gitlab-ci-protected-tags-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gitlab-ci-protected-tags-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab access_requests Protected Tags API
  version: v4
  description: Operations related to access requests
servers:
- url: https://gitlab.com
tags:
- name: protected_tags
  description: Operations about protected_tags
paths:
  /api/v4/projects/{id}/protected_tags:
    get:
      summary: Get a project's protected tags
      description: This feature was introduced in GitLab 11.3.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: query
        name: page
        description: Current page number
        required: false
        example: 1
        schema:
          type: integer
          format: int32
          default: 1
      - in: query
        name: per_page
        description: Number of items per page
        required: false
        example: 20
        schema:
          type: integer
          format: int32
          default: 20
      responses:
        '200':
          description: Get a project's protected tags
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/API_Entities_ProtectedTag'
        '403':
          description: Unauthenticated
        '404':
          description: Not found
      tags:
      - protected_tags
      operationId: getApiV4ProjectsIdProtectedTags
    post:
      summary: Protect a single tag or wildcard
      description: This feature was introduced in GitLab 11.3.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Protect a single tag or wildcard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_ProtectedTag'
        '403':
          description: Unauthenticated
        '404':
          description: Not found
        '422':
          description: Unprocessable entity
      tags:
      - protected_tags
      operationId: postApiV4ProjectsIdProtectedTags
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdProtectedTags'
        required: true
  /api/v4/projects/{id}/protected_tags/{name}:
    get:
      summary: Get a single protected tag
      description: This feature was introduced in GitLab 11.3.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: path
        name: name
        description: The name of the tag or wildcard
        required: true
        example: release*
        schema:
          type: string
      responses:
        '200':
          description: Get a single protected tag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_ProtectedTag'
        '403':
          description: Unauthenticated
        '404':
          description: Not found
      tags:
      - protected_tags
      operationId: getApiV4ProjectsIdProtectedTagsName
    delete:
      summary: Unprotect a single tag
      description: This feature was introduced in GitLab 11.3.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: path
        name: name
        description: The name of the protected tag
        required: true
        example: release-1-0
        schema:
          type: string
      responses:
        '204':
          description: Unprotect a single tag
        '403':
          description: Unauthenticated
        '404':
          description: Not found
        '412':
          description: Precondition Failed
      tags:
      - protected_tags
      operationId: deleteApiV4ProjectsIdProtectedTagsName
components:
  schemas:
    postApiV4ProjectsIdProtectedTags:
      type: object
      properties:
        name:
          type: string
          description: The name of the protected tag
          example: release-1-0
        create_access_level:
          type: integer
          format: int32
          description: 'Access levels allowed to create (defaults: `40`, maintainer access level)'
          enum:
          - 30
          - 40
          - 60
          - 0
          example: 30
        allowed_to_create:
          type: array
          description: Array of users, groups, deploy keys, or access levels allowed to create protected branches
          items:
            type: object
            properties:
              deploy_key_id:
                type: integer
                format: int32
                description: ID of a deploy key
              access_level:
                type: integer
                format: int32
                description: ID of an access level
                enum:
                - 30
                - 40
                - 60
                - 0
              user_id:
                type: integer
                format: int32
                description: ID of a user
              group_id:
                type: integer
                format: int32
                description: ID of a group
      required:
      - name
      description: Protect a single tag or wildcard
    API_Entities_ProtectedTag:
      type: object
      properties:
        name:
          type: string
          example: release-1-0
        create_access_levels:
          type: array
          items:
            $ref: '#/components/schemas/API_Entities_ProtectedRefAccess'
      required:
      - name
      - create_access_levels
      description: API_Entities_ProtectedTag model
    API_Entities_ProtectedRefAccess:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 1
        access_level:
          type: integer
          format: int32
          example: 40
        access_level_description:
          type: string
          example: Maintainers
        deploy_key_id:
          type: integer
          format: int32
          example: 1
        user_id:
          type: integer
          format: int32
          example: 1
        group_id:
          type: integer
          format: int32
          example: 1
      required:
      - id
      - access_level
      - access_level_description
      - user_id
      - group_id
  securitySchemes:
    access_token_header:
      type: apiKey
      name: PRIVATE-TOKEN
      in: header
    access_token_query:
      type: apiKey
      name: private_token
      in: query