Mock servers
A mock server answers HTTP calls with the example responses saved on a collection's requests. Point a frontend, a mobile app or a test at it while the real API is still being built, or when you don't want to hit it.
https://mock.requestarium.com/m_8f3k2x9q1z/users/421. Save example responses
Send a request, then click Save as example in the response header. Requestarium keeps the status code, the body and the headers worth replaying (not Set-Cookie, Content-Length, Date and other per-transfer headers). Save as many as you need, for example 200 OK and 404 Not found; a request holds up to 20 examples of up to 1 MB each.
Examples also arrive with imports: Postman response items and OpenAPI response examples become saved examples.
The saved examples of a request are listed under Docs ▸ Example responses. Expand one to see its headers and body, make it the default, or delete it.
2. Create a mock server
Open the collection, go to Mocks and click Create mock server. Copy the URL or a ready curl line.
3. Call it
The path after the mock's id is matched to a request of the collection by method and path:
| Request URL in the collection | Matches |
|---|---|
{{baseUrl}}/users/:id | GET /users/42, GET /users/abc |
{{baseUrl}}/users/{id}/orders | GET /users/42/orders |
{{baseUrl}}/users/me | GET /users/me (a fixed segment wins over a parameter) |
The host and the query string of the saved URL are ignored, and so are those of the call.
Which example answers:
- the one named in the
x-mock-response-nameheader, or with the status inx-mock-response-code; - otherwise the default example;
- otherwise the first 2xx example, then the first one.
curl https://mock.requestarium.com/m_8f3k2x9q1z/users/42
curl https://mock.requestarium.com/m_8f3k2x9q1z/users/42 -H "x-mock-response-code: 404"Mock servers answer browsers on any origin (CORS is open), so a web app on localhost can call them directly.
Private mock servers and delays
On Pro and Team a mock server can be private: calls must send its key in the x-api-key header. The key is shown once, when you create the mock server or make it private; New key replaces it. Paid plans can also add a delay of up to 10 seconds before every answer, to try loading states.
curl https://mock.requestarium.com/m_8f3k2x9q1z/users/42 -H "x-api-key: rqm_..."Limits
| Plan | Calls per month | Mock servers per collection | Calls per minute | Example body | Private, delay |
|---|---|---|---|---|---|
| Free | 10,000 | 1 | 60 | 256 KB | no |
| Pro | 500,000 | unlimited | 300 | 1 MB | yes |
| Team | 5,000,000 | unlimited | 1,000 | 1 MB | yes |
Calls are counted per organization per calendar month (UTC); the Mocks tab shows this month's count. Every call that reaches a mock server counts, including ones that match no request.
Errors are JSON, {"error": "...", "message": "..."}: 404 when nothing matches, 401 for a missing or wrong key, 429 when a limit is reached (with Retry-After), 403 for an example body over the plan's size.
Good to know
- Deleting a mock server, or the collection, stops its URL at once. Restoring the collection from the trash does not
bring the mock server back; create a new one.
- Responses carry
Content-Security-Policy: sandboxand never set cookies. - Self-hosted installations serve mock servers at
https://<your API host>/mock/<id>/..., or on their own host with
TAIRI_MOCK_HOST.