Product documentation
Updated March 17, 2026

Creating and configuring mocks

How to create mocks manually or with AI, configure responses, start the mock server, and manage mocks with search, grouping, filters, and action buttons.

Overview

This guide walks you through creating and managing API mocks in Shift-Left API: selecting a project, creating mocks manually or via AI, configuring responses, starting the mock server, and using the mocks list (search, grouping, column filters, and action buttons).

Selecting a project

  1. Open Mocks from the dashboard or sidebar.
  2. Use the project selector to choose the project whose endpoints you want to mock.
  3. The mocks list shows all mocks for the current project.

Creating mocks

Create a mock manually

  1. In the Mocks view for your project, click Create Mock (or Create mock manually).
  2. Associate the mock with an endpoint (or define the URL and method).
  3. Configure the response:
    • Static: fixed status code and body (e.g. JSON or text).
    • Dynamic: use templates, variables, or conditional logic if supported.
  4. Save the mock. It appears in the project’s mocks list.

Generate mocks through AI

  1. In the Mocks view, click Generate Mock (or Generate mocks through AI).
  2. Select the endpoint(s) or spec scope for which to generate mocks.
  3. Review and adjust the generated response(s) as needed.
  4. Save. Generated mocks appear in the list like manually created ones.

Configuring mock responses

  • Status code: Set the HTTP status (200, 201, 400, 404, etc.).
  • Headers: Add response headers (e.g. Content-Type).
  • Body: Enter a static payload or use a dynamic template.
  • Delay (if available): Simulate latency for testing timeouts or loading states.

Start mock server

  1. In the Mocks view for the current project, use Start Mock Server (or equivalent).
  2. Note the base URL and port shown for the mock server.
  3. Point your app or tests at this URL to hit mocks instead of the real API.
  4. Stop the server when finished to free the port.

Managing the mocks list

  • Search mocks: Use the search box to filter mocks by name, endpoint, or other visible fields.
  • Grouping: Use the grouping (or sort) option to organize the list (e.g. by feature or endpoint).
  • Filter by column: Use column show/hide or filter controls to narrow the list by column values.
  • Action buttons: For each mock, use the row actions to Edit, Delete, Duplicate, or Enable/Disable as available in the UI.

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.