# groups.member_events_list

Eventos recentes de entrada e saída de uma campanha. Eventos de participantes (entrou, saiu, promovido, rebaixado) do mais recente ao mais antigo; o participante vem mascarado com os 4 últimos dígitos. Paginação por `cursor` (id do último evento recebido).

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

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `campaignId` | string (uuid) | sim |  |
| `cursor` | integer | não |  |
| `limit` | integer | não | padrão 50 |

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

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "campaignId": {
      "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)$"
    },
    "cursor": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "limit": {
      "default": 50,
      "type": "integer",
      "minimum": 1,
      "maximum": 200
    }
  },
  "required": [
    "campaignId"
  ]
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/groups.member_events_list \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"campaignId":"00000000-0000-4000-8000-000000000001","limit":50}'
```

CLI:

```bash
node cli/atomiks.mjs groups.member_events_list --json '{"campaignId":"00000000-0000-4000-8000-000000000001","limit":50}'
```

MCP: ferramenta `groups_member_events_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": {
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "groupId": {
            "type": "string"
          },
          "participant": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "groupId",
          "participant",
          "action",
          "occurredAt",
          "source"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "number",
        "null"
      ]
    }
  },
  "required": [
    "events",
    "nextCursor"
  ],
  "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).
