Endpoints
An endpoint is a single mock API route within a project. It defines what happens when a request matches a specific HTTP method and path.
Creating an Endpoint
Section titled “Creating an Endpoint”- Open your project from the dashboard
- Click New Endpoint
- Fill in the configuration:
| Field | Description |
|---|---|
| Method | HTTP method (GET, POST, PUT, PATCH, DELETE) |
| Path | URL path (e.g. /api/users) |
| Status Code | HTTP status code to return (e.g. 200, 404) |
| Response Body | The content returned to the caller |
| Content-Type | Response content type (defaults to application/json) |
| Delay (ms) | Fixed response delay in milliseconds (default: 0) |
| Delay Max (ms) | Upper bound for random delay — when set, actual delay is randomized between Delay and Delay Max |
| Rate Limit | Maximum requests per minute for this endpoint |
Path Parameters
Section titled “Path Parameters”Paths support dynamic segments. For example, /api/users/:id matches any request to /api/users/123, /api/users/abc, etc.
If multiple endpoints could match a path, the most specific path wins — static segments take priority over dynamic ones.
Response Body
Section titled “Response Body”The response body can be any valid text. For JSON responses, enter valid JSON:
{ "users": [ { "id": 1, "name": "Alice" }, { "id": 2, "name": "Bob" } ]}Use template variables like {{$uuid}}, {{$randomName}}, or {{request.body.field}} to generate dynamic responses.
Delay and Jitter
Section titled “Delay and Jitter”To simulate realistic API latency, configure a delay range:
- Delay only — fixed delay at that exact value
- Delay + Delay Max — random delay between the two values (uniform distribution)
For example, Delay = 100ms and Delay Max = 500ms means each response is delayed by a random amount between 100–500ms.
Endpoint URL
Section titled “Endpoint URL”Once created, your endpoint is available at:
https://<project-slug>.mockd.sh/<path>What Happens on a Request
Section titled “What Happens on a Request”When a request arrives at your endpoint:
- Rate limit is checked (per-minute window)
- Daily request limit is checked (per-project quota)
- Rules are evaluated top-to-bottom — see Rules
- For each matching rule, actions execute and the first rule with a response definition wins
- Response sequences advance if the matched rule has multiple steps
- Template variables are resolved in the response body
- Delay is applied
- Response is returned and the request is logged