API template library

GitLab REST API mock and live sandbox

A WireMock simulation of GitLab's REST API — covering projects, merge requests, pipelines, and the broader v4 surface, including instance administration.

Vendor
GitLab
Functionality
Projects, merge requests, pipelines
Spec version
v4
Endpoints
1823
Stubs
1900
Protocol
REST
Validation
AI-validated Before publication, an AI agent exercised these endpoints against the real GitLab API through WireMock's recording proxy, and the recorded traffic was used to verify each stub's request and response shapes.

Live sandbox · no signup, no API key

GitLab Projects API

A running WireMock Cloud instance of this template, callable right now from a terminal, a script, or an AI agent.

Base URL
https://q4w4e.wiremockapi.cloud

PUT Promote label to group label

curl -s -X PUT 'https://q4w4e.wiremockapi.cloud/api/v4/projects/your-id/labels/promote' \
  -H 'Content-Type: application/json' \
  -d '{}'

GET List all project members including inherited

curl -s -X GET 'https://q4w4e.wiremockapi.cloud/api/v4/projects/your-id/members/all'

PATCH Update protected branch

curl -s -X PATCH 'https://q4w4e.wiremockapi.cloud/api/v4/projects/your-id/protected_branches/your-name' \
  -H 'Content-Type: application/json' \
  -d '{}'
Method Path Summary
GET /api/v4/admin_member_roles Get Admin Roles for this GitLab instance
POST /api/v4/admin_member_roles Create Admin Role on the GitLab instance
DELETE /api/v4/admin_member_roles/{member_role_id} Delete Admin Role
PUT /api/v4/admin/active_context/code/enabled_namespaces Update enabled namespace state
PUT /api/v4/admin/active_context/collections/{id} Update collection options
GET /api/v4/admin/active_context/connections Get all ActiveContext connections
PUT /api/v4/admin/active_context/connections/activate Activate an ActiveContext connection
PUT /api/v4/admin/active_context/connections/deactivate Deactivate an ActiveContext connection
GET /api/v4/admin/batched_background_migrations Get the list of batched background migrations
GET /api/v4/admin/batched_background_migrations/{id} Retrieve a batched background migration
PUT /api/v4/admin/batched_background_migrations/{id}/pause Pause a batched background migration
PUT /api/v4/admin/batched_background_migrations/{id}/resume Resume a batched background migration
GET /api/v4/admin/ci/variables List all instance-level variables
POST /api/v4/admin/ci/variables Create a new instance-level variable
DELETE /api/v4/admin/ci/variables/{key} Delete an existing instance-level variable
GET /api/v4/admin/ci/variables/{key} Get the details of a specific instance-level variable
PUT /api/v4/admin/ci/variables/{key} Update an instance-level variable
GET /api/v4/admin/clusters List instance clusters
DELETE /api/v4/admin/clusters/{cluster_id} Delete instance cluster
GET /api/v4/admin/clusters/{cluster_id} Get a single instance cluster
PUT /api/v4/admin/clusters/{cluster_id} Edit instance cluster
POST /api/v4/admin/clusters/add Add existing instance cluster
GET /api/v4/admin/data_management/{model_name} Get a list of model data
POST /api/v4/admin/data_management/{model_name} Post api v4 admin data_management by model_name.
GET /api/v4/admin/data_management/{model_name}/{record_identifier} Get data about a specific model
PUT /api/v4/admin/data_management/{model_name}/{record_identifier}/checksum Recalculate the checksum of a specific model
PUT /api/v4/admin/data_management/{model_name}/checksum Recalculate the checksum of a all records for a model
GET /api/v4/admin/databases/{database_name}/dictionary/tables/{table_name} Retrieve dictionary details
GET /api/v4/admin/knowledge_graph/namespaces Get all enabled namespaces for Knowledge Graph
POST /api/v4/admin/knowledge_graph/namespaces Post api v4 admin knowledge_graph namespaces.
DELETE /api/v4/admin/knowledge_graph/namespaces/{id} Disable a namespace for Knowledge Graph
PUT /api/v4/admin/knowledge_graph/namespaces/{id} Enable a namespace for Knowledge Graph
POST /api/v4/admin/migrations/{timestamp}/mark Mark the migration as successfully executed
GET /api/v4/admin/migrations/pending List pending database migrations
GET /api/v4/admin/search/migrations Lists all advanced search migrations
GET /api/v4/admin/search/migrations/{migration_id} Get a migration by version or name
GET /api/v4/admin/security/compliance_policy_settings Get security policy settings
PUT /api/v4/admin/security/compliance_policy_settings Update security policy settings
DELETE /api/v4/admin/sidekiq/queues/{queue_name} Drop jobs matching the given metadata from the Sidekiq queue
GET /api/v4/admin/token Get api v4 admin token.
PATCH /api/v4/admin/zoekt/namespaces/{id} Update the number of replicas override for an enabled namespace
PUT /api/v4/admin/zoekt/projects/{project_id}/index Triggers indexing for the specified project
GET /api/v4/admin/zoekt/shards Get all the Zoekt nodes
POST /api/v4/admin/zoekt/shards Post api v4 admin zoekt shards.
DELETE /api/v4/admin/zoekt/shards/{node_id} Delete api v4 admin zoekt shards by node_id.
GET /api/v4/admin/zoekt/shards/{node_id} Get api v4 admin zoekt shards by node_id.
GET /api/v4/admin/zoekt/shards/{node_id}/indexed_namespaces Get all the indexed namespaces for this node
POST /api/v4/admin/zoekt/shards/{node_id}/indexed_namespaces Post api v4 admin zoekt shards by node_id indexed_namespaces.
DELETE /api/v4/admin/zoekt/shards/{node_id}/indexed_namespaces/{namespace_id} Remove a namespace from a node for Zoekt indexing
PUT /api/v4/admin/zoekt/shards/{node_id}/indexed_namespaces/{namespace_id} Add a namespace to a node for Zoekt indexing
GET /api/v4/ai/agents Get api v4 ai agents.
POST /api/v4/ai/agents Post api v4 ai agents.
DELETE /api/v4/ai/agents/{id} Delete api v4 ai agents by id.
GET /api/v4/ai/agents/{id} Get api v4 ai agents by id.
PUT /api/v4/ai/agents/{id} Put api v4 ai agents by id.
POST /api/v4/ai/duo_workflows/code_review/add_comments Add code review comments to a merge request
POST /api/v4/ai/duo_workflows/direct_access Connection details for accessing Duo Agent Platform Service directly
GET /api/v4/ai/duo_workflows/list_tools List Duo Agent Platform tools
POST /api/v4/ai/duo_workflows/revoke_token Revoke ai_workflows token
GET /api/v4/ai/duo_workflows/workflows Get api v4 ai duo_workflows workflows.

+1763 more endpoints in the full spec.

Unauthenticated WireMock Cloud demo sandbox for GitLab — not an official GitLab sandbox, and it returns simulated example data only.

What's inside the GitLab template

The template captures GitLab's v4 REST API as its OpenAPI description defines it — nearly two thousand endpoints, /api/v4 prefix included, so paths line up with what clients built for real GitLab emit. Request a project's member list and the stub responds with member objects carrying id, username, display name, and the numeric access_level GitLab uses for permissions — the same fields your authorization logic reads in production.

  • Projects — the core project surface — members, labels, protected branches, settings
  • Merge requests & pipelines — review and CI flows as the v4 spec defines them
  • Instance administration — admin-only routes — instance CI variables, clusters, background migrations, Sidekiq queues
  • GitLab Duo & AI — duo_workflows endpoints and AI agent management from current specs
  • Member roles — instance-level custom role creation and management
  • Search infrastructure — advanced-search migrations and Zoekt indexing administration

Example implementation using python-gitlab

python-gitlab was built for pointing at arbitrary GitLab hosts — that's how self-managed installs work — so the sandbox slots in as just another instance URL:

Because the library appends /api/v4 itself, the base URL is the only thing that changes between the mock and a production instance — the same trait that makes the redirect work for CLI tools and CI jobs that take a GitLab URL from configuration.

A deterministic GitLab is particularly useful for platform-engineering code: provisioning scripts, compliance auditors, and merge-request bots can run their full logic in CI against stable responses, with no throwaway GitLab instance to maintain.

import gitlab

# token is mandatory for the client,
# meaningless to the mock
gl = gitlab.Gitlab(
    url="https://q4w4e.wiremockapi.cloud",
    private_token="any-value",
)

project = gl.projects.get(1, lazy=True)
for member in project.members_all.list():
    print(member.username, member.access_level)

Frequently asked questions

Authentication headers are ignored wholesale — PRIVATE-TOKEN, an OAuth bearer, or nothing at all produce the same match. Keep genuine GitLab tokens away from the shared endpoint regardless; it's public and unauthenticated by design.

No — stub paths carry the /api/v4 prefix already, mirroring a real installation's layout. Configure clients with the bare sandbox origin exactly as you'd configure them with https://gitlab.example.com, and their generated paths will match.

Yes, and that's one of the most useful properties of the mock: routes that demand an administrator token on a live instance — instance variables, cluster management, background migrations — answer here without any privilege setup, so tooling against them can be tested safely.

Shared-sandbox responses are fixed success cases. For failure states, take a private copy in WireMock Cloud and edit the relevant stubs — a pipeline object whose status reads failed, or a merge endpoint answering 406 because the branch cannot be merged — then run your handling code against those exact conditions.

Vendor names identify APIs represented by WireMock template sources. This page does not imply vendor endorsement, certification, partnership, or official integration status.