Skip to content

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.

  1. Open your project from the dashboard
  2. Click New Endpoint
  3. Fill in the configuration:
FieldDescription
MethodHTTP method (GET, POST, PUT, PATCH, DELETE)
PathURL path (e.g. /api/users)
Status CodeHTTP status code to return (e.g. 200, 404)
Response BodyThe content returned to the caller
Content-TypeResponse 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 LimitMaximum requests per minute for this endpoint

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.

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.

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.

Once created, your endpoint is available at:

https://<project-slug>.mockd.sh/<path>

When a request arrives at your endpoint:

  1. Rate limit is checked (per-minute window)
  2. Daily request limit is checked (per-project quota)
  3. 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
  4. Template variables are resolved in the response body
  5. Delay is applied
  6. Response is returned and the request is logged