# activities_board.calendar

Atividades do calendário por dia. Atividades com prazo entre `startDate` e `endDate`, agrupadas por dia no fuso `timeZone` (IANA; o do navegador). Cada dia traz até `perDay` itens (12) e `total` com todos, para o "+ N mais".

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

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `types` | "call" \| "whatsapp" \| "meeting" \| "task" \| "appointment"[] | não |  |
| `pipelineIds` | string (uuid)[] | não |  |
| `overdue` | boolean | não |  |
| `overdueBefore` | string (date-time) | não |  |
| `allDayStart` | string (date-time) | não |  |
| `conditions` | object[] | não |  |
| `search` | string | não |  |
| `startDate` | string (date-time) | não |  |
| `endDate` | string (date-time) | não |  |
| `withoutDeadline` | boolean | não |  |
| `timeZone` | string | não |  |
| `perDay` | integer | não |  |

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

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "types": {
      "maxItems": 5,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "call",
          "whatsapp",
          "meeting",
          "task",
          "appointment"
        ]
      }
    },
    "pipelineIds": {
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
      }
    },
    "overdue": {
      "type": "boolean"
    },
    "overdueBefore": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "allDayStart": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "conditions": {
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "matcher": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          },
          "connector": {
            "type": "string",
            "enum": [
              "and",
              "or"
            ]
          },
          "conditions": {
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "maxLength": 40
                },
                "operator": {
                  "type": "string",
                  "maxLength": 30
                },
                "value": {
                  "maxItems": 100,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              },
              "required": [
                "field",
                "operator",
                "value"
              ]
            }
          }
        },
        "required": [
          "matcher",
          "conditions"
        ]
      }
    },
    "search": {
      "type": "string",
      "maxLength": 120
    },
    "startDate": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "endDate": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "withoutDeadline": {
      "type": "boolean"
    },
    "timeZone": {
      "type": "string",
      "maxLength": 64
    },
    "perDay": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    }
  }
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/activities_board.calendar \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"startDate":"2026-10-01T00:00:00.000Z","endDate":"2026-10-31T23:59:59.999Z"}'
```

CLI:

```bash
node cli/atomiks.mjs activities_board.calendar --json '{"startDate":"2026-10-01T00:00:00.000Z","endDate":"2026-10-31T23:59:59.999Z"}'
```

MCP: ferramenta `activities_board_calendar` 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": {
    "days": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "total": {
            "type": "number"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "task",
                    "appointment"
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "call",
                    "whatsapp",
                    "meeting",
                    "task",
                    "appointment"
                  ]
                },
                "title": {
                  "type": "string"
                },
                "startAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "endAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "allDay": {
                  "type": "boolean"
                },
                "durationMinutes": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "scheduled",
                    "resolved",
                    "cancelled",
                    "completed"
                  ]
                },
                "contactName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "contactEmail": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "contactPhone": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "leadId": {
                  "type": "string"
                },
                "opportunityCardId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "opportunityCardTitle": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "opportunityPipelineId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "opportunityPipelineName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "notes": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "meetingLink": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "guests": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "attendantId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "attendantName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "outcome": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "outcomeNote": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "priority": {
                  "type": "string",
                  "enum": [
                    "urgent",
                    "high",
                    "medium",
                    "low",
                    "none"
                  ]
                },
                "conversationId": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "type",
                "title",
                "startAt",
                "endAt",
                "allDay",
                "durationMinutes",
                "status",
                "contactName",
                "contactEmail",
                "contactPhone",
                "leadId",
                "opportunityCardId",
                "opportunityCardTitle",
                "opportunityPipelineId",
                "opportunityPipelineName",
                "notes",
                "meetingLink",
                "guests",
                "attendantId",
                "attendantName",
                "outcome",
                "outcomeNote",
                "priority",
                "conversationId"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "date",
          "total",
          "items"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "days"
  ],
  "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).
