> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sagepilot.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get ticket stats

> Get ticket status counts for a customer.

<ResponseExample>
  ```json 200 theme={null}
  {
    "closed": 92,
    "open": 23
  }
  ```
</ResponseExample>

Get ticket status counts for a customer in the authenticated workspace.

## Required access

| Authentication                                               | Scope            | Dataset grant |
| ------------------------------------------------------------ | ---------------- | ------------- |
| [API client v2](/api-reference/authentication/api-client-v2) | `customers:read` | `customers`   |

## Body

<ParamField body="customerId" type="string" required>
  Customer UUID to calculate ticket counts for. Open a customer in the Customer module and use the last UUID in the URL: `/dashboard/[workspace_id]/customers/[customer_id]`. See [Resource IDs](/api-reference/authentication/api-client-v2#resource-ids).
</ParamField>

<ParamField body="workspaceId" type="string">
  Optional workspace UUID. The authenticated workspace is used by default. Find the current workspace ID in **Settings > API Details > Channels**. See [Resource IDs](/api-reference/authentication/api-client-v2#resource-ids).
</ParamField>

<ParamField body="includeLinkedContacts" type="boolean" default="false">
  Include tickets from linked contacts.
</ParamField>

## Response

<ResponseField name="<status>" type="integer">
  Count of tickets for each returned status key.
</ResponseField>
