Skip to content
Mock APIs

Resources

Todos

Simple to-do items that belong to users. Ideal for practicing list rendering and toggling state. The dataset contains 200 todos.

Writes are simulated

POST, PUT, PATCH, and DELETE validate your input and return realistic responses, but the shared dataset is never modified.

Endpoints

The todo object

Use select to return a subset of these fields. Sort with sortBy on id, todo, userId; search matches . See query parameters.

todo fields
FieldTypeNotes
idintegermin -9007199254740991, max 9007199254740991
todostring
completedboolean
userIdintegermin -9007199254740991, max 9007199254740991

List todos

GET/api/v1/todos

Returns a paginated list of todos. Supports pagination, field selection, sorting, and filtering.

Parameters

Parameters for List todos
NameInTypeDescription
limitqueryintegerNumber of records to return (1-100).Default: 30Range: 1-100
skipqueryintegerNumber of records to skip before returning results.Default: 0Range: 0-1000000
selectquerystringComma-separated list of fields to return. id is always included. Allowed: id, todo, completed, userId.
sortByquerystringField to sort by.One of: id, todo, userIdDefault: id
orderquerystringSort direction.One of: asc, descDefault: asc
completedquerybooleanFilter by completion state.
userIdqueryintegerOnly return todos that belong to this user ID.
delayqueryintegerDelay the response by this many milliseconds (0-5000). Subject to a stricter rate limit.Range: 0-5000

Status codes

  • 200A page of todos with total, skip, and limit metadata.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 429Too many requests from this IP (RATE_LIMIT_EXCEEDED).
  • 503The database is temporarily unavailable (SERVICE_UNAVAILABLE).

Request

curl 'https://test.naimulhassan.me/api/v1/todos?limit=2'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "todos": [
    {
      "id": 1,
      "todo": "Reply to project kickoff email",
      "completed": false,
      "userId": 1
    },
    {
      "id": 2,
      "todo": "Buy groceries for the week",
      "completed": false,
      "userId": 2
    }
  ],
  "total": 200,
  "skip": 0,
  "limit": 2
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.

Get a todo

GET/api/v1/todos/{id}

Returns a single todo by its numeric ID.

Parameters

Parameters for Get a todo
NameInTypeDescription
idrequiredpathintegerNumeric todo ID (positive integer).Min: 1
selectquerystringComma-separated list of fields to return. id is always included. Allowed: id, todo, completed, userId.
delayqueryintegerDelay the response by this many milliseconds (0-5000). Subject to a stricter rate limit.Range: 0-5000

Status codes

  • 200The todo object.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404No record exists with that ID (RESOURCE_NOT_FOUND).

Request

curl 'https://test.naimulhassan.me/api/v1/todos/1'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "id": 1,
  "todo": "Reply to project kickoff email",
  "completed": false,
  "userId": 1
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.

Create a todo (simulated)

POST/api/v1/todos
Simulated - not persisted

Validates the body and returns the todo as it would be created, with the next available ID. Nothing is persisted: the shared dataset is never modified.

Headers

Headers for Create a todo (simulated)
NameInTypeDescription
Content-TyperequiredheaderstringMust be application/json.

Request body

Todos fields.

Body fields for Create a todo (simulated)
FieldTypeRequiredNotes
todostringYesmin length 1, max length 300
completedbooleanNo
userIdintegerYesmin 0, max 1000000000

Status codes

  • 201The simulated todo, including its new id.
  • 400The request body is not valid JSON (INVALID_JSON).
  • 422The JSON body failed validation (VALIDATION_ERROR).

Request

curl -X POST 'https://test.naimulhassan.me/api/v1/todos' \
  -H 'Content-Type: application/json' \
  -d '{
  "todo": "Write integration tests",
  "completed": false,
  "userId": 5
}'

Example responses

Captured from the real API with the requests shown on this page.

201application/json
{
  "id": 201,
  "todo": "Write integration tests",
  "completed": false,
  "userId": 5
}

Try it

POST
Headers
Open in playground
Send the request to see a live response.

Replace a todo (simulated)

PUT/api/v1/todos/{id}
Simulated - not persisted

Validates a complete replacement body and returns the resulting todo. The stored record is not changed.

Parameters

Parameters for Replace a todo (simulated)
NameInTypeDescription
idrequiredpathintegerNumeric todo ID (positive integer).Min: 1

Headers

Headers for Replace a todo (simulated)
NameInTypeDescription
Content-TyperequiredheaderstringMust be application/json.

Request body

Complete todo representation.

Body fields for Replace a todo (simulated)
FieldTypeRequiredNotes
todostringYesmin length 1, max length 300
completedbooleanNo
userIdintegerYesmin 0, max 1000000000

Status codes

  • 200The replaced todo.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404No record exists with that ID (RESOURCE_NOT_FOUND).
  • 422The JSON body failed validation (VALIDATION_ERROR).

Request

curl -X PUT 'https://test.naimulhassan.me/api/v1/todos/1' \
  -H 'Content-Type: application/json' \
  -d '{
  "todo": "Review pull request",
  "completed": true,
  "userId": 1
}'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "id": 1,
  "todo": "Review pull request",
  "completed": true,
  "userId": 1
}

Try it

PUT
Headers
Open in playground
Send the request to see a live response.

Update a todo (simulated)

PATCH/api/v1/todos/{id}
Simulated - not persisted

Merges the provided fields into the existing todo and returns the result. The stored record is not changed.

Parameters

Parameters for Update a todo (simulated)
NameInTypeDescription
idrequiredpathintegerNumeric todo ID (positive integer).Min: 1

Headers

Headers for Update a todo (simulated)
NameInTypeDescription
Content-TyperequiredheaderstringMust be application/json.

Request body

Any subset of todo fields.

Body fields for Update a todo (simulated)
FieldTypeRequiredNotes
todostringNomin length 1, max length 300
completedbooleanNo
userIdintegerNomin 0, max 1000000000

Status codes

  • 200The updated todo.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404No record exists with that ID (RESOURCE_NOT_FOUND).
  • 422The JSON body failed validation (VALIDATION_ERROR).

Request

curl -X PATCH 'https://test.naimulhassan.me/api/v1/todos/1' \
  -H 'Content-Type: application/json' \
  -d '{
  "completed": true
}'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "id": 1,
  "todo": "Reply to project kickoff email",
  "completed": true,
  "userId": 1
}

Try it

PATCH
Headers
Open in playground
Send the request to see a live response.

Delete a todo (simulated)

DELETE/api/v1/todos/{id}
Simulated - not persisted

Returns 204 No Content if the todo exists. The record is not actually removed.

Parameters

Parameters for Delete a todo (simulated)
NameInTypeDescription
idrequiredpathintegerNumeric todo ID (positive integer).Min: 1

Status codes

  • 204Empty body.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404No record exists with that ID (RESOURCE_NOT_FOUND).

Request

curl -X DELETE 'https://test.naimulhassan.me/api/v1/todos/1'

Example responses

Captured from the real API with the requests shown on this page.

204no content

No response body.

Try it

DELETE
Headers

No header yet.

Open in playground
Send the request to see a live response.