> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swisstools.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Mock API Endpoints Without Running a Server

> Create fake HTTP endpoints that return configurable responses — no backend required. Build and test integrations against stable, instant mock URLs.

API mocking lets you define HTTP endpoints that return whatever response you configure — a specific status code, custom headers, and a body you control. Instead of waiting for a backend to be ready or spinning up a local server, you point your frontend or integration code at a Swisstools mock URL and get consistent, predictable responses immediately.

## What you can configure

Each mock endpoint is defined by five properties:

| Property             | Description                                                                     |
| -------------------- | ------------------------------------------------------------------------------- |
| **Method**           | HTTP method: `GET`, `POST`, `PUT`, `PATCH`, or `DELETE`                         |
| **Path**             | The endpoint path, e.g. `/users` or `/orders/123`                               |
| **Status code**      | The HTTP status code to return, e.g. `200`, `201`, `404`                        |
| **Response body**    | Any text or JSON body to include in the response                                |
| **Response headers** | Key-value pairs sent with every response, e.g. `Content-Type: application/json` |

## How mock URLs work

Every project gets a unique base URL derived from your team and project identifiers:

```
https://<team_ref>-<project_slug>.swisstools.dev/api/mock/<path>
```

Where `<team_ref>` is your team's 8-character reference ID and `<project_slug>` is your project's slug. You can find the full base URL on your project page.

For example, a mock configured with path `/users` on the project `my-api` belonging to team `abc12345` is reachable at:

```
https://abc12345-my-api.swisstools.dev/api/mock/users
```

## Instant updates

Changes to a mock take effect immediately. Update the status code, swap the response body, or add a header — the very next request to that URL sees the new response. There is no cache to clear and no server to restart.

<CardGroup cols={2}>
  <Card title="Create a mock endpoint" icon="plus" href="/api-mocking/create-mock">
    Step-by-step guide to creating and configuring your first mock.
  </Card>

  <Card title="Using your mock URL" icon="link" href="/api-mocking/request-url">
    How to construct and call your mock endpoint URL.
  </Card>
</CardGroup>
