Skip to main content
API mocks let you define a fake HTTP endpoint — method, path, status code, response headers, and body — that Swisstools serves at a stable subdomain URL. You point your application or tests at that URL during development instead of a real upstream API. Each mock is served at:
For example, if your team’s referenceId is aB3cD4eF and your project slug is payments-api, a mock with endpoint /users is reachable at:
All management endpoints (list, create, update, delete) require session authentication. The mock invocation URL itself is public — no auth needed.

List Mocks

GET /api/projects/:projectId/mocks Returns all mock endpoints defined for the specified project. Path Parameters
string
required
The UUID of the project.
Request
Response

Create Mock

POST /api/projects/:projectId/mocks Creates a new mock endpoint for the project. Path Parameters
string
required
The UUID of the project.
Request Body
string
required
A human-readable name for the mock, used in the dashboard.
string
required
The HTTP method this mock responds to. Accepted values: GET, POST, PUT, PATCH, DELETE. Defaults to GET.
string
required
The path this mock handles, relative to /api/mock/. For example, /users or /orders/123.
string
required
The raw response body to return. JSON must be provided as a string. Defaults to {}.
object
Key-value pairs of HTTP response headers. Defaults to an empty object.
integer
The HTTP status code the mock returns. Defaults to 200.
string
An optional description of what this mock simulates.
Request
Response201 Created

Get Mock

GET /api/projects/:projectId/mocks/:mockId Returns a single mock endpoint by its ID. Path Parameters
string
required
The UUID of the project.
string
required
The UUID of the mock.
Request
Response

Update Mock

PUT /api/projects/:projectId/mocks/:mockId Updates one or more fields of an existing mock endpoint. Path Parameters
string
required
The UUID of the project.
string
required
The UUID of the mock to update.
Request Body
string
Updated display name.
string
Updated HTTP method.
string
Updated endpoint path.
string
Updated response body string.
object
Updated response headers.
integer
Updated HTTP status code.
string
Updated description.
Request
Response

Delete Mock

DELETE /api/projects/:projectId/mocks/:mockId Permanently removes a mock endpoint. Path Parameters
string
required
The UUID of the project.
string
required
The UUID of the mock to delete.
Request
Response

Mock Object

string
UUID that uniquely identifies the mock.
string
UUID of the project that owns this mock.
string
Display name shown in the dashboard.
string
Optional description of what this mock simulates.
string
HTTP method this mock responds to (GET, POST, PUT, PATCH, DELETE).
string
The path relative to /api/mock/ at which this mock is served on the subdomain.
string
The raw string returned as the response body when the mock is invoked.
object
Key-value HTTP response headers returned when the mock is invoked.
integer
HTTP status code returned when the mock is invoked.
string
ISO 8601 timestamp of creation.
string
ISO 8601 timestamp of the last update.