# Tags

> The labels your team puts on clients, to filter the client list by one.

Source: https://hubfit.com/developers/api/tags


Labels coaches put on clients to group them. Each client lists its tags; filter clients by one with `tagId`.

Endpoints:

- `GET /v1/tags`: [List tags](https://hubfit.com/developers/api/tags#list-tags)

## Tag object

### Attributes

- `id` (string): Its unique ID.
- `name` (string)

### Example

```json
{
  "id": "6ad6afe58cebe1e48cea4ee3",
  "name": "Online coaching"
}
```

## List tags

`GET https://api.hubfit.com/v1/tags`

Every tag in the workspace, alphabetically. A workspace adds no more than 15 (`MAX_TAGS_PER_WORKSPACE`), so they all come in one response, without paging. Requires `clients:read`.

### Returns

Every tag in the workspace.

### Example request

cURL:

```bash
curl https://api.hubfit.com/v1/tags \
  -H "Authorization: Bearer $HUBFIT_API_KEY"
```

Node.js:

```javascript
const response = await fetch("https://api.hubfit.com/v1/tags", {
  headers: {
    Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
  },
});

const { data } = await response.json();
```

Python:

```python
import os
import requests

response = requests.get(
    "https://api.hubfit.com/v1/tags",
    headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)

data = response.json()["data"]
```

### Example response (200 OK)

```json
{
  "data": [
    {
      "id": "6ad6afe58cebe1e48cea4ee3",
      "name": "Online coaching"
    }
  ]
}
```
