Resources
Todos
Writes are simulated
POST, PUT, PATCH, and DELETE validate your input and return realistic responses, but the shared dataset is never modified.
Endpoints
- GET
/todosList todos - GET
/todos/{id}Get a todo - POST
/todosCreate a todo (simulated) - PUT
/todos/{id}Replace a todo (simulated) - PATCH
/todos/{id}Update a todo (simulated) - DELETE
/todos/{id}Delete a todo (simulated)
The todo object
Use select to return a subset of these fields. Sort with sortBy on id, todo, userId; search matches . See query parameters.
| Field | Type | Notes |
|---|---|---|
id | integer | min -9007199254740991, max 9007199254740991 |
todo | string | |
completed | boolean | |
userId | integer | min -9007199254740991, max 9007199254740991 |
List todos
/api/v1/todosReturns a paginated list of todos. Supports pagination, field selection, sorting, and filtering.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Number of records to return (1-100).Default: 30Range: 1-100 |
skip | query | integer | Number of records to skip before returning results.Default: 0Range: 0-1000000 |
select | query | string | Comma-separated list of fields to return. id is always included. Allowed: id, todo, completed, userId. |
sortBy | query | string | Field to sort by.One of: id, todo, userIdDefault: id |
order | query | string | Sort direction.One of: asc, descDefault: asc |
completed | query | boolean | Filter by completion state. |
userId | query | integer | Only return todos that belong to this user ID. |
delay | query | integer | Delay 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, andlimitmetadata. - 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.
{
"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 a todo
/api/v1/todos/{id}Returns a single todo by its numeric ID.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric todo ID (positive integer).Min: 1 |
select | query | string | Comma-separated list of fields to return. id is always included. Allowed: id, todo, completed, userId. |
delay | query | integer | Delay 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.
{
"id": 1,
"todo": "Reply to project kickoff email",
"completed": false,
"userId": 1
}Try it
Create a todo (simulated)
/api/v1/todosValidates 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
| Name | In | Type | Description |
|---|---|---|---|
Content-Typerequired | header | string | Must be application/json. |
Request body
Todos fields.
| Field | Type | Required | Notes |
|---|---|---|---|
todo | string | Yes | min length 1, max length 300 |
completed | boolean | No | |
userId | integer | Yes | min 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.
{
"id": 201,
"todo": "Write integration tests",
"completed": false,
"userId": 5
}Try it
Replace a todo (simulated)
/api/v1/todos/{id}Validates a complete replacement body and returns the resulting todo. The stored record is not changed.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric todo ID (positive integer).Min: 1 |
Headers
| Name | In | Type | Description |
|---|---|---|---|
Content-Typerequired | header | string | Must be application/json. |
Request body
Complete todo representation.
| Field | Type | Required | Notes |
|---|---|---|---|
todo | string | Yes | min length 1, max length 300 |
completed | boolean | No | |
userId | integer | Yes | min 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.
{
"id": 1,
"todo": "Review pull request",
"completed": true,
"userId": 1
}Try it
Update a todo (simulated)
/api/v1/todos/{id}Merges the provided fields into the existing todo and returns the result. The stored record is not changed.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric todo ID (positive integer).Min: 1 |
Headers
| Name | In | Type | Description |
|---|---|---|---|
Content-Typerequired | header | string | Must be application/json. |
Request body
Any subset of todo fields.
| Field | Type | Required | Notes |
|---|---|---|---|
todo | string | No | min length 1, max length 300 |
completed | boolean | No | |
userId | integer | No | min 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.
{
"id": 1,
"todo": "Reply to project kickoff email",
"completed": true,
"userId": 1
}Try it
Delete a todo (simulated)
/api/v1/todos/{id}Returns 204 No Content if the todo exists. The record is not actually removed.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric 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.
No response body.