Resource reference
Todos
Task-like records connected to users with a completion state.
Data model
Todos schema
Responses include the following fields. Read-only values are generated by the API.
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | Read only | Auto-incrementing resource identifier. |
title | string | Required | Todo title, 1 to 200 characters. |
description | string | null | Optional | Additional detail, 1 to 1,000 characters when provided. |
completed | boolean | Optional | Completion state. Defaults to false. |
userId | integer | Optional | Owning user ID. Defaults to 1 when omitted on create. |
user | object | Read only | Nested summary of the current owning user. |
createdAt | ISO 8601 string | Read only | Time the record was created. |
updatedAt | ISO 8601 string | Read only | Time the record was last updated. |
Example object
A complete todo
{
"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 'https://api.apimocker.com/todos'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
_page or page | integer | Optional | Page number. Defaults to 1. |
_limit or limit | integer | Optional | Items per page. Defaults to 10 and is capped at 100. |
_sort | string | Optional | Field used for sorting. Defaults to id. |
_order | asc | desc | Optional | Sort direction. Defaults to asc. |
_delay | integer | Optional | Artificial response delay in milliseconds. |
userId | integer | Optional | Filter by owner. |
completed | boolean | Optional | Filter by completion state. |
title_like | string | Optional | Partial, case-insensitive title match. |
Example response
{
"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 'https://api.apimocker.com/todos/search?q=review'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Required | Case-insensitive search text. |
_delay | integer | Optional | Artificial response delay in milliseconds. |
Example response
{
"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 'https://api.apimocker.com/todos/1'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
_delay | integer | Optional | Artificial response delay in milliseconds. |
Example response
{
"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
Creates a todo. completed defaults to false and userId defaults to 1.
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
{
"title": "Test the empty state",
"description": "Verify the UI before launch.",
"completed": false,
"userId": 1
}Example response
{
"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
Updates a todo. Title is required.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
Request body
{
"title": "Test the completed state",
"completed": true,
"userId": 1
}Example response
{
"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
Updates only the provided fields.
curl -X PATCH 'https://api.apimocker.com/todos/1' \
-H 'Content-Type: application/json' \
-d '{ "completed": true }'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
Request body
{
"completed": true
}Example response
{
"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
Deletes the todo permanently until the next reset.
curl -X DELETE 'https://api.apimocker.com/todos/1'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
- Writes affect the shared dataset until the next daily reset.
- Unknown fields are rejected by the database layer.