Documentation menu

Resource reference

Todos

Task-like records connected to users with a completion state.

200 records after each resetView live JSON

Data model

Todos schema

Responses include the following fields. Read-only values are generated by the API.

FieldTypeRequiredDescription
idintegerRead onlyAuto-incrementing resource identifier.
titlestringRequiredTodo title, 1 to 200 characters.
descriptionstring | nullOptionalAdditional detail, 1 to 1,000 characters when provided.
completedbooleanOptionalCompletion state. Defaults to false.
userIdintegerOptionalOwning user ID. Defaults to 1 when omitted on create.
userobjectRead onlyNested summary of the current owning user.
createdAtISO 8601 stringRead onlyTime the record was created.
updatedAtISO 8601 stringRead onlyTime the record was last updated.

Example object

A complete todo

JSON
{
  "id": 1,
  "title": "Review the component architecture",
  "description": "Check the loading and empty states before the next release.",
  "completed": false,
  "userId": 1,
  "createdAt": "2026-07-22T00:00:03.599Z",
  "updatedAt": "2026-07-22T00:00:03.599Z",
  "user": {
    "id": 1,
    "name": "John Doe",
    "username": "johndoe",
    "email": "john.doe@example.com"
  }
}

Endpoints

Read and write todos

Every example uses the shared free API. Replace :id with a numeric record ID.

GET/todos

List todos

Returns paginated todos with a nested user summary.

cURL request
curl 'https://api.apimocker.com/todos'

Parameters

ParameterTypeRequiredDescription
_page or pageintegerOptionalPage number. Defaults to 1.
_limit or limitintegerOptionalItems per page. Defaults to 10 and is capped at 100.
_sortstringOptionalField used for sorting. Defaults to id.
_orderasc | descOptionalSort direction. Defaults to asc.
_delayintegerOptionalArtificial response delay in milliseconds.
userIdintegerOptionalFilter by owner.
completedbooleanOptionalFilter by completion state.
title_likestringOptionalPartial, case-insensitive title match.

Example response

JSON
{
  "data": [
    {
      "id": 1,
      "title": "Review the component architecture",
      "description": "Check the loading and empty states before the next release.",
      "completed": false,
      "userId": 1,
      "createdAt": "2026-07-22T00:00:03.599Z",
      "updatedAt": "2026-07-22T00:00:03.599Z",
      "user": {
        "id": 1,
        "name": "John Doe",
        "username": "johndoe",
        "email": "john.doe@example.com"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 200,
    "totalPages": 20,
    "hasNext": true,
    "hasPrev": false
  }
}

GET/todos/search?q=review

Search todos

Searches title and description and returns up to 10 matches.

cURL request
curl 'https://api.apimocker.com/todos/search?q=review'

Parameters

ParameterTypeRequiredDescription
qstringRequiredCase-insensitive search text.
_delayintegerOptionalArtificial response delay in milliseconds.

Example response

JSON
{
  "query": "review",
  "total": 1,
  "results": [
    {
      "id": 1,
      "title": "Review the component architecture",
      "description": "Check the loading and empty states before the next release.",
      "completed": false,
      "userId": 1,
      "createdAt": "2026-07-22T00:00:03.599Z",
      "updatedAt": "2026-07-22T00:00:03.599Z",
      "user": {
        "id": 1,
        "name": "John Doe",
        "username": "johndoe",
        "email": "john.doe@example.com"
      }
    }
  ]
}

GET/todos/:id

Get one todo

Returns a todo directly with its nested user summary.

cURL request
curl 'https://api.apimocker.com/todos/1'

Parameters

ParameterTypeRequiredDescription
idintegerRequiredThe resource ID from the URL path.
_delayintegerOptionalArtificial response delay in milliseconds.

Example response

JSON
{
  "id": 1,
  "title": "Review the component architecture",
  "description": "Check the loading and empty states before the next release.",
  "completed": false,
  "userId": 1,
  "createdAt": "2026-07-22T00:00:03.599Z",
  "updatedAt": "2026-07-22T00:00:03.599Z",
  "user": {
    "id": 1,
    "name": "John Doe",
    "username": "johndoe",
    "email": "john.doe@example.com"
  }
}

POST/todos

Create a todo

201 Created

Creates a todo. completed defaults to false and userId defaults to 1.

cURL request
curl -X POST 'https://api.apimocker.com/todos' \
  -H 'Content-Type: application/json' \
  -d '{   "title": "Test the empty state",   "description": "Verify the UI before launch.",   "completed": false,   "userId": 1 }'

Request body

JSON
{
  "title": "Test the empty state",
  "description": "Verify the UI before launch.",
  "completed": false,
  "userId": 1
}

Example response

JSON
{
  "id": 1,
  "title": "Review the component architecture",
  "description": "Check the loading and empty states before the next release.",
  "completed": false,
  "userId": 1,
  "createdAt": "2026-07-22T00:00:03.599Z",
  "updatedAt": "2026-07-22T00:00:03.599Z",
  "user": {
    "id": 1,
    "name": "John Doe",
    "username": "johndoe",
    "email": "john.doe@example.com"
  }
}

  • Writes affect the shared dataset until the next daily reset.
  • Unknown fields are rejected by the database layer.

PUT/todos/:id

Replace a todo

200 OK

Updates a todo. Title is required.

cURL request
curl -X PUT 'https://api.apimocker.com/todos/1' \
  -H 'Content-Type: application/json' \
  -d '{   "title": "Test the completed state",   "completed": true,   "userId": 1 }'

Parameters

ParameterTypeRequiredDescription
idintegerRequiredThe resource ID from the URL path.

Request body

JSON
{
  "title": "Test the completed state",
  "completed": true,
  "userId": 1
}

Example response

JSON
{
  "id": 1,
  "title": "Review the component architecture",
  "description": "Check the loading and empty states before the next release.",
  "completed": false,
  "userId": 1,
  "createdAt": "2026-07-22T00:00:03.599Z",
  "updatedAt": "2026-07-22T00:00:03.599Z",
  "user": {
    "id": 1,
    "name": "John Doe",
    "username": "johndoe",
    "email": "john.doe@example.com"
  }
}

  • Writes affect the shared dataset until the next daily reset.
  • Unknown fields are rejected by the database layer.

PATCH/todos/:id

Update selected todo fields

200 OK

Updates only the provided fields.

cURL request
curl -X PATCH 'https://api.apimocker.com/todos/1' \
  -H 'Content-Type: application/json' \
  -d '{   "completed": true }'

Parameters

ParameterTypeRequiredDescription
idintegerRequiredThe resource ID from the URL path.

Request body

JSON
{
  "completed": true
}

Example response

JSON
{
  "id": 1,
  "title": "Review the component architecture",
  "description": "Check the loading and empty states before the next release.",
  "completed": false,
  "userId": 1,
  "createdAt": "2026-07-22T00:00:03.599Z",
  "updatedAt": "2026-07-22T00:00:03.599Z",
  "user": {
    "id": 1,
    "name": "John Doe",
    "username": "johndoe",
    "email": "john.doe@example.com"
  }
}

  • Writes affect the shared dataset until the next daily reset.
  • Unknown fields are rejected by the database layer.

DELETE/todos/:id

Delete a todo

204 No Content

Deletes the todo permanently until the next reset.

cURL request
curl -X DELETE 'https://api.apimocker.com/todos/1'

Parameters

ParameterTypeRequiredDescription
idintegerRequiredThe resource ID from the URL path.
  • Writes affect the shared dataset until the next daily reset.
  • Unknown fields are rejected by the database layer.