This API allows for the management of users, tasks, and comments in a task management application. It provides endpoints for creating, reading, updating, and deleting (CRUD) resources, as well as additional functionalities for user authentication and task assignment.
- All endpoints require authentication via a Bearer token in the Authorization header.
- POST
/users
- Request Body:
{ "username": "string", "email": "string", "password": "string" }
- Response:
- 201 Created
{ "id": "uuid", "username": "string", "email": "string", "created_at": "timestamp", "updated_at": "timestamp" }
- GET
/users/{id}
- Response:
- 200 OK
{ "id": "uuid", "username": "string", "email": "string", "created_at": "timestamp", "updated_at": "timestamp" }
- PUT
/users/{id}
- Request Body:
{ "username": "string", "email": "string", "password": "string" // Optional }
- Response:
- 200 OK
{ "id": "uuid", "username": "string", "email": "string", "created_at": "timestamp", "updated_at": "timestamp" }
- DELETE
/users/{id}
- Response:
- 204 No Content
- POST
/users/login
- Request Body:
{ "email": "string", "password": "string" }
- Response:
- 200 OK
{ "token": "string", "user": { "id": "uuid", "username": "string", "email": "string" } }
- POST
/tasks
- Request Body:
{ "title": "string", "description": "string", "status": "pending | in_progress | completed", "user_id": "uuid" // Optional, for task assignment }
- Response:
- 201 Created
{ "id": "uuid", "title": "string", "description": "string", "status": "pending | in_progress | completed", "user_id": "uuid", "created_at": "timestamp", "updated_at": "timestamp" }
- GET
/tasks/{id}
- Response:
- 200 OK
{ "id": "uuid", "title": "string", "description": "string", "status": "pending | in_progress | completed", "user_id": "uuid", "created_at": "timestamp", "updated_at": "timestamp" }
- PUT
/tasks/{id}
- Request Body:
{ "title": "string", "description": "string", "status": "pending | in_progress | completed", "user_id": "uuid" // Optional, for reassigning }
- Response:
- 200 OK
{ "id": "uuid", "title": "string", "description": "string", "status": "pending | in_progress | completed", "user_id": "uuid", "created_at": "timestamp", "updated_at": "timestamp" }
- DELETE
/tasks/{id}
- Response:
- 204 No Content
- GET
/tasks
- Response:
- 200 OK
[ { "id": "uuid", "title": "string", "description": "string", "status": "pending | in_progress | completed", "user_id": "uuid", "created_at": "timestamp", "updated_at": "timestamp" } ]
- POST
/comments
- Request Body:
{ "task_id": "uuid", "content": "string" }
- Response:
- 201 Created
{ "id": "uuid", "task_id": "uuid", "user_id": "uuid", "content": "string", "created_at": "timestamp", "updated_at": "timestamp" }
- GET
/tasks/{task_id}/comments
- Response:
- 200 OK
[ { "id": "uuid", "task_id": "uuid", "user_id": "uuid", "content": "string", "created_at": "timestamp", "updated_at": "timestamp" } ]
- DELETE
/comments/{id}
- Response:
- 204 No Content
- POST
/chat
- Request Body:
{ "userId": "uuid", "taskId": "uuid", "message": "string" }
- Response:
- 201 Created
{ "id": "uuid", "userId": "uuid", "taskId": "uuid", "message": "string", "createdAt": "timestamp" }
- GET
/chat/{taskId}
- Response:
- 200 OK
[ { "id": "uuid", "userId": "uuid", "taskId": "uuid", "message": "string", "createdAt": "timestamp" } ]
- DELETE
/chat/{id}
- Response:
- 204 No Content
- All responses will include an error object in the following format: