# GET /api/v1/tags

> List tags

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

## Description

Retrieve all tags for the current business, optionally filtered by tag group or fuzzy name search

## Authentication

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

## Parameters

- `tag_group_id` (query, string, optional) — Filter tags by tag group ID
- `search` (query, string, optional) — Fuzzy search tags by name (trigram similarity)
- `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: `TagListResponse`

- `tags` (array · TagResponse) → `TagResponse` — List of tags
  - `name` (string · required) — Name of the tag
  - `description` (string) — Description of the tag
  - `id` (string · required) — Unique identifier for the tag
  - `tag_group_id` (string) — Tag group this tag belongs to
  - `tag_group_name` (string) — Name of the tag group (if any)
  - `usage_count` (integer) — Number of entities using this tag
  - `created_at` (string · date-time · required) — Timestamp when the tag was created
  - `updated_at` (string · date-time · required) — Timestamp when the tag was last updated
- `count` (integer · required) — Total number of tags

### 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/tags' \
  -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/tags', {
  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/tags", headers=headers)
data = response.json()
```

## See also

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