# email_inbox.preview

Prévia de um e-mail com a assinatura. Monta o HTML do e-mail como sairá: o `text` (aceita *negrito*, _itálico_, listas com "- " e links) seguido da assinatura da caixa. `signatureText` e `signatureLogoUrl` (https) testam uma assinatura ainda não salva; `null` tira a da caixa. Todo o HTML vem escapado.

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

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `id` | string (uuid) | sim |  |
| `text` | string | sim |  |
| `signatureText` | string \| null | não |  |
| `signatureLogoUrl` | string \| null | não |  |

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

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "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)$"
    },
    "text": {
      "type": "string",
      "maxLength": 20000
    },
    "signatureText": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ]
    },
    "signatureLogoUrl": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2048
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "text"
  ]
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/email_inbox.preview \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"00000000-0000-0000-0000-000000000000","text":"Olá! Segue a resposta que você pediu."}'
```

CLI:

```bash
node cli/atomiks.mjs email_inbox.preview --json '{"id":"00000000-0000-0000-0000-000000000000","text":"Olá! Segue a resposta que você pediu."}'
```

MCP: ferramenta `email_inbox_preview` 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": {
    "html": {
      "type": "string"
    }
  },
  "required": [
    "html"
  ],
  "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).
