# GET /api/v1/tag-groups

> List tag groups

- **Tag:** tags
- **Operation ID:** `list_tag_groups_api_v1_tag_groups_get`

## Description

Retrieve all tag groups for the current business

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `cursor` (query, string, optional) — Cursor for pagination
- `limit` (query, integer, optional) — Pagination limit
- `direction` (query, string, optional) — Pagination direction: 'next' or 'prev'
- `include_total_count` (query, boolean, optional) — Whether to include total count (expensive - avoid if possible)
- `sort_by` (query, string, optional) — Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.
- `descending` (query, boolean, optional) — Sort direction: true for descending (newest/largest first), false for ascending

## Responses

### 200 — Successful Response

Schema: `TagGroupListResponse`

- `tag_groups` (array · TagGroupResponse) → `TagGroupResponse` — List of tag groups
  - `name` (string · required) — Name of the tag group
  - `description` (string) — Description of the tag group
  - `id` (string · required) — Unique identifier for the tag group
  - `tag_count` (integer) — Number of tags in this group
  - `created_at` (string · date-time · required) — Timestamp when the tag group was created
  - `updated_at` (string · date-time · required) — Timestamp when the tag group was last updated
- `count` (integer · required) — Total number of tag groups

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X GET 'https://api.ondayzero.com/api/v1/tag-groups' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/tag-groups', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

response = httpx.get("https://api.ondayzero.com/api/v1/tag-groups", headers=headers)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/tags/list-tag-groups
- OpenAPI slice: https://www.ondayzero.com/docs/reference/tags/list-tag-groups/openapi.json
- Other endpoints in **tags**: https://www.ondayzero.com/docs/reference/tags
