The to-do list API allows users to easily delete existing tasks. For example, this capability can delete tasks after completion or remove tasks that are no longer relevant.
If the service isn’t running, run the following command:
cd <your-github-workspace>/to-do-service/api
json-server -w to-do-db-source.json
/tasks
Content-Type: application/json
{
"user_id": 1,
"title": "Grocery shopping",
"description": "eggs, bacon, gummy bears",
"due_date": "2025-02-20T17:00",
"warning": "-10",
"id": 1
},
{
"user_id": 1,
"title": "Piano recital",
"description": "Daughter's first concert appearance",
"due_date": "2025-04-02T15:00",
"warning": "-30",
"id": 2
},
{
"user_id": 2,
"title": "Oil change",
"description": "5K auto service",
"due_date": "2025-03-10T09:00",
"warning": "-60",
"id": 3
},
{
"user_id": 3,
"title": "Get shots for dog",
"description": "Annual vaccinations for poochy",
"due_date": "2025-05-11T14:00",
"warning": "-20",
"id": 4
}
/tasks/{taskId}
Content-Type: application/json
{}
/tasks/{taskId}
Content-Type: application/json
{}
{}
You can now locate and delete existing tasks in the to-do list.