← Back to All APIs

Todos API

Task management with completion status and priorities

Base URL
https://fakeapi.in/api/todos

API Endpoints

GET/api/todos
Copy All

Get all todos

Parameters

page(number)
Page number for pagination (optional)
limit(number)
Number of todos per page (optional)
sortField(string)
Field to sort by (e.g. priority, createdAt, dueDate)
sortOrder(string)
Sorting order (asc or desc)
GET/api/todos/1
Copy All

Get single todo by ID

Parameters

id(number)
Unique ID of the todo to fetch
GET/api/todos?q=learn
Copy All

Search todos by task name

Parameters

q(string)
Keyword to search todos by title or description
GET/api/todos?completed=true
Copy All

Filter todos by completion status

Parameters

completed(boolean)
Filter todos by completion (true/false)
GET/api/todos?priority=high&assignedTo=Vishal
Copy All

Filter todos by multiple fields

Parameters

priority(string)
Priority level of todo (low, medium, high)
assignedTo(string)
User assigned to the todo
GET/api/todos?sortField=priority&sortOrder=desc
Copy All

Sort todos by any field in ascending/descending order

Parameters

sortField(string)
Field to sort by (e.g. priority, dueDate)
sortOrder(string)
Sorting order (asc or desc)
GET/api/todos?page=2&limit=5
Copy All

Get todos with pagination

Parameters

page(number)
Page number for pagination
limit(number)
Number of todos per page
POST/api/todos
Copy All

Create todo

Parameters

title(string)
Title of the todo task
description(string)
Detailed description of the todo task
priority(string)
Priority level (low, medium, high)
dueDate(string)
Due date for the task (YYYY-MM-DD)
assignedTo(string)
Name or ID of the assigned user
completed(boolean)
Completion status (default: false)
PATCH/api/todos/1
Copy All

Partially update todo (only specific fields)

Parameters

id(number)
Todo ID to update
fields(object)
Fields to update (e.g. { title, completed })
PUT/api/todos/1
Copy All

Update todo (replace all fields)

Parameters

id(number)
Todo ID to update
title(string)
Updated title of the todo task
description(string)
Updated description
priority(string)
Updated priority (low, medium, high)
dueDate(string)
Updated due date (YYYY-MM-DD)
assignedTo(string)
Updated assigned user
completed(boolean)
Updated completion status
DELETE/api/todos/1
Copy All

Delete todo

Parameters

id(number)
Todo ID to delete

Example Usage

Copy All

import axios from "axios";

const API_URL = process.env.NEXT_PUBLIC_API_URL;

// Get all todos
axios
  .get(`${API_URL}api/todos`)
  .then(res => console.log("All Todos:", res.data))
  .catch(err => console.error(err));

// Create a new todo
axios
  .post(`${API_URL}api/todos`, {
    task: "Learn MERN Stack",
    completed: false,
    assignedTo: "Vishal",
    priority: "high"
  })
  .then(res => console.log("Todo Created:", res.data))
  .catch(err => console.error(err));

Example Response

Copy All
{
      "id": 1,
      "task": "aufero credo spoliatio cerno",
      "completed": false,
      "dueDate": "2025-10-20T01:47:40.504Z",
      "priority": "Medium",
      "assignedTo": "Marjorie Brekke II"
    }

Quick Actions

Test in Playground

API Status

StatusOperational
Rate Limit1000 requests/hour
Response FormatJSON
Todos API - Task Management Documentation | FakeAPI.in