GitLab CI/CD feature_flags API

Operations related to feature flags

Operations 10

GET /api/v4/projects/{id}/feature_flags List feature flags for a project #
POST /api/v4/projects/{id}/feature_flags Create a new feature flag #
GET /api/v4/projects/{id}/feature_flags/{feature_flag_name} Get a single feature flag #
PUT /api/v4/projects/{id}/feature_flags/{feature_flag_name} Update a feature flag #
DELETE /api/v4/projects/{id}/feature_flags/{feature_flag_name} Delete a feature flag #
GET /api/v4/projects/{id}/feature_flags_user_lists List all feature flag user lists for a project #
POST /api/v4/projects/{id}/feature_flags_user_lists Create a feature flag user list #
GET /api/v4/projects/{id}/feature_flags_user_lists/{iid} Get a feature flag user list #
PUT /api/v4/projects/{id}/feature_flags_user_lists/{iid} Update a feature flag user list #
DELETE /api/v4/projects/{id}/feature_flags_user_lists/{iid} Delete feature flag user list #

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-feature-flags-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-feature-flags-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab access_requests Feature Flags API
  version: v4
  description: Operations related to access requests
servers:
- url: https://gitlab.com
tags:
- name: feature_flags
  description: Operations related to feature flags
paths:
  /api/v4/projects/{id}/feature_flags:
    get:
      summary: List feature flags for a project
      description: Gets all feature flags of the requested project. This feature was introduced in GitLab 12.5.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: query
        name: scope
        description: 'The scope of feature flags, one of: `enabled`, `disabled`'
        required: false
        schema:
          type: string
          enum:
          - enabled
          - disabled
      - 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: List feature flags for a project
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/API_Entities_FeatureFlag'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - feature_flags
      operationId: getApiV4ProjectsIdFeatureFlags
    post:
      summary: Create a new feature flag
      description: Creates a new feature flag. This feature was introduced in GitLab 12.5.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Create a new feature flag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_FeatureFlag'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      tags:
      - feature_flags
      operationId: postApiV4ProjectsIdFeatureFlags
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdFeatureFlags'
        required: true
  /api/v4/projects/{id}/feature_flags/{feature_flag_name}:
    get:
      summary: Get a single feature flag
      description: Gets a single feature flag. This feature was introduced in GitLab 12.5.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: path
        name: feature_flag_name
        description: The name of the feature flag
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Get a single feature flag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_FeatureFlag'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - feature_flags
      operationId: getApiV4ProjectsIdFeatureFlagsFeatureFlagName
    put:
      summary: Update a feature flag
      description: Updates a feature flag. This feature was introduced in GitLab 13.2.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: path
        name: feature_flag_name
        description: The name of the feature flag
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Update a feature flag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_FeatureFlag'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '422':
          description: Unprocessable entity
      tags:
      - feature_flags
      operationId: putApiV4ProjectsIdFeatureFlagsFeatureFlagName
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/putApiV4ProjectsIdFeatureFlagsFeatureFlagName'
        required: true
    delete:
      summary: Delete a feature flag
      description: Deletes a feature flag. This feature was introduced in GitLab 12.5.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: path
        name: feature_flag_name
        description: The name of the feature flag
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
      tags:
      - feature_flags
      operationId: deleteApiV4ProjectsIdFeatureFlagsFeatureFlagName
  /api/v4/projects/{id}/feature_flags_user_lists:
    get:
      summary: List all feature flag user lists for a project
      description: Gets all feature flag user lists for the requested project. This feature was introduced in GitLab 12.10.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: query
        name: search
        description: Return user lists matching the search criteria
        required: false
        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: List all feature flag user lists for a project
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/API_Entities_FeatureFlag_UserList'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - feature_flags
      operationId: getApiV4ProjectsIdFeatureFlagsUserLists
    post:
      summary: Create a feature flag user list
      description: Creates a feature flag user list. This feature was introduced in GitLab 12.10.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Create a feature flag user list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_FeatureFlag_UserList'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - feature_flags
      operationId: postApiV4ProjectsIdFeatureFlagsUserLists
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdFeatureFlagsUserLists'
        required: true
  /api/v4/projects/{id}/feature_flags_user_lists/{iid}:
    get:
      summary: Get a feature flag user list
      description: Gets a feature flag user list. This feature was introduced in GitLab 12.10.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: path
        name: iid
        description: The internal ID of the project's feature flag user list
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Get a feature flag user list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_FeatureFlag_UserList'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - feature_flags
      operationId: getApiV4ProjectsIdFeatureFlagsUserListsIid
    put:
      summary: Update a feature flag user list
      description: Updates a feature flag user list. This feature was introduced in GitLab 12.10.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: path
        name: iid
        description: The internal ID of the project's feature flag user list
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Update a feature flag user list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_FeatureFlag_UserList'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - feature_flags
      operationId: putApiV4ProjectsIdFeatureFlagsUserListsIid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/putApiV4ProjectsIdFeatureFlagsUserListsIid'
        required: true
    delete:
      summary: Delete feature flag user list
      description: Deletes a feature flag user list. This feature was introduced in GitLab 12.10.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: path
        name: iid
        description: The internal ID of the project's feature flag user list
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Delete feature flag user list
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '409':
          description: Conflict
      tags:
      - feature_flags
      operationId: deleteApiV4ProjectsIdFeatureFlagsUserListsIid
components:
  schemas:
    API_Entities_FeatureFlag_Strategy:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 1
        name:
          type: string
          example: userWithId
        parameters:
          type: string
          example: '{"userIds": "user1"}'
        scopes:
          $ref: '#/components/schemas/API_Entities_FeatureFlag_Scope'
        user_list:
          $ref: '#/components/schemas/API_Entities_FeatureFlag_BasicUserList'
      required:
      - id
      - name
      - parameters
      - scopes
      - user_list
    putApiV4ProjectsIdFeatureFlagsFeatureFlagName:
      type: object
      properties:
        name:
          type: string
          description: The new name of the feature flag. Supported in GitLab 13.3 and later
        description:
          type: string
          description: The description of the feature flag
        active:
          type: boolean
          description: The active state of the flag. Supported in GitLab 13.3 and later
        strategies:
          type: array
          description: Array of feature flag strategies
          items:
            type: object
            properties:
              id:
                type: integer
                format: int32
                description: The feature flag strategy ID
              name:
                type: string
                description: The strategy name
              parameters:
                type: string
                description: The strategy parameters as a JSON-formatted string e.g. `{"userIds":"user1"}`
              user_list_id:
                type: integer
                format: int32
                description: The ID of the feature flag user list
              _destroy:
                type: boolean
                description: Delete the strategy when true
              scopes:
                type: array
                description: Array of scopes for the strategy
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      format: int32
                      description: The scope id
                    environment_scope:
                      type: string
                      description: The environment scope of the scope
                    _destroy:
                      type: boolean
                      description: Delete the scope when true
      description: Update a feature flag
    API_Entities_FeatureFlag_Scope:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 1
        environment_scope:
          type: string
          example: production
      required:
      - id
      - environment_scope
    putApiV4ProjectsIdFeatureFlagsUserListsIid:
      type: object
      properties:
        name:
          type: string
          description: The name of the list
        user_xids:
          type: string
          description: A comma separated list of external user ids
      description: Update a feature flag user list
    API_Entities_FeatureFlag_BasicUserList:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 1
        iid:
          type: integer
          format: int32
          example: 1
        name:
          type: string
          example: user_list
        user_xids:
          type: string
          example: user1,user2
      required:
      - id
      - iid
      - name
      - user_xids
    API_Entities_FeatureFlag_UserList:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 1
        iid:
          type: integer
          format: int32
          example: 1
        name:
          type: string
          example: user_list
        user_xids:
          type: string
          example: user1,user2
        project_id:
          type: integer
          format: int32
          example: 2
        created_at:
          type: string
          format: date-time
          example: '2020-02-04T08:13:10.507Z'
        updated_at:
          type: string
          format: date-time
          example: '2020-02-04T08:13:10.507Z'
        path:
          type: string
        edit_path:
          type: string
      required:
      - id
      - iid
      - name
      - user_xids
      - project_id
      - created_at
      - updated_at
      - path
      - edit_path
      description: API_Entities_FeatureFlag_UserList model
    postApiV4ProjectsIdFeatureFlags:
      type: object
      properties:
        name:
          type: string
          description: The name of the feature flag
        description:
          type: string
          description: The description of the feature flag
        active:
          type: boolean
          description: The active state of the flag. Defaults to `true`. Supported in GitLab 13.3 and later
        version:
          type: string
          description: The version of the feature flag. Must be `new_version_flag`. Omit to create a Legacy feature flag.
        strategies:
          type: array
          description: Array of feature flag strategies
          items:
            type: object
            properties:
              name:
                type: string
                description: The strategy name. Can be `default`, `gradualRolloutUserId`, `userWithId`, or `gitlabUserList`. In GitLab 13.5 and later, can be `flexibleRollout`
              parameters:
                type: string
                description: The strategy parameters as a JSON-formatted string e.g. `{"userIds":"user1"}`
              user_list_id:
                type: integer
                format: int32
                description: The ID of the feature flag user list. If strategy is `gitlabUserList`.
              scopes:
                type: array
                description: Array of scopes for the strategy
                items:
                  type: object
                  properties:
                    environment_scope:
                      type: string
                      description: The environment scope of the scope
                  required:
                  - environment_scope
            required:
            - name
      required:
      - name
      description: Create a new feature flag
    API_Entities_FeatureFlag:
      type: object
      properties:
        name:
          type: string
          example: merge_train
        description:
          type: string
          example: merge train feature flag
        active:
          type: boolean
        version:
          type: string
          example: new_version_flag
        created_at:
          type: string
          format: date-time
          example: '2019-11-04T08:13:51.423Z'
        updated_at:
          type: string
          format: date-time
          example: '2019-11-04T08:13:51.423Z'
        scopes:
          type: string
        strategies:
          $ref: '#/components/schemas/API_Entities_FeatureFlag_Strategy'
      required:
      - name
      - description
      - active
      - version
      - created_at
      - updated_at
      - scopes
      - strategies
      description: API_Entities_FeatureFlag model
    postApiV4ProjectsIdFeatureFlagsUserLists:
      type: object
      properties:
        name:
          type: string
          description: The name of the list
        user_xids:
          type: string
          description: A comma separated list of external user ids
      required:
      - name
      - user_xids
      description: Create a feature flag user list
  securitySchemes:
    access_token_header:
      type: apiKey
      name: PRIVATE-TOKEN
      in: header
    access_token_query:
      type: apiKey
      name: private_token
      in: query