GitLab Project approvals API

Use this API to retrieve and change a project's [merge request approval configuration](https://docs.gitlab.com/user/project/merge_requests/approvals/settings/), such as the number of approvals a merge request requires. All endpoints require authentication.

Operations 2

GET /api/v4/projects/{id}/approvals Retrieve approval configuration for a project #
POST /api/v4/projects/{id}/approvals Create or update approval configuration for a project #

Documentation

📖
Documentation
https://docs.gitlab.com/api/openapi/
📖
Documentation
https://docs.gitlab.com/api/issues/
📖
Authentication
https://docs.gitlab.com/api/rest/authentication/
📖
Documentation
https://docs.gitlab.com/api/merge_requests/
📖
Documentation
https://docs.gitlab.com/api/pipelines/
📖
Documentation
https://docs.gitlab.com/api/jobs/
📖
Documentation
https://docs.gitlab.com/api/runners/
📖
Documentation
https://docs.gitlab.com/api/users/
📖
Documentation
https://docs.gitlab.com/api/repositories/
📖
Documentation
https://docs.gitlab.com/api/commits/
📖
Documentation
https://docs.gitlab.com/api/branches/
📖
Documentation
https://docs.gitlab.com/api/tags/
📖
Documentation
https://docs.gitlab.com/api/releases/
📖
Documentation
https://docs.gitlab.com/api/environments/
📖
Documentation
https://docs.gitlab.com/api/deployments/
📖
Documentation
https://docs.gitlab.com/api/pipeline_schedules/
📖
Documentation
https://docs.gitlab.com/api/labels/
📖
Documentation
https://docs.gitlab.com/api/milestones/
📖
Documentation
https://docs.gitlab.com/api/notes/
📖
Documentation
https://docs.gitlab.com/api/snippets/
📖
Documentation
https://docs.gitlab.com/api/packages/
📖
Documentation
https://docs.gitlab.com/api/container_registry/
📖
Documentation
https://docs.gitlab.com/api/vulnerabilities/
📖
Documentation
https://docs.gitlab.com/api/deploy_keys/
📖
Documentation
https://docs.gitlab.com/api/protected_branches/
📖
Documentation
https://docs.gitlab.com/api/wikis/
📖
Documentation
https://docs.gitlab.com/api/events/
📖
Documentation
https://docs.gitlab.com/api/search/
📖
Documentation
https://docs.gitlab.com/api/namespaces/
📖
Documentation
https://docs.gitlab.com/api/groups/
📖
Documentation
https://docs.gitlab.com/api/projects/
📖
Documentation
https://docs.gitlab.com/api/applications/
📖
Documentation
https://docs.gitlab.com/api/avatar/
📖
Documentation
https://docs.gitlab.com/api/broadcast_messages/
📖
Documentation
https://docs.gitlab.com/api/bulk_imports/
📖
Documentation
https://docs.gitlab.com/api/settings/
📖
Documentation
https://docs.gitlab.com/api/metadata/
📖
Documentation
https://docs.gitlab.com/api/version/
📖
Documentation
https://docs.gitlab.com/api/rest/
📖
APIReference
https://docs.gitlab.com/api/api_resources/
📖
RateLimits
https://docs.gitlab.com/security/rate_limits/
📖
Documentation
https://docs.gitlab.com/api/oauth2/
📖
Authentication
https://docs.gitlab.com/integration/oauth_provider/
📖
Documentation
https://docs.gitlab.com/user/project/integrations/webhooks.html
📖
APIReference
https://docs.gitlab.com/api/project_webhooks/

Specifications

Schemas & Data

📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-put-api-v4-application-settings-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-geo-node-status-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-geo-site-status-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-application-setting-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-post-api-v4-geo-status-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-put-api-v4-projects-id-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-cluster-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-batched-background-migration-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-ci-variable-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-dictionary-table-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-plan-limit-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-appearance-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-avatar-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-bulk-imports-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-bulk-import-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-metadata-schema.json

Other Resources

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:gitlab-project-approvals-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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-project-approvals-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab REST Project approvals API
  description: GitLab REST API used to interact with a GitLab installation.
  termsOfService: https://handbook.gitlab.com/handbook/legal/api-terms/
  version: '19.6'
  license:
    name: CC BY-SA 4.0
    url: https://gitlab.com/gitlab-org/gitlab/-/blob/master/LICENSE
    x-gitlab-description: The license applies to the OpenAPI specification document itself. For terms governing use of the GitLab API, see the termsOfService field.
servers:
- url: https://{hostname}
  description: GitLab REST API
  variables:
    hostname:
      default: gitlab.com
      description: Your GitLab instance hostname
security:
- http: []
- oauth2: []
- apiKey: []
tags:
- name: Project approvals
  description: 'Use this API to retrieve and change a project''s

    merge request approval configuration,

    such as the number of approvals a merge request requires.


    All endpoints require authentication.'
  x-displayName: Project approvals
  externalDocs:
    url: https://docs.gitlab.com/api/merge_request_approvals/
paths:
  /api/v4/projects/{id}/approvals:
    get:
      operationId: getApiV4ProjectsIdApprovals
      summary: Retrieve approval configuration for a project
      description: Retrieves the approval configuration for a project.
      tags:
      - Project approvals
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesApprovalSettings'
        '404':
          description: Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      x-gitlab-tier: premium
    post:
      operationId: postApiV4ProjectsIdApprovals
      summary: Create or update approval configuration for a project
      description: Creates or updates the approval configuration for a project. The currently authenticated user must be an eligible approver.
      tags:
      - Project approvals
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesApprovalSettings'
        '404':
          description: Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdApprovalsRequest'
      x-gitlab-tier: premium
components:
  schemas:
    postApiV4ProjectsIdApprovalsRequest:
      type: object
      properties:
        approvals_before_merge:
          type:
          - integer
          - 'null'
          description: Number of approvals required before a merge request can be merged. At least one of `approvals_before_merge`, `reset_approvals_on_push`, `selective_code_owner_removals`, `disable_overriding_approvers_per_merge_request`, `merge_requests_author_approval`, `merge_requests_disable_committers_approval`, `require_password_to_approve`, `require_reauthentication_to_approve` must be provided.
        reset_approvals_on_push:
          type:
          - boolean
          - 'null'
          description: If `true`, resets approvals on push. At least one of `approvals_before_merge`, `reset_approvals_on_push`, `selective_code_owner_removals`, `disable_overriding_approvers_per_merge_request`, `merge_requests_author_approval`, `merge_requests_disable_committers_approval`, `require_password_to_approve`, `require_reauthentication_to_approve` must be provided.
        selective_code_owner_removals:
          type:
          - boolean
          - 'null'
          description: If `true`, resets approvals from Code Owners if their files change. To use this field, `reset_approvals_on_push` must be `false`. At least one of `approvals_before_merge`, `reset_approvals_on_push`, `selective_code_owner_removals`, `disable_overriding_approvers_per_merge_request`, `merge_requests_author_approval`, `merge_requests_disable_committers_approval`, `require_password_to_approve`, `require_reauthentication_to_approve` must be provided.
        disable_overriding_approvers_per_merge_request:
          type:
          - boolean
          - 'null'
          description: If `true`, prevents overrides of approvers in a merge request. At least one of `approvals_before_merge`, `reset_approvals_on_push`, `selective_code_owner_removals`, `disable_overriding_approvers_per_merge_request`, `merge_requests_author_approval`, `merge_requests_disable_committers_approval`, `require_password_to_approve`, `require_reauthentication_to_approve` must be provided.
        merge_requests_author_approval:
          type:
          - boolean
          - 'null'
          description: If `true`, authors can self-approve merge requests. At least one of `approvals_before_merge`, `reset_approvals_on_push`, `selective_code_owner_removals`, `disable_overriding_approvers_per_merge_request`, `merge_requests_author_approval`, `merge_requests_disable_committers_approval`, `require_password_to_approve`, `require_reauthentication_to_approve` must be provided.
        merge_requests_disable_committers_approval:
          type:
          - boolean
          - 'null'
          description: If `true`, users who commit on the merge request cannot approve it. At least one of `approvals_before_merge`, `reset_approvals_on_push`, `selective_code_owner_removals`, `disable_overriding_approvers_per_merge_request`, `merge_requests_author_approval`, `merge_requests_disable_committers_approval`, `require_password_to_approve`, `require_reauthentication_to_approve` must be provided.
        require_password_to_approve:
          type:
          - boolean
          - 'null'
          description: If `true`, requires approvers to authenticate before approving. Deprecated in GitLab 16.9. Use `require_reauthentication_to_approve` instead. At least one of `approvals_before_merge`, `reset_approvals_on_push`, `selective_code_owner_removals`, `disable_overriding_approvers_per_merge_request`, `merge_requests_author_approval`, `merge_requests_disable_committers_approval`, `require_password_to_approve`, `require_reauthentication_to_approve` must be provided.
        require_reauthentication_to_approve:
          type:
          - boolean
          - 'null'
          description: If `true`, requires approvers to authenticate before approving. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/431346) in GitLab 17.1. At least one of `approvals_before_merge`, `reset_approvals_on_push`, `selective_code_owner_removals`, `disable_overriding_approvers_per_merge_request`, `merge_requests_author_approval`, `merge_requests_disable_committers_approval`, `require_password_to_approve`, `require_reauthentication_to_approve` must be provided.
    APIEntitiesApprover:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/APIEntitiesUserBasic'
    APIEntitiesLdapGroupLink:
      type: object
      properties:
        cn:
          type: string
          example: ldap-group-1
        group_access:
          type: integer
          example: 10
        provider:
          type: string
          example: ldapmain
        filter:
          type: string
          example: id >= 500
        member_role_id:
          type: integer
          format: int64
          example: 12
    APIEntitiesApproverGroup:
      type: object
      properties:
        group:
          $ref: '#/components/schemas/APIEntitiesGroup'
    APIEntitiesCustomAttribute:
      type: object
      properties:
        key:
          type: string
          example: foo
        value:
          type: string
          example: bar
    APIEntitiesApprovalSettings:
      type: object
      properties:
        approvers:
          $ref: '#/components/schemas/APIEntitiesApprover'
        approver_groups:
          $ref: '#/components/schemas/APIEntitiesApproverGroup'
        approvals_before_merge:
          type: integer
        reset_approvals_on_push:
          type: boolean
        selective_code_owner_removals:
          type: boolean
        disable_overriding_approvers_per_merge_request:
          type: boolean
        merge_requests_author_approval:
          type: boolean
        merge_requests_disable_committers_approval:
          type: boolean
        require_password_to_approve:
          type: boolean
        require_reauthentication_to_approve:
          type: boolean
    APIEntitiesSamlGroupLink:
      type: object
      properties:
        name:
          type: string
          example: saml-group-1
        access_level:
          type: integer
          example: 40
        member_role_id:
          type: integer
          format: int64
          example: 12
        provider:
          type: string
          example: saml
    APIEntitiesNamespaceRootStorageStatistics:
      type: object
      properties:
        build_artifacts_size:
          type: integer
          description: CI artifacts size in bytes.
        container_registry_size:
          type: integer
          description: container registry size in bytes.
        container_registry_size_is_estimated:
          type: boolean
          description: Indicates whether the deduplicated container registry size for the namespace is an estimated value or not.
        dependency_proxy_size:
          type: integer
          description: Dependency Proxy sizes in bytes.
        lfs_objects_size:
          type: integer
          description: LFS objects size in bytes.
        packages_size:
          type: integer
          description: Packages size in bytes.
        pipeline_artifacts_size:
          type: integer
          description: CI pipeline artifacts size in bytes.
        repository_size:
          type: integer
          description: Git repository size in bytes.
        snippets_size:
          type: integer
          description: Snippets size in bytes.
        storage_size:
          type: integer
          description: Total storage in bytes.
        uploads_size:
          type: integer
          description: Uploads size in bytes.
        wiki_size:
          type: integer
          description: Wiki size in bytes.
    APIEntitiesUserBasic:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 1
        username:
          type: string
          example: admin
        public_email:
          type: string
          example: john@example.com
        name:
          type: string
          example: Administrator
        state:
          type: string
          example: active
        locked:
          type: boolean
        avatar_url:
          type: string
          example: https://gravatar.com/avatar/1
        avatar_path:
          type: string
          example: /user/avatar/28/The-Big-Lebowski-400-400.png
        custom_attributes:
          type: array
          items:
            $ref: '#/components/schemas/APIEntitiesCustomAttribute'
        web_url:
          type: string
          example: https://gitlab.example.com/root
    APIEntitiesGroup:
      type: object
      properties:
        id:
          type: integer
          format: int64
        web_url:
          type: string
          example: http://gitlab.example.com/groups/diaspora
        name:
          type: string
          example: Diaspora
        path:
          type: string
        description:
          type: string
        visibility:
          type: string
        share_with_group_lock:
          type: boolean
        require_two_factor_authentication:
          type: boolean
        two_factor_grace_period:
          type: integer
        project_creation_level:
          type: string
        auto_devops_enabled:
          type: string
        subgroup_creation_level:
          type: string
        emails_disabled:
          type: boolean
        emails_enabled:
          type: boolean
        show_diff_preview_in_email:
          type: boolean
        mentions_disabled:
          type: string
        lfs_enabled:
          type: boolean
        archived:
          type: boolean
        math_rendering_limits_enabled:
          type: boolean
        lock_math_rendering_limits_enabled:
          type: boolean
        crm_enabled:
          type: boolean
        resource_access_token_notify_inherited:
          type: boolean
        lock_resource_access_token_notify_inherited:
          type: boolean
        default_branch:
          type: string
        default_branch_protection:
          type: integer
        default_branch_protection_defaults:
          type: string
        avatar_url:
          type: string
        request_access_enabled:
          type: boolean
        full_name:
          type: string
        full_path:
          type: string
        created_at:
          type: string
        parent_id:
          type: string
        organization_id:
          type: integer
          format: int64
        shared_runners_setting:
          type: string
        max_artifacts_size:
          type: integer
        custom_attributes:
          $ref: '#/components/schemas/APIEntitiesCustomAttribute'
        statistics:
          type: object
          properties:
            storage_size:
              type: string
            repository_size:
              type: string
            wiki_size:
              type: string
            lfs_objects_size:
              type: string
            job_artifacts_size:
              type: string
            pipeline_artifacts_size:
              type: string
            packages_size:
              type: string
            snippets_size:
              type: string
            uploads_size:
              type: string
        marked_for_deletion_on:
          type: string
        root_storage_statistics:
          $ref: '#/components/schemas/APIEntitiesNamespaceRootStorageStatistics'
        ldap_cn:
          type: string
        ldap_access:
          type: string
        ldap_group_links:
          $ref: '#/components/schemas/APIEntitiesLdapGroupLink'
        saml_group_links:
          $ref: '#/components/schemas/APIEntitiesSamlGroupLink'
        file_template_project_id:
          type: string
        wiki_access_level:
          type: string
        repository_storage:
          type: string
        duo_core_features_enabled:
          type: boolean
          description: '[Experimental] Indicates whether GitLab Duo Core features are enabled for the group'
        duo_features_enabled:
          type: string
        lock_duo_features_enabled:
          type: string
        auto_duo_code_review_enabled:
          type: string
        duo_code_review_decisions_enabled:
          type: string
        web_based_commit_signing_enabled:
          type: string
        allow_personal_snippets:
          type: string
        duo_namespace_access_rules:
          type: string
        built_in_project_templates_enabled:
          type: boolean
        lock_built_in_project_templates_enabled:
          type: boolean
  securitySchemes:
    http:
      type: http
      scheme: bearer
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://gitlab.com/oauth/authorize
          tokenUrl: https://gitlab.com/oauth/token
          refreshUrl: https://gitlab.com/oauth/token
          scopes:
            api: Grants complete read/write access to the API, including all groups and projects, the container registry, the dependency proxy, and the package registry.
            read_api: Grants read access to the API, including all groups and projects, the container registry, and the package registry.
            read_user: Grants read-only access to your profile through the /user API endpoint, which includes username, public email, and full name. Also grants access to read-only API endpoints under /users.
            create_runner: Grants create access to the runners.
            manage_runner: Grants access to manage the runners.
            k8s_proxy: Grants permission to perform Kubernetes API calls using the agent for Kubernetes.
            self_rotate: Grants permission for token to rotate itself.
            mcp: Grants read-write access to remote Model Context Protocol (MCP) server for tools execution.
            mcp_orbit: Grants access to the Orbit Knowledge Graph MCP server for graph queries and schema retrieval.
    apiKey:
      type: apiKey
      name: PRIVATE-TOKEN
      in: header