Product documentationUpdated 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)
- Select a project — Pick a project from the list on the API Mocks page to manage its mocks.
- Create mocks — Add static or dynamic mock responses for your endpoints.
- 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
| Capability | What it gives you |
|---|---|
| Static and dynamic responses | Fixed JSON (or text) payloads, or dynamic templates with variables where supported. |
| Standalone server | Run mocks as a standalone mock server for external testing or integrations. |
| Test integration | Mocks can be used automatically during test execution when configured for your runs. |
| Condition-based behavior | Return different responses based on request parameters or rules (where the product supports it). |
| Endpoint linking | Link mocks to existing endpoints from your project or create standalone mock definitions. |
| Easy testing | Test 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
Related articles
- Creating and Configuring Mocks · Product documentation
Next steps
- Getting started · Install + connect your spec
- Configuration fundamentals · Stabilize runs
- Initial configuration · Users, licensing, projects
- Release notes · Updates and fixes
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.