Skip to content

What is MockHub

MockHub gives your client an API to call when the real one is unfinished, unreliable or somebody else’s. You describe the requests to expect and the responses to send, and MockHub answers them at an address of its own, for as long as you need it: while you build a screen, in a test run, or in a pipeline.

A request to MockHub looks like a request to any other API:

Terminal window
curl https://orders-api.mockhub.dev/v1/orders/8821
{ "id": "8821", "status": "awaiting_payment", "total": 4299, "currency": "EUR" }

Four words explain where that answer came from.

A workspace is what you share with other people and what carries the bill. It holds the members and their roles, the tokens, the custom domains, the plan and its limits, and the projects. Every account starts with a personal workspace of its own; a team creates another workspace and invites people to it.

See Workspaces, projects and mocks.

A project is what answers requests. It has one hostname, its mocks, its request logs, and settings that decide how it answers and what it records. A project usually stands for one API you depend on, such as an orders service or a payment provider.

A mock is one rule in a project: a request pattern, such as GET /v1/orders/8821, and the response to send when a request matches it. The response can be fixed, filled with values from the request or with fake data, delayed, or one of a sequence. See Request matching.

Every project answers at its own hostname, such as orders-api.mockhub.dev: a subdomain you choose on a domain MockHub shares with everyone, or on a domain your workspace owns. The domain decides whether the hostname answers over HTTPS, HTTP or both, so use the addresses the project’s page shows rather than assuming https://. See Hostnames, domains and protocols.

Put together: the hostname in the request above picks the project, the project’s mocks are compared with the request, and the one that matches sends its response. How MockHub handles a request walks through every step in order.

You want to… MockHub gives you
Build a client before the API exists, or while it is down A stable address that answers like the API, so the base URL does not change when the real one lands
Test how your client copes when things go wrong Error responses, delays and broken connections on purpose, responses in sequence, and state that changes as a flow progresses
See what your client really sent Request logs with the request, the response and which mock answered, or that none did
Start from how a real API behaves Recording of a real API’s answers, which you turn into mocks
Share one set of mocks with a team Workspaces with roles, and each project’s configuration as one document you can keep with your code
Let an AI assistant do the typing Mocks generated from a description or an example, and an MCP server for assistants

Recording a real API is available on Pro and Team, and custom domains on Pro and Team. A workspace’s plan also sets how many members it can have; see the limits page.

  • Not a database. On Free, Pro and Team, a project’s data store keeps what a POST sent so that a later GET returns it, but only as test data: it has no transactions, and MockHub’s backups do not include it. Without it, scenarios model a fixed set of states instead.
  • Not a load-testing target. Every request counts against the workspace’s plan limits, which include requests per second and requests in flight at once. See Plans, quotas and limits.
  • Not a place for production traffic. A project is a stand-in for development and testing, its limits are sized for that, and its request logs keep what callers send.
  • Not a contract checker. Nothing compares your mocks with the real API over time. Comparing a recorded answer with the mock made from it is a manual check of the status, Content-Type and top-level JSON keys.
  • Not for streaming. MockHub answers each HTTP request with a whole response. A mock cannot stream, such as with server-sent events, or hold a WebSocket open.

Report a problem with this page