Product documentation
Updated March 19, 2026

Understanding Mocks

API mocks replace real backend calls during test runs or run as a standalone mock server—organized per project with static or dynamic responses.

Overview

API mocks let you create and manage mock responses for your API endpoints. In Shift Left Studio you can:

  • Use mocks during test execution so tests do not depend on live services.
  • Run mocks as a standalone server so clients, tools, or teams can call predictable responses outside a full test run.

Mocks are always scoped to a project: you choose a project first, then create and manage mocks for that project’s endpoints.

How to use API mocks (high-level flow)

  1. Select a project — Pick a project from the list on the API Mocks page to manage its mocks.
  2. Create mocks — Add static or dynamic mock responses for your endpoints.
  3. Test and use — Try responses with sample requests, then use mocks in test execution or via the standalone mock server.

For step-by-step UI actions, see Creating and configuring mocks.

Mock capabilities

CapabilityWhat it gives you
Static and dynamic responsesFixed JSON (or text) payloads, or dynamic templates with variables where supported.
Standalone serverRun mocks as a standalone mock server for external testing or integrations.
Test integrationMocks can be used automatically during test execution when configured for your runs.
Condition-based behaviorReturn different responses based on request parameters or rules (where the product supports it).
Endpoint linkingLink mocks to existing endpoints from your project or create standalone mock definitions.
Easy testingTest mock responses with sample requests before relying on them in suites.

When to use mocks

  • The real API is not available, unstable, or still in development.
  • You need deterministic negative or edge cases that are hard to reproduce on a live system.
  • You want faster CI or isolated workflows without environment flakiness.
  • Teams need a shared mock base URL (standalone server) while frontends or partners integrate.

Best practices

  • Keep mock bodies realistic and aligned with your OpenAPI or contract so tests stay meaningful.
  • Use clear mock names and descriptions so the list stays scannable as projects grow.
  • Deactivate or remove mocks when you intentionally want tests to hit the real API.
  • Prefer project-level discipline: one team owns mock hygiene per project.

Related articles

Next steps

Still stuck?

Tell us what you’re trying to accomplish and we’ll point you to the right setup—installation, auth, or CI/CD wiring.