Ready-to-use mock API templates for REST and SOAP testing — no code required. Copy, paste, and get a live mock endpoint in seconds with MockHub — the free online mock API generator.
When you're building a frontend app, writing integration tests, or demoing a product — waiting for a real backend wastes time. A mock REST API returns pre-defined responses instantly, so you can:
- 🚀 Develop frontend features before the backend is ready
- 🧪 Test error handling (401, 404, 429, 500) reliably
- 🔁 Run CI/CD pipelines without depending on external services
- 🎨 Demo a product to clients without live infrastructure
- 📐 Prototype API contracts before writing real code
This repository contains JSON templates for the most common API patterns, ready to import into MockHub or any other mock server.
- Open mockhub.ovh — free, no credit card
- Click New API
- Pick a template from this repo, copy the response body
- Set method, path, status code → Save
- Done — your endpoint is live at
https://mockhub.ovh/mock/{your_id}/{path}
# Test immediately with curl
curl https://mockhub.ovh/mock/your_id/products💡 MockHub also supports OpenAPI / Swagger import — paste your spec and all endpoints are created automatically. 👉 mockhub.ovh/api-generator/openapi_to_mock.html
| Template | Endpoints | Description |
|---|---|---|
| ecommerce/products-api.json | 6 | Product catalog: list, get, create, update, delete + 404 |
| ecommerce/cart-api.json | 5 | Cart: view, add/remove items, apply coupon + error |
| ecommerce/orders-api.json | 4 | Orders: place, track, list, refund |
| Template | Endpoints | Description |
|---|---|---|
| auth/jwt-auth.json | 8 | JWT: register, login, refresh, me + 401/409 |
| auth/oauth2-mock.json | 5 | OAuth2: token, introspection, userinfo |
| Template | Endpoints | Description |
|---|---|---|
| payments/stripe-like.json | 6 | Stripe-inspired: payment intent, confirm, refund |
| payments/paypal-like.json | 4 | PayPal-inspired: create order, capture, refund |
| Template | Endpoints | Description |
|---|---|---|
| social/users-feed.json | 6 | Profiles, feed, posts, likes, follow |
| social/notifications.json | 4 | List, mark read, push token |
| Template | Operations | Description |
|---|---|---|
| soap/hello-service.json | 2 | Hello service + fault scenario |
| soap/payment-service.json | 4 | ProcessPayment, GetStatus, Cancel |
SOAP mocks: upload your WSDL at mockhub.ovh/api-generator/generate_soap.html
| Template | Endpoints | Description |
|---|---|---|
| healthcare/patient-records.json | 5 | FHIR-inspired: patients, observations, appointments |
Every template uses MockHub dynamic variables — placeholders replaced with random realistic data on each request. No more hardcoded "id": 1 in your mocks.
{
"id": "{{uuid}}",
"user": {
"name": "{{name}}",
"email": "{{email}}",
"joined": "{{isodate}}"
},
"score": "{{float}}",
"active": "{{boolean}}"
}| Variable | Example |
|---|---|
{{uuid}} |
550e8400-e29b-41d4-a716-446655440000 |
{{name}} |
John Smith |
{{firstname}} / {{lastname}} |
John / Smith |
{{email}} |
user4872@example.com |
{{phone}} |
+1-555-0192 |
{{isodate}} |
2025-01-15T10:30:00Z |
{{timestamp}} |
1736934600000 |
{{integer}} |
4821 |
{{float}} |
49.99 |
{{boolean}} |
true |
{{word}} |
falcon |
{{sentence}} |
The quick brown fox jumps over the lazy dog. |
{{city}} / {{country}} |
Berlin / Germany |
{{zipcode}} |
10115 |
{{company}} |
Acme Corp |
{{jobtitle}} |
Senior Engineer |
{{url}} |
https://example.com/path |
{{ipv4}} |
192.168.1.42 |
{{color}} |
#a3f2c1 |
{{creditcard}} |
4111111111111111 |
{{iban}} |
DE89370400440532013000 |
📖 Full docs: mockhub.ovh/api-generator/docs.html
{
"name": "API name",
"description": "What this API mocks",
"import_to_mockhub": "https://mockhub.ovh/api-generator/generate_api.html",
"endpoints": [
{
"name": "Endpoint description",
"method": "GET",
"path": "/resource/:id",
"status_code": 200,
"headers": { "Content-Type": "application/json" },
"delay_ms": 0,
"response": {}
}
]
}Each endpoint can have multiple scenarios (different status codes / responses) — use MockHub's Scenarios feature to switch between them in tests.
| Feature | MockHub | Postman Mock | Mockoon | WireMock |
|---|---|---|---|---|
| No install required | ✅ Online | ✅ Online | ❌ Desktop | ❌ JAR/Docker |
| Free tier | ✅ 5 APIs | ✅ Open source | ✅ Open source | |
| Dynamic variables | ✅ 20+ | ❌ | ✅ | |
| SOAP mock support | ✅ | ❌ | ❌ | ✅ |
| AI-generated responses | ✅ | ❌ | ❌ | ❌ |
| OpenAPI import | ✅ | ✅ | ✅ | ✅ |
| Error scenario switching | ✅ | ✅ | ✅ | |
| Shareable public URL | ✅ | ✅ | ❌ | ❌ |
| messaging/email-api.json | 3 | Send email, templates, delivery status, bounces, unsubscribes, webhooks | | productivity/task-management-api.json | 10 | Projects, tasks, subtasks, assignees, due dates, labels, Kanban status. Full CRU | | storage/file-upload-api.json | 12 | Upload files, get presigned URLs, list files, delete, generate thumbnails. A com | | location/geolocation-api.json | 1 | Full-featured geolocation API supporting geocoding, reverse geocoding, distance | | analytics/analytics-api.json | 9 | Complete analytics platform API covering page views, events, sessions, funnels, | | ecommerce/inventory-api.json | 9 | Warehouses, stock levels, SKUs, suppliers, purchase orders, low-stock alerts | | cms/blog-cms-api.json | 12 | Complete blog and content management system API with posts, categories, tags, au |
| Template | Endpoints | Description |
|---|---|---|
| messaging/messaging-api.json | 12 | Full-featured messaging API supporting chat messages, conversations, channels, d |
New template ideas are welcome!
- Fork the repo
- Add your JSON file in the right category folder
- Follow the template format above
- Include at least one error scenario (4xx or 5xx)
- Open a pull request — we'll review and merge it
MIT — use freely in any project, commercial or personal.
Built for developers who don't want to wait for a backend.
Create your free mock API on MockHub →