Documentation
Documentation
Everything you need to go from sign-up to a working mock REST API.
Overview
MockHive gives you a hosted REST mock API. Create collections in the portal (wizard, AI schema builder, OpenAPI/Postman import, or GitOps sync), then call your routes with an API key. Data persists until you delete it — real CRUD, not read-only fixtures.
- Portal: sign up, manage collections, API keys, billing — JWT Bearer
- Mock API: GET/POST/PUT/PATCH/DELETE on your custom route paths — X-API-Key header
- English and Arabic prompts for AI schema generation
- Pro+: delay/error query params, chaos profiles (latency, failure %, simulated 429), GitOps sync from GitHub
Quick start
1. Create an account in the portal and copy your API key from API keys. 2. Create a mock API with the collection wizard (fields + optional custom route), import OpenAPI/Postman, or connect GitOps (Pro+). 3. Call your live endpoints.
- Free plan: 3 collections, 100 records per collection, 1,000 GET requests/month
- Starter: 10 collections, 20 AI generations/month — see Pricing for full limits
- Pro+: unlimited collections (plan caps), chaos simulation, snapshots, webhooks, GitOps
Authentication
All mock data requests require the X-API-Key header. Management APIs in the portal use Authorization: Bearer <accessToken> from sign-in.
curl -H "X-API-Key: mk_live_your_key" \
https://api.example.com/{tenantId}/v1/productsRegenerating a key in the portal invalidates the previous key immediately. Mock URLs include your tenant id (shown on each collection page).
Collections & routes
Each collection has an internal name and optional public route paths (e.g. v1/products). Clients call the route path, not necessarily the storage name.
Create collections via the portal wizard, AI schema builder (POST /ai/generate-schema with JWT), OpenAPI/Postman import, batch create after AI, or GitOps upsert from GitHub (Pro+).
- Per-method response templates (GET list, GET by id, POST, etc.)
- Response scenarios and custom error JSON templates
- Export OpenAPI or Postman; Open in Swagger (private) or share a public Swagger link
- Generate C#, TypeScript, Python, or PHP client models from collection records / fields (single download, or ZIP of all collections)
Swagger docs
From a collection’s Basics tab (or Collections for all APIs), use Open in Swagger for an interactive docs page inside the portal. Enable public link to get a shareable URL under /public/swagger/{token} — no login required. Callers use Authorize with X-API-Key to Execute live mock requests.
- Private: portal only (logged in)
- Public: owner toggle; view + Try it out; still needs X-API-Key for mock calls
- Disable public anytime — token URL stops working until re-enabled
CRUD on mock routes
Standard REST verbs on your configured route. List supports pagination, sort, filter, and search query parameters.
GET /{tenantId}/{routePath} # list (page, limit, sort, filter, search)
GET /{tenantId}/{routePath}/{id} # get one
POST /{tenantId}/{routePath} # create (counts toward daily insert limit)
PUT /{tenantId}/{routePath}/{id} # replace
PATCH /{tenantId}/{routePath}/{id} # partial update
DELETE /{tenantId}/{routePath}/{id} # delete
Pro+ on any verb above (mock API, X-API-Key):
?delay=500 — wait 500ms before responding
?error=503 — return that HTTP status (no data change)
?error=429 — simulated rate limit (includes Retry-After)Query parameters
- page, limit, sort, order, filter, search, searchFields — list endpoints
- cursor (Starter+) — opaque cursor from meta.nextCursor for stable large-list pagination
- populate=true (Starter+) — expand relation fields to nested objects
- lang=ar or Accept-Language — localized field values where supported
- format=xml or Accept: application/xml — XML responses
- delay=500 (Pro+) — wait N milliseconds before responding (one-off)
- error=503 (Pro+) — force that HTTP status; use any 4xx/5xx (e.g. error=422, error=429)
Reserved params (not treated as field filters): page, limit, sort, order, filter, search, searchFields, delay, error, populate, lang, format, cursor.
Error simulation & chaos (Pro+)
Two layers help you test client retries and loading states. One-off query params apply to a single request. A collection Chaos profile applies persistently until you turn it off.
- ?delay=500 — one-off latency (milliseconds)
- ?error=503 / ?error=422 / ?error=429 — one-off forced status; body uses the collection Error response template when configured
- ?error=429 — simulated rate limit response with Retry-After
- Chaos profile (collection Advanced) — random failure %, latency jitter (min/max ms), and simulated per-route 429 after N requests in a window
- Chaos 429 settings: “429 after requests”, window seconds, and Retry-After seconds (set requests to 0 to disable)
- Chaos runs before one-off ?error= when failure % is active — turn chaos off (or set Failure % to 0) to verify a specific ?error= status
# One-off 503
curl -H "X-API-Key: mk_live_your_key" \
"https://api.example.com/{tenantId}/v1/products?error=503"
# One-off delay
curl -H "X-API-Key: mk_live_your_key" \
"https://api.example.com/{tenantId}/v1/products?delay=500"
# One-off 429 (Retry-After present)
curl -H "X-API-Key: mk_live_your_key" \
"https://api.example.com/{tenantId}/v1/products?error=429"Configure Chaos and Error response templates on the collection page in the portal. POST Idempotency-Key (Pro+) is separate — use it for safe create retries, not for chaos.
GitOps sync (Pro+)
Keep mocks in sync with an OpenAPI or Postman JSON file in GitHub. Connect a repo with a fine-scoped PAT under Settings → Developer → GitOps. On push (webhook) or Sync now, MockHive upserts collections by public route: missing routes are created; existing routes update fields, templates, and scenarios. Routes absent from the file are not deleted.
- Provider: GitHub (PAT + webhook secret; GitHub App later)
- After connect: copy the webhook URL and one-time secret → GitHub → Settings → Webhooks → Push events, content type application/json
- Webhook ignores other branches and pushes that do not touch the configured spec path
- View recent sync logs (created / updated / failed) in the same Settings card
- Local API needs a public tunnel (e.g. ngrok) for GitHub to reach /gitops/github/webhook
AI schema generation
In the portal, describe your API in plain language. The service returns endpoint schemas you can review and create as collections. Monthly limits apply per plan (e.g. Free: 3/month, Starter: 20/month).
Management endpoint (JWT): POST /ai/generate-schema with prompt and language.
Plans & limits
Limits are enforced by the API: collections count, records per collection, monthly GET requests, daily POST inserts, and AI generations. View usage in the portal under Usage or GET /usage with JWT.
- Starter+: relationships (?populate=true), cursor pagination, production base URL display
- Pro+: delay/error params, chaos profiles, snapshots, webhook simulator, GitOps sync, team invites
- Team: agency workspaces (isolated client tenants under one subscription)
Platform admins can override per-plan caps in admin Settings without redeploying.
Portal features
- Live inspector — browse and edit records per collection
- Import OpenAPI / Postman; export OpenAPI or Postman; Open in Swagger (private + optional public link)
- Client model download (Free) — C#, TypeScript, Python, or PHP; one collection or ZIP of all
- Chaos profile & error templates (Pro) — latency, failure %, simulated 429
- GitOps sync (Pro) — GitHub PAT + webhook upserts mocks from a spec file
- Snapshots (Pro) — backup and restore all collection data
- Webhooks (Pro) — test outbound delivery
- Team invites (Pro+) — share one tenant with colleagues; members use the owner's plan
- Agency workspaces (Team) — create isolated client tenants under one subscription
- Billing — Stripe checkout and customer portal (owner-only for team members)
Team invites & agency workspaces
MockHive treats collaboration and multi-client management as separate features. Pick the one that matches how you work.
- Team invites (Pro+) — Invite colleagues to your tenant. Everyone shares collections and API keys. The owner manages Stripe billing; members cannot change plan or payment.
- Agency workspaces (Team) — Group client tenants under named workspaces. Your primary tenant holds the Stripe subscription; each client gets an isolated tenant with its own API key and collections.
- Switch active tenant in the portal sidebar to work in a client's environment without a separate login.
- Workspace management is owner-only. If you joined someone else's tenant as a member, you cannot create workspaces or client tenants.
Help & support
Use the dashboard Getting started checklist on first sign-in. Signed-in users also have an in-app Help / user manual. For integration questions, see the Blog or contact via the marketing site Hire Us form.
- Failed mock responses include requestId in JSON and X-MockPilot-Request-Id header — share with support
- Priority support on Pro and Team plans
- Mock data is for development and testing only — not production workloads
Try the live demo
Static sample response — your real API runs in the MockHive portal after sign-up.
GET /v1/products
Header: X-API-Key: mk_live_••••
Sign in · Mock Data product · Pricing · Blog