Conditional responses
Different responses by parameter, header, or consumer. Mock the happy path, the empty list, the rate-limit, the 5xx — all from the same endpoint.
Developers · Mocks
Apinizer's Mock API serves conditional, dynamic responses on the same gateway as the real APIs. Frontends, partners, and contract tests unblock in minutes — and the mock graduates to production-flavored when the backend ships.
The problem
Frontend teams wait for services. Partners wait for endpoints. Test suites wait for fixtures. Each team improvises — postman mocks, local stubs, hand-typed JSON — and reality drifts from the contract. Apinizer's Mock API lives on the same gateway as production, follows the same OpenAPI, and graduates without a rewrite when the real service ships.
Capabilities
Different responses by parameter, header, or consumer. Mock the happy path, the empty list, the rate-limit, the 5xx — all from the same endpoint.
Templated bodies with random, sequential, or referenced data. Each call returns plausibly different content — the way a real service does.
Mocks declared against the same OpenAPI spec the real service will implement. Contract drift becomes impossible.
When the real backend lands, swap the mock binding for the live binding. Consumers don't notice the cutover.
Test suites hit the mock in CI; mock validates request shape; failed contracts caught in PR, not in staging.
Auth, rate limit, audit — applied to mocks the same way as production. Mocks aren't a backdoor; they're a managed endpoint.
Use cases
Mock endpoints cover the new payments flow. Mobile delivers screens; partner SDKs land; backend graduates the mock when it's ready.
Supplier integrations onboard on mocks. The real production service swaps in on cutover day; no SDK change.
Every PR runs against the OpenAPI-shaped mock. Contract regressions caught before review; fewer staging surprises.
Conditional logic returns different recommendations by consumer ID. Marketing tests campaigns; engineering ships the real service second.
Test suites exercise client behavior under rate-limit, partial failure, and timeout — driven by the gateway's mock conditions.
Partners hit mock endpoints months before launch. Real endpoints swap in on day-of; partner integration unchanged.
Clinical apps build against FHIR-shaped mocks. Real EHR integration lands later; the consumer code is already correct.
Hackathon teams build against mocks; winners get production access. The mock-to-production graduation is one binding swap.
Recommended products
Conditional, dynamic, OpenAPI-shaped mocks on the same governed runtime.
Open the Mock API pageMock API alongside DB-2-API and Script-2-API.
Open the Creator pageDesign OpenAPI first; generate the mock and the real proxy from the same spec.
Open the Designer pageList mocks in the portal so partners can self-onboard before the backend lands.
Open the Portal pageResources
Conditional responses, dynamic data, contract enforcement, graduation.
Drop-in mocks that live on the production gateway.
Mock API, DB-2-API, Script-2-API in one place.
Ship mock definitions as code; review in Git; apply idempotently.
See mock traffic alongside production traffic — same dashboards.
Where Mock API fits in the topology.
Unblock without faking
A 30-minute walkthrough — conditional logic, dynamic data, contract testing, graduation — on a Kubernetes of your choice.