Documentation menu

Testing guide

Exercise more than the happy path.

Create temporary records, update state, delete data, slow responses, and trigger known failures without setting up a backend.

Mutations

Test create, update, and delete flows

Send JSON to POST, PUT, and PATCH endpoints. A successful create returns 201, updates return 200, and a successful delete returns 204 with no response body.

Create a todo
curl -X POST 'https://api.apimocker.com/todos' \
  -H 'Content-Type: application/json' \
  -d '{"title":"Test the success state","completed":false,"userId":1}'

POST

Create

Add a temporary record. Server-generated IDs and timestamps are returned.

PUT

Replace

Send every required field for the resource.

PATCH

Update

Send only the fields that should change.

DELETE

Remove

Delete a record until the next daily reset.

Validation

Handle invalid input

Missing fields, invalid emails, out-of-range strings, and invalid IDs return a 400 response. Validation responses include field-level details when available.

400 response
{
  "error": "Validation Error",
  "message": "Invalid input data",
  "details": [
    {
      "type": "field",
      "value": "",
      "msg": "Title is required and must be between 1 and 200 characters",
      "path": "title",
      "location": "body"
    }
  ]
}

Error simulation

Trigger predictable failures

Limits and reset

Design around the shared service

1,000 requests

Maximum requests per IP address in a rolling 15-minute window. The next response is 429.

100 writes

Maximum POST, PUT, PATCH, and DELETE requests per IP address each day. The next response is 429.

Midnight UTC

The shared database returns to its original users, posts, todos, and comments.

Open CORS

Browser requests are accepted from any origin, and total-count headers are exposed.

10 MB JSON

JSON request bodies larger than 10 MB are rejected.