PUT /api/tasks/{task_id}
Also accepts PATCH /api/tasks/{task_id}.
Updates one or more fields on an existing task. Regular users can only update tasks they own; admin users can update any task. All request body fields are optional — only the fields present in the request body will be modified.
When status is updated to completed, the completed_at timestamp is automatically set to the current UTC time. If status is changed away from completed, completed_at is cleared.
Providing a tags array replaces all existing tag associations on the task.
Authentication
Path Parameters
The unique ID of the task to update.
Request Body
New task title. Must be between 1 and 200 characters.
New task description. Maximum 5000 characters. Pass
null or an empty string to clear the description.New task status. Allowed values:
pending, in_progress, completed, cancelled.New task priority. Allowed values:
low, medium, high, urgent.New due date in ISO 8601 format, e.g.
"2024-12-31T23:59:59". Pass null or an empty string to clear the due date.Replaces all existing tag associations. Pass an empty array
[] to remove all tags.Response
200 OK — Returns the updated task object.Always
true for successful responses.Confirmation message.
Error Responses
| Status | Description |
|---|---|
400 Bad Request | A field failed validation (e.g. title too long, invalid enum value, unparseable date). |
403 Forbidden | The authenticated user does not own this task and is not an admin. |
404 Not Found | No task with the given task_id exists. |