# integrations.deliveries

Entregas de saída. Últimas 100 entregas de uma integração de saída. `before` pagina por data de criação.

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

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `integrationId` | string (uuid) | sim |  |
| `before` | string | não | Cursor: `nextBefore` da página anterior (data ISO). |

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

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "integrationId": {
      "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)$"
    },
    "before": {
      "description": "Cursor: `nextBefore` da página anterior (data ISO).",
      "type": "string"
    }
  },
  "required": [
    "integrationId"
  ]
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/integrations.deliveries \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"integrationId":"00000000-0000-0000-0000-000000000000"}'
```

CLI:

```bash
node cli/atomiks.mjs integrations.deliveries --json '{"integrationId":"00000000-0000-0000-0000-000000000000"}'
```

MCP: ferramenta `integrations_deliveries` 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": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "eventName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "sent",
              "failed"
            ]
          },
          "attempts": {
            "type": "number"
          },
          "responseStatus": {
            "type": [
              "number",
              "null"
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "eventName",
          "status",
          "attempts",
          "responseStatus",
          "lastError",
          "createdAt",
          "sentAt"
        ],
        "additionalProperties": false
      }
    },
    "nextBefore": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "items",
    "nextBefore"
  ],
  "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).
