# POST /api/v1/tag-groups

> Create tag group

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

## Description

Create a new tag group for organizing tags

## Authentication

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

## Request body

Schema: `TagGroupCreate`

- `name` (string · required) — Name of the tag group
- `description` (string) — Description of the tag group

## Responses

### 201 — Successful Response

Schema: `TagGroupResponse`

- `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

### 400 — Bad Request - Invalid input

### 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 POST 'https://api.ondayzero.com/api/v1/tag-groups' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/tag-groups', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "name": "string"
}

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

## See also

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