Skip to content

Mock Endpoints

Mock endpoints return predefined responses when called. Use them to simulate APIs during development.

  1. Click New Endpoint and select Mock
  2. Configure the endpoint:
    • Name: A descriptive label (e.g., “Get User by ID”)
    • Path: The URL path (e.g., /api/users/{id})
    • Method: GET, POST, PUT, DELETE, etc.

Use curly braces for dynamic path segments:

  • /api/users/{id} - matches /api/users/123
  • /api/projects/{projectId}/tasks/{taskId} - multiple parameters

Access path parameters in your response with {{params.id}}.

Set any HTTP status code (200, 201, 404, 500, etc.).

Add custom response headers:

Content-Type: application/json
X-Custom-Header: value

Enter your response body. For JSON responses, you can use template variables for dynamic data:

{
"id": "{{params.id}}",
"name": "{{name}}",
"email": "{{email}}",
"createdAt": "{{timestamp}}"
}

Create multiple response variations for the same endpoint:

  • Static: Always returns the same response (default)
  • Sequential: Cycles through variations in order
  • Random: Randomly selects a variation
  • Conditional: Returns different responses based on request data

Match requests based on query parameters, headers, or body:

Condition: query.status equals "active"
Response: { "users": [...active users...] }
Condition: query.status equals "inactive"
Response: { "users": [...inactive users...] }

Add artificial latency to simulate real network conditions. Set delay in milliseconds (e.g., 500ms).

Toggle endpoints on/off without deleting them. Disabled endpoints return 404.