GET /api/tasks/statistics
Returns aggregate task counts broken down by status and priority, plus the number of overdue tasks, for the authenticated user.
Authentication
Authorization: Bearer <access_token>
Query Parameters
None.
Response
200 OK — Returns a statistics object.
Always true for successful responses.
Total number of tasks owned by the user.
Number of tasks with status completed.
Number of tasks with status pending.
Number of tasks with status in_progress.
Number of tasks with status cancelled.
Number of non-completed tasks whose due_date is in the past.
Task counts grouped by priority level.
Number of tasks with priority low.
Number of tasks with priority medium.
Number of tasks with priority high.
Number of tasks with priority urgent.
Example
curl -X GET "https://task-forge-gbd6h8gtg8hchve9.chilecentral-01.azurewebsites.net/api/tasks/statistics" \
-H "Authorization: Bearer <access_token>"
Example response:
{
"success": true,
"data": {
"total_tasks": 34,
"completed_tasks": 18,
"pending_tasks": 8,
"in_progress_tasks": 6,
"cancelled_tasks": 2,
"overdue_tasks": 3,
"by_priority": {
"low": 5,
"medium": 14,
"high": 11,
"urgent": 4
}
}
}