Endpoint
Creates a new task with the provided data
Request
Request Body
The name of the task. Must be between 1 and 500 characters.
Whether the task is completed. Defaults to
false if not provided.Example Request
Response
The created task object
Status Codes
Successfully created the task
Validation error - invalid request body
Example Responses
Validation Rules
The request body is validated using theinsertTasksSchema from src/db/schema.ts:23-34:
- name: Required string, minimum 1 character, maximum 500 characters
- done: Required boolean
- id, createdAt, updatedAt: Automatically generated and cannot be provided in the request
Implementation Details
This endpoint is defined insrc/routes/tasks/tasks.routes.ts:23-43 and implemented in src/routes/tasks/tasks.handlers.ts:18-22.
The task is inserted into the database using Drizzle ORM and the created record (with auto-generated fields) is returned.