# inbox.prefs_update

Alterar minhas preferências de aviso. Altera som, escopo, avisos (app e push) e presença do próprio usuário. Campos omitidos não mudam.

- Endpoint: `POST https://app.atomiks.com.br/api/v1/inbox.prefs_update` (corpo JSON)
- Quem pode chamar: qualquer usuário autenticado
- Escopo da chave: `messages:read`
- Grava dados: sim
- Pela chave de API: sim
- Ferramenta MCP: `inbox_prefs_update`
- Ficha em JSON: `https://app.atomiks.com.br/api/v1/openapi.json` (operationId `inbox.prefs_update`)

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `sound` | boolean | não |  |
| `notifyScope` | "all" \| "mine_free" \| "mine" | não |  |
| `inApp` | boolean | não |  |
| `notifyAssigned` | boolean | não |  |
| `notifyDisconnected` | boolean | não |  |
| `pushNewMessage` | boolean | não |  |
| `pushAssigned` | boolean | não |  |
| `pushDisconnected` | boolean | não |  |
| `online` | boolean | não |  |
| `allInApp` | boolean | não |  |
| `allPush` | boolean | não |  |
| `notifyTaskAssigned` | boolean | não |  |
| `pushTaskAssigned` | boolean | não |  |

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

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "sound": {
      "type": "boolean"
    },
    "notifyScope": {
      "type": "string",
      "enum": [
        "all",
        "mine_free",
        "mine"
      ]
    },
    "inApp": {
      "type": "boolean"
    },
    "notifyAssigned": {
      "type": "boolean"
    },
    "notifyDisconnected": {
      "type": "boolean"
    },
    "pushNewMessage": {
      "type": "boolean"
    },
    "pushAssigned": {
      "type": "boolean"
    },
    "pushDisconnected": {
      "type": "boolean"
    },
    "online": {
      "type": "boolean"
    },
    "allInApp": {
      "type": "boolean"
    },
    "allPush": {
      "type": "boolean"
    },
    "notifyTaskAssigned": {
      "type": "boolean"
    },
    "pushTaskAssigned": {
      "type": "boolean"
    }
  }
}
```

</details>

## Exemplo

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

CLI:

```bash
node cli/atomiks.mjs inbox.prefs_update --json '{"notifyScope":"mine"}'
```

MCP: ferramenta `inbox_prefs_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": {
    "sound": {
      "type": "boolean"
    },
    "notifyScope": {
      "type": "string",
      "enum": [
        "all",
        "mine_free",
        "mine"
      ]
    },
    "inApp": {
      "type": "boolean"
    },
    "notifyAssigned": {
      "type": "boolean"
    },
    "notifyDisconnected": {
      "type": "boolean"
    },
    "pushNewMessage": {
      "type": "boolean"
    },
    "pushAssigned": {
      "type": "boolean"
    },
    "pushDisconnected": {
      "type": "boolean"
    },
    "online": {
      "type": "boolean"
    },
    "allInApp": {
      "type": "boolean"
    },
    "allPush": {
      "type": "boolean"
    },
    "notifyTaskAssigned": {
      "type": "boolean"
    },
    "pushTaskAssigned": {
      "type": "boolean"
    }
  },
  "required": [
    "sound",
    "notifyScope",
    "inApp",
    "notifyAssigned",
    "notifyDisconnected",
    "pushNewMessage",
    "pushAssigned",
    "pushDisconnected",
    "online",
    "allInApp",
    "allPush",
    "notifyTaskAssigned",
    "pushTaskAssigned"
  ],
  "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).
