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 method and path.

PropertyDescription
MethodHTTP method to match (GET, POST, PUT, PATCH, DELETE)
PathURL path to match (supports dynamic segments like :id)
Status CodeDefault HTTP status code to return
Response BodyDefault response content
Content-TypeMIME type of the response

Endpoints can have mock rules that override the default response based on request properties. See Mock Rules for details.

When a request arrives, mockd matches it against endpoints in order:

  1. Method must match exactly
  2. Path is matched segment-by-segment, with :param segments matching any value

If multiple endpoints could match, the most specific path wins (static segments take priority over dynamic ones).