Skip to main content

Edit Task

PUT /day/task/:taskId​

Description​

Updates a task owned by the authenticated user.

Daily task templates cannot be given a date and cannot be marked as completed.

Request Parameters​

Requires Authentication: true​

PATH PARAMS​

NameTypeRequiredDescription
taskIdstringYesMongoDB task ID.

BODY​

At least one field must be provided.

NameTypeRequiredDescription
titlestringNoNew title.
datestringNoNew ISO date for normal tasks only.
privacystringNopublic, private, or close friends.
completedbooleanNoCompletion status for normal tasks only.

Usage Example​

await axios.put(
"https://api.daykeeper.app/day/task/67d9c2b7cc9e4db02fca1028",
{
completed: true
},
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
)

Success Response​

{
"message": "Task updated successfully",
"task": {
"_id": "67d9c2b7cc9e4db02fca1028",
"completed": true
}
}

Error Response​

CodeDescription
400Invalid task ID or invalid update data
401Missing or invalid access token
404Task not found
500Server error