# segmentation.tags_overview

Minhas tags com uso. Aba "Minhas tags": cada tag com cor (hexadecimal sem "#"), contatos, oportunidades, automações e segmentos que a usam, formulários e quadros (sempre 0, não existem aqui) e data de criação. `q` filtra pelo nome; `orderBy` e `order` ordenam (padrão nome, crescente). 10 por página.

- Endpoint: `POST https://app.atomiks.com.br/api/v1/segmentation.tags_overview` (corpo JSON)
- Quem pode chamar: membro da conta
- Escopo da chave: `crm:read`
- Grava dados: não
- Pela chave de API: sim
- Ferramenta MCP: `segmentation_tags_overview`
- Ficha em JSON: `https://app.atomiks.com.br/api/v1/openapi.json` (operationId `segmentation.tags_overview`)

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `q` | string | não |  |
| `orderBy` | "name" \| "leadsCount" \| "opportunitiesCount" \| "flowsCount" \| "segmentsCount" \| "formsCount" \| "boardsCount" \| "createdAt" | não |  |
| `order` | "asc" \| "desc" | não |  |
| `page` | integer | não |  |
| `perPage` | integer | não |  |

<details><summary>JSON Schema</summary>

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "q": {
      "type": "string",
      "maxLength": 40
    },
    "orderBy": {
      "type": "string",
      "enum": [
        "name",
        "leadsCount",
        "opportunitiesCount",
        "flowsCount",
        "segmentsCount",
        "formsCount",
        "boardsCount",
        "createdAt"
      ]
    },
    "order": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ]
    },
    "page": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000
    },
    "perPage": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    }
  }
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/segmentation.tags_overview \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"orderBy":"leadsCount","order":"desc"}'
```

CLI:

```bash
node cli/atomiks.mjs segmentation.tags_overview --json '{"orderBy":"leadsCount","order":"desc"}'
```

MCP: ferramenta `segmentation_tags_overview` com a mesma entrada.

## Saída

Sucesso: `{"data": ...}` com o formato abaixo.

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "leadsCount": {
            "type": "number"
          },
          "opportunitiesCount": {
            "type": "number"
          },
          "flowsCount": {
            "type": "number"
          },
          "segmentsCount": {
            "type": "number"
          },
          "formsCount": {
            "type": "number"
          },
          "boardsCount": {
            "type": "number"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "color",
          "leadsCount",
          "opportunitiesCount",
          "flowsCount",
          "segmentsCount",
          "formsCount",
          "boardsCount",
          "createdAt"
        ],
        "additionalProperties": false
      }
    },
    "total": {
      "type": "number"
    },
    "countPages": {
      "type": "number"
    }
  },
  "required": [
    "items",
    "total",
    "countPages"
  ],
  "additionalProperties": false
}
```

## Erros

`{"error": {"code", "message", "requestId"}}`. Códigos: `invalid_input` (400), `unauthorized` (401), `forbidden` / `account_pending` / `scope_missing` (403), `not_found` (404), `limit_reached` (409), `internal` (500).
