# admin.requests.list

Chamadas de operação (todas as contas). Toda chamada de operação, leitura inclusive, sem a entrada: quem, por qual canal, status, erro e duração. Mais recentes primeiro; `errorsOnly` mostra só status 400 ou mais; filtros por canal (`via`) e período. Use `before` para a página seguinte; até 200 por página.

- Endpoint: `POST https://app.atomiks.com.br/api/v1/admin.requests.list` (corpo JSON)
- Quem pode chamar: super-admin da plataforma
- Escopo da chave: `admin:read`
- Grava dados: não
- Pela chave de API: sim
- Ferramenta MCP: `admin_requests_list`
- Ficha em JSON: `https://app.atomiks.com.br/api/v1/openapi.json` (operationId `admin.requests.list`)

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `accountId` | string (uuid) | não |  |
| `userId` | string (uuid) | não |  |
| `op` | string | não |  |
| `errorsOnly` | boolean | não |  |
| `includeAdminReads` | boolean | não |  |
| `via` | "ui" \| "api" \| "mcp" \| "atom" \| "flow" \| "system"[] | não |  |
| `from` | string (date-time) | não |  |
| `to` | string (date-time) | não |  |
| `before` | integer | não |  |
| `limit` | integer | não | padrão 50 |
| `includeTest` | boolean | não |  |

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

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "accountId": {
      "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)$"
    },
    "userId": {
      "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)$"
    },
    "op": {
      "type": "string",
      "maxLength": 80
    },
    "errorsOnly": {
      "type": "boolean"
    },
    "includeAdminReads": {
      "type": "boolean"
    },
    "via": {
      "maxItems": 6,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "ui",
          "api",
          "mcp",
          "atom",
          "flow",
          "system"
        ]
      }
    },
    "from": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "to": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "before": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "limit": {
      "default": 50,
      "type": "integer",
      "minimum": 1,
      "maximum": 200
    },
    "includeTest": {
      "type": "boolean"
    }
  }
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/admin.requests.list \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"errorsOnly":true,"limit":50}'
```

CLI:

```bash
node cli/atomiks.mjs admin.requests.list --json '{"errorsOnly":true,"limit":50}'
```

MCP: ferramenta `admin_requests_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": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "ts": {
            "type": "string"
          },
          "accountId": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountName": {
            "type": [
              "string",
              "null"
            ]
          },
          "actorName": {
            "type": "string"
          },
          "via": {
            "type": "string",
            "enum": [
              "ui",
              "api",
              "mcp",
              "atom",
              "flow",
              "system"
            ]
          },
          "op": {
            "type": "string"
          },
          "opLabel": {
            "type": "string"
          },
          "mutates": {
            "type": "boolean"
          },
          "status": {
            "type": "number"
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "errorMessage": {
            "type": [
              "string",
              "null"
            ]
          },
          "durationMs": {
            "type": "number"
          },
          "ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "ts",
          "accountId",
          "accountName",
          "actorName",
          "via",
          "op",
          "opLabel",
          "mutates",
          "status",
          "errorCode",
          "errorMessage",
          "durationMs",
          "ip",
          "requestId"
        ],
        "additionalProperties": false
      }
    },
    "nextBefore": {
      "type": [
        "number",
        "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).
