Skip to main content

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.

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:
PropertyDescription
MethodHTTP method: GET, POST, PUT, PATCH, or DELETE
PathThe endpoint path, e.g. /users or /orders/123
Status codeThe HTTP status code to return, e.g. 200, 201, 404
Response bodyAny text or JSON body to include in the response
Response headersKey-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.

Create a mock endpoint

Step-by-step guide to creating and configuring your first mock.

Using your mock URL

How to construct and call your mock endpoint URL.