Endpoint
Updates specific fields of an existing task
Request
Path Parameters
The unique identifier of the task to update
Request Body
All fields are optional. Only provide the fields you want to update.The new name for the task. Must be between 1 and 500 characters if provided.
The new completion status for the task
Example Request
Response
The updated task object with all fields
Status Codes
Successfully updated the task
Task with the specified ID does not exist
Validation error - invalid ID parameter or request body
Example Responses
Validation Rules
The request body is validated using thepatchTasksSchema from src/db/schema.ts:37, which is a partial version of insertTasksSchema:
- name: Optional string, but if provided must be between 1 and 500 characters
- done: Optional boolean
- At least one field must be provided (empty object returns 422 error)
- id, createdAt, updatedAt: Cannot be modified
Implementation Details
This endpoint is defined insrc/routes/tasks/tasks.routes.ts:68-94 and implemented in src/routes/tasks/tasks.handlers.ts:44-82.
The endpoint performs a partial update, meaning you only need to send the fields you want to change. The updatedAt timestamp is automatically updated by the database on each modification.