API template library

Simulate the GitLab REST API

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
19.6
Endpoints
1892
Stubs
1925
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://zmkw1w.wiremockapi.cloud

POST Create a project

curl -s -X POST 'https://zmkw1w.wiremockapi.cloud/api/v4/projects' \
  -H 'Content-Type: application/json' \
  -d '{"name":"payments-service","path":"payments-service","description":"Created from the WireMock sandbox"}'

GET List projects (includes the one you created)

curl -s -X GET 'https://zmkw1w.wiremockapi.cloud/api/v4/projects'

GET List all project members including inherited

curl -s -X GET 'https://zmkw1w.wiremockapi.cloud/api/v4/projects/your-id/members/all'
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
DELETE /api/v4/admin/active_context/dead_queue Clear the ActiveContext dead queue
POST /api/v4/admin/active_context/dead_queue/replay Replay items from the dead queue into another queue
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/batched_background_operations Get the list of batched background operations
GET /api/v4/admin/batched_background_operations/{id} Retrieve a batched background operation
PUT /api/v4/admin/batched_background_operations/{id}/restart Restart a batched background operation
PUT /api/v4/admin/batched_background_operations/{id}/stop Stop a batched background operation
GET /api/v4/admin/ci/variables List all instance variables
POST /api/v4/admin/ci/variables Create instance variable
DELETE /api/v4/admin/ci/variables/{key} Delete instance variable
GET /api/v4/admin/ci/variables/{key} Retrieve instance variable details
PUT /api/v4/admin/ci/variables/{key} Update an instance variable
GET /api/v4/admin/clusters List all instance clusters
DELETE /api/v4/admin/clusters/{cluster_id} Delete instance cluster
GET /api/v4/admin/clusters/{cluster_id} Retrieve a single instance cluster
PUT /api/v4/admin/clusters/{cluster_id} Update an instance cluster
POST /api/v4/admin/clusters/add Create an instance cluster
GET /api/v4/admin/data_management/{model_name} Retrieve model information
GET /api/v4/admin/data_management/{model_name}/{record_identifier} Retrieve information about a model record
PUT /api/v4/admin/data_management/{model_name}/{record_identifier}/checksum Recalculate the checksum of a model record
PUT /api/v4/admin/data_management/{model_name}/checksum Recalculate checksums for model records
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
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 Update status of a migration
GET /api/v4/admin/migrations/pending List all pending migrations
GET /api/v4/admin/search/migrations List all advanced search migrations
GET /api/v4/admin/search/migrations/{migration_id} Retrieve an advanced search migration
GET /api/v4/admin/security/compliance_policy_settings Retrieve security policy settings
PUT /api/v4/admin/security/compliance_policy_settings Update security policy settings
DELETE /api/v4/admin/sidekiq/concurrency_limits/{worker_class} Delete a Sidekiq worker concurrency limit override
GET /api/v4/admin/sidekiq/concurrency_limits/{worker_class} Get a Sidekiq worker concurrency limit
PUT /api/v4/admin/sidekiq/concurrency_limits/{worker_class} Update a Sidekiq worker concurrency limit override
DELETE /api/v4/admin/sidekiq/queues/{queue_name} Delete jobs from a Sidekiq queue
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
GET /api/v4/admin/zoekt/shards/{node_id}/indexed_namespaces Get all the indexed namespaces for this node
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
POST /api/v4/ai/duo_workflows/agent_workflows Create workflow persistence (agent-initiated, limited privileges)
POST /api/v4/ai/duo_workflows/code_review/add_comments Add code review comments to a merge request
GET /api/v4/ai/duo_workflows/code_review/custom_instructions Fetch the Duo Code Review custom instructions for 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
POST /api/v4/ai/duo_workflows/tools/risk_assessment/results Submit risk assessment results for a merge request
POST /api/v4/ai/duo_workflows/workflows Create a flow

+1832 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://zmkw1w.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)

GitLab REST mock API FAQ

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.