Skip to main content

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

task_id
integer
required
The unique ID of the task to retrieve.

Response

200 OK — Returns the full task object.
success
boolean
Always true for successful responses.
data
object

Error Responses

StatusDescription
403 ForbiddenThe authenticated user does not own this task and is not an admin.
404 Not FoundNo 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" }
    ]
  }
}

Build docs developers (and LLMs) love