Create API Mocks in Seconds
API Fast Mock is a revolutionary tool to create fully stateless API mocks using compact tokens only. No database, no complex setup - just define your response and generate a unique token containing the entire specification of your mock. Share the link and done! Perfect for testing, prototyping and agile development.
HTTP Method
Choose the HTTP method your mock API will respond to. Each method has a specific purpose in RESTful APIs.
Select the HTTP method your mock will respond to. Common methods:
- GET: Retrieve data (e.g., get user info)
- POST: Create new resources (e.g., create user)
- PUT: Replace entire resource (e.g., update all user data)
- PATCH: Partial update (e.g., update email only)
- DELETE: Remove resource (e.g., delete user)
HTTP Status Code
HTTP status codes indicate whether a request has been successfully completed. They are grouped into categories.
Define what status code your mock will return:
- 2xx Success: 200 OK, 201 Created, 204 No Content
- 3xx Redirect: 301 Moved, 302 Found
- 4xx Client Error: 400 Bad Request, 401 Unauthorized, 404 Not Found
- 5xx Server Error: 500 Internal Error, 503 Service Unavailable
Response Body
The JSON data that will be returned by your mock API. This is what the client will receive.
Define the JSON response your mock will return. Leave empty to use the default example.
{ "id": 123, "name": "John Doe", "email": "john@example.com", "created_at": "2025-01-20" }
Custom Headers
HTTP headers let you pass additional information with responses. Common headers include Content-Type, Cache-Control, etc.
Add custom HTTP headers to your response:
Content-Type
: application/jsonCache-Control
: no-cacheX-Custom-Header
: Your custom value
API Authentication
Protect your mock with an API key. Requests will need to include the X-API-Key header with this value.
Require an API key to access your mock:
curl -H "X-API-Key: your-secret-key" https://api/mock/...
Response Timing
Simulate slow APIs by adding delays or timeouts. Useful for testing loading states and timeout handling.
Simulate network latency (0-30 seconds)
Returns 504 Gateway Timeout after specified time
Error Simulation
Simulate random failures to test error handling in your application.
Probability of returning 500 error (0 = never, 1 = always)
Dynamic Fields
Generate dynamic values on each request like timestamps, UUIDs, counters, or random values.
Add fields that change on every request:
UUID
: Unique identifierTimestamp
: Current date/timeCounter
: Incremental numberRandom Number
: Random integer in rangeRandom Choice
: Pick from list
Request Validation
Validate incoming requests. Returns 400 Bad Request if validation fails.
Conditional Responses
Return different responses based on request headers, query params, or body content.
Define conditions to return different responses:
Rate Limiting
Limit the number of requests allowed in a time window. Returns 429 Too Many Requests when exceeded.
Example: 10 requests per 60 seconds
Response Sequences
Return different responses in sequence. Useful for simulating pagination or state changes.
Return different responses on each call:
Each request cycles through the array
Webhook Callback
Trigger a POST request to another URL after responding. Useful for testing webhooks.
URL to POST to after responding (fire-and-forget)
CORS Settings
Enable Cross-Origin Resource Sharing to allow browser requests from different domains.
Allow requests from browsers