---
title: "Get grouped task counts"
method: GET
path: "/tasks/group-counts"
tags: ["Tasks"]
---

# Get grouped task counts

`GET /tasks/group-counts`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/tasks/group-counts`
- Auth: HTTP bearer

Get task counts grouped by a specified field, using the same filters as GET /tasks. Returns group keys, labels, and counts without task data.

## Query parameters

- `groupBy` 'cohort' | 'phase' | 'status' | 'assignee' | 'partner', required
- `search` string
- `status` string
- `phase` string
- `cohortIds` string
- `assigneeIds` string
- `dueDateFrom` string, date
- `dueDateTo` string, date
- `isOverdue` boolean
- `includeOverdue` boolean

## Response `200`

Group counts retrieved successfully

- object
  - `success` boolean
  - `data` object[]
    - `key` string: Group identifier
    - `label` string: Human-readable group label
    - `count` integer: Number of tasks in this group

## Other responses

- `400`: Bad request - missing or invalid groupBy parameter
- `401`: Unauthorized
- `500`: Internal server error

---

[API](https://skmtc.dev/withmedley/apis/medley-api.md) - [All operations](https://skmtc.dev/withmedley/apis/medley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/withmedley/apis/medley-api/revisions/40aaac5ca6bd?raw)
