# teams.list

Listar times. Times de distribuição da conta, do mais antigo ao mais novo, cada um com nome, slug, descrição, ícone (`emoji`, nome do ícone), cor da marca (`color`, o mesmo valor de `brandColor`), logo, modo de distribuição e quantos membros tem (`memberCount`, o mesmo valor de `totalMembers`), com a contagem por tipo de atendente (`memberTypeCounts`; `attendantTypeId` nulo = sem tipo). `appointmentSchedules` traz as agendas do time (mesmo formato de `scheduling.schedules_list`; vazio sem a migration de agendas). Sem a migration de times, a lista vem vazia.

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

## Entrada

Sem campos: envie `{}`.

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

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {}
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/teams.list \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

CLI:

```bash
node cli/atomiks.mjs teams.list --json '{}'
```

MCP: ferramenta `teams_list` 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"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "emoji": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "brandColor": {
            "type": [
              "string",
              "null"
            ]
          },
          "logoUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "memberCount": {
            "type": "number"
          },
          "totalMembers": {
            "type": "number"
          },
          "memberTypeCounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "attendantTypeId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "emoji": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "count": {
                  "type": "number"
                }
              },
              "required": [
                "attendantTypeId",
                "name",
                "color",
                "emoji",
                "count"
              ],
              "additionalProperties": false
            }
          },
          "appointmentSchedules": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "distributionMode": {
            "type": "string",
            "enum": [
              "weighted",
              "strict"
            ]
          },
          "strictRespectCaps": {
            "type": "boolean"
          },
          "queueCursorMemberId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "description",
          "emoji",
          "color",
          "brandColor",
          "logoUrl",
          "memberCount",
          "totalMembers",
          "memberTypeCounts",
          "appointmentSchedules",
          "distributionMode",
          "strictRespectCaps",
          "queueCursorMemberId",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "items"
  ],
  "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).
