Todos
Last updated 2026-05-20
Copy-ready todo JSON: list, single, random, paginated, per-user. Add, update, and delete request/response examples. Live REST endpoint at /todos.
Todos
fetch('https://jsonexamples.com/todos')
.then(res => res.json())
.then(console.log);Response
{
"todos": [
{ "id": 1, "todo": "Do something nice for someone I care about", "completed": true, "userId": 26 }
// 30 items
],
"total": 150,
"skip": 0,
"limit": 30
}fetch('https://jsonexamples.com/todos/1')
.then(res => res.json())
.then(console.log);Response
{
"id": 1,
"todo": "Do something nice for someone I care about",
"completed": true,
"userId": 26
}fetch('https://jsonexamples.com/todos/random')
.then(res => res.json())
.then(console.log);Response
{
// random result, changes every call to /random
"id": 127,
"todo": "Prepare a dish from a foreign culture",
"completed": false,
"userId": 7
}- Use
limitandskipfor pagination.
fetch('https://jsonexamples.com/todos?limit=3&skip=10')
.then(res => res.json())
.then(console.log);Response
{
"todos": [
{ "id": 11, "todo": "Text a friend I haven't talked to in a long time", "completed": false, "userId": 39 }
],
"total": 150,
"skip": 10,
"limit": 3
}/* getting todos of user with id 5 */
fetch('https://jsonexamples.com/todos/user/5')
.then(res => res.json())
.then(console.log);Response
{
"todos": [
{ "id": 19, "todo": "Create a compost pile", "completed": true, "userId": 5 }
],
"total": 3,
"skip": 0,
"limit": 3
}POST
Add a new todo
fetch('https://jsonexamples.com/todos/add', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
todo: 'Use JsonExamples in the project',
completed: false,
userId: 5,
})
})
.then(res => res.json())
.then(console.log);Response
{
"id": 151,
"todo": "Use JsonExamples in the project",
"completed": false,
"userId": 5
}/* updating completed status of todo with id 1 */
fetch('https://jsonexamples.com/todos/1', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ completed: false })
})
.then(res => res.json())
.then(console.log);Response
{
"id": "1",
"todo": "Do something nice for someone I care about",
"completed": false,
"userId": 26
}DELETE
Delete a todo
fetch('https://jsonexamples.com/todos/1', { method: 'DELETE' })
.then(res => res.json())
.then(console.log);Response
{
"id": 1,
"todo": "Do something nice for someone I care about",
"completed": true,
"userId": 26,
"isDeleted": true,
"deletedOn": /* ISOTime */
}