# channels.evolution_privacy_update

Mudar a privacidade do WhatsApp de um número por QR. Muda um ou mais campos de privacidade (mesmos nomes e valores de `channels.evolution_privacy_get`). O WhatsApp pede o conjunto todo: o Atomiks lê o atual, troca só o que veio e grava. Devolve o conjunto novo.

- Endpoint: `POST https://app.atomiks.com.br/api/v1/channels.evolution_privacy_update` (corpo JSON)
- Quem pode chamar: administrador da conta
- Escopo da chave: `channels:write`
- Grava dados: sim
- Pela chave de API: sim
- Ferramenta MCP: `channels_evolution_privacy_update`
- Ficha em JSON: `https://app.atomiks.com.br/api/v1/openapi.json` (operationId `channels.evolution_privacy_update`)

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `channelId` | string (uuid) | sim |  |
| `readreceipts` | "all" \| "none" | não |  |
| `profile` | "all" \| "contacts" \| "contact_blacklist" \| "none" \| "match_last_seen" | não |  |
| `status` | "all" \| "contacts" \| "contact_blacklist" \| "none" \| "match_last_seen" | não |  |
| `online` | "all" \| "match_last_seen" | não |  |
| `last` | "all" \| "contacts" \| "contact_blacklist" \| "none" \| "match_last_seen" | não |  |
| `groupadd` | "all" \| "contacts" \| "contact_blacklist" \| "none" \| "match_last_seen" | não |  |

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

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "channelId": {
      "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)$"
    },
    "readreceipts": {
      "type": "string",
      "enum": [
        "all",
        "none"
      ]
    },
    "profile": {
      "type": "string",
      "enum": [
        "all",
        "contacts",
        "contact_blacklist",
        "none",
        "match_last_seen"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "all",
        "contacts",
        "contact_blacklist",
        "none",
        "match_last_seen"
      ]
    },
    "online": {
      "type": "string",
      "enum": [
        "all",
        "match_last_seen"
      ]
    },
    "last": {
      "type": "string",
      "enum": [
        "all",
        "contacts",
        "contact_blacklist",
        "none",
        "match_last_seen"
      ]
    },
    "groupadd": {
      "type": "string",
      "enum": [
        "all",
        "contacts",
        "contact_blacklist",
        "none",
        "match_last_seen"
      ]
    }
  },
  "required": [
    "channelId"
  ]
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/channels.evolution_privacy_update \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"channelId":"00000000-0000-0000-0000-000000000000","last":"contacts"}'
```

CLI:

```bash
node cli/atomiks.mjs channels.evolution_privacy_update --json '{"channelId":"00000000-0000-0000-0000-000000000000","last":"contacts"}'
```

MCP: ferramenta `channels_evolution_privacy_update` 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": {
    "readreceipts": {
      "type": [
        "string",
        "null"
      ]
    },
    "profile": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": [
        "string",
        "null"
      ]
    },
    "online": {
      "type": [
        "string",
        "null"
      ]
    },
    "last": {
      "type": [
        "string",
        "null"
      ]
    },
    "groupadd": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "readreceipts",
    "profile",
    "status",
    "online",
    "last",
    "groupadd"
  ],
  "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).
