GET /api/tasks/{task_id}
Returns the full details of a single task. Regular users can only access tasks they own; admin users can access any task.
Authentication
Authorization: Bearer <access_token>
Path Parameters
The unique ID of the task to retrieve.
Response
200 OK — Returns the full task object.
Always true for successful responses.
Task title. Maximum 200 characters.
Optional task description. Maximum 5000 characters.
Current task status. One of: pending, in_progress, completed, cancelled.
Task priority level. One of: low, medium, high, urgent.
ISO 8601 datetime when the task is due, or null if not set.
ISO 8601 datetime when the task was completed, or null if not yet completed.
true if due_date is in the past and the task is not completed.
true if status is completed.
ISO 8601 datetime when the task was created.
ISO 8601 datetime when the task was last updated.
ID of the user who owns this task.
List of tag objects associated with the task. Each tag has id (integer) and name (string).
Error Responses
| Status | Description |
|---|
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. |
Example
curl -X GET "https://task-forge-gbd6h8gtg8hchve9.chilecentral-01.azurewebsites.net/api/tasks/42" \
-H "Authorization: Bearer <access_token>"
Example response:
{
"success": true,
"data": {
"id": 42,
"title": "Write API documentation",
"description": "Cover all endpoints with examples",
"status": "in_progress",
"priority": "high",
"due_date": "2024-11-30T23:59:59",
"completed_at": null,
"is_overdue": false,
"is_completed": false,
"created_at": "2024-10-01T09:00:00",
"updated_at": "2024-10-15T14:22:00",
"user_id": 7,
"tags": [
{ "id": 3, "name": "docs" }
]
}
}