Configure status codes, response delays, custom headers, and advanced response behaviors
Response customization allows you to control exactly how your mock API responds to requests. This includes HTTP status codes, response delays, custom headers, and conditional responses based on request parameters.
Return any HTTP status code to simulate success, errors, or edge cases
Add artificial delays to test loading states and timeout handling
Set custom response headers for CORS, caching, and authentication
By default, Mock API Builder returns appropriate status codes for each operation (200 for GET, 201 for POST, etc.). You can override these to test error handling in your application.
OK - Success
Standard successful response
Created
Resource successfully created
No Content
Success with no response body (DELETE operations)
Bad Request
Invalid request data or parameters
Unauthorized
Authentication required or failed
Forbidden
Authenticated but not authorized
Not Found
Resource doesn't exist
Internal Server Error
Server-side error occurred
Response delays help you test how your application handles slow network conditions, loading states, and timeout scenarios.
Delay Range: 0ms to 10,000ms (10 seconds)
Recommended Values:
Add a 2-second delay to your user list endpoint to ensure your loading spinner displays:
Custom headers allow you to control caching, CORS policies, content types, and other HTTP behaviors.
Cache-Control
Control how responses are cached by browsers and CDNs
X-RateLimit-*
Simulate rate limiting headers
Content-Type
Specify response format (usually set automatically)
X-Custom-Header
Add any custom header for testing
Mock API Builder automatically handles CORS for local development, but you can customize these headers if needed:
Conditional responses allow your mock API to return different data or status codes based on request properties. This enables you to simulate complex logic without writing backend code.
Check for specific header values (e.g., Auth tokens, custom flags).
Authorization: Bearer...Respond differently to filter or search parameters.
?type=admin&sort=descInspect JSON body fields for specific values.
{ "role": "admin" }Here's how to configure an endpoint to return a 401 error if the Authorization header is missing, or specific data based on a query parameter:
• Use realistic delay times (100-3000ms) instead of extreme values
• Test both success and error status codes
• Verify your app handles all HTTP status codes gracefully
• Add comments in your endpoint descriptions explaining custom settings
• Document which endpoints have delays or custom status codes
• Share this information with your team
• Response customization is for testing and development
• Remove artificial delays before moving to production APIs
• Use real production status codes in your final implementation