---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/it/api-reference/logs/reading/list-scheduled

Log: Lettura

# List Scheduled

Le email programmate tramite la Email API (`scheduledAt`) o una campagna che non sono ancora partite. La prossima in uscita viene per prima.

POST `https://g.sendcorex.com/v1/logs` command: list_scheduled

Richiede lo scope `logs:read` sulla tua API key.

Una volta inviata, un'email compare in List Logs; una volta annullata, esce da questa lista. I messaggi programmati del webmail non sono elencati qui: restano nella cartella Scheduled della casella.

Quando `scheduled_at` è già nel passato, l'email è in fase di invio proprio ora e passerà in List Logs entro pochi secondi.

## Argomenti

- `limit` number facoltativo
Quante email per pagina, da 1 a 50. Predefinito 50.
es. `50`
- `cursor` string facoltativo
Il `next_cursor` della pagina precedente.

## Avvio rapido

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/logs',
  {
    commands: [
      {
        command: "list_scheduled",
        args: {
          limit: 50
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);
```

## Risposta

```
{
  "type": "SUCCESS",
  "results": [
    {
      "command": "list_scheduled",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 18,
      "data": {
        "scheduled": [
          {
            "id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f",
            "from": "news@yourdomain.com",
            "to": "ana@acme.com",
            "subject": "Your order shipped",
            "scheduled_at": "2026-12-01T09:00:00.000Z",
            "source": "api",
            "created_at": "2026-11-28T03:10:00.000Z"
          },
          {
            "id": "9b7e2c1a-4d5f-4e6a-8b9c-0d1e2f3a4b5c",
            "from": "hello@yourdomain.com",
            "to": "bruno@acme.com",
            "subject": "December news",
            "scheduled_at": "2026-12-02T14:30:00.000Z",
            "source": "campaign",
            "campaign_id": "c_4f2a91",
            "created_at": "2026-11-27T18:00:00.000Z"
          }
        ],
        "count": 2,
        "has_more": true,
        "next_cursor": "MDAwMDAwMDA4MzowOjgyMzkzMTU5OTg3OTU6M2YyYTFi"
      }
    }
  ]
}
```

### Campi della risposta

- `scheduled`
Le email programmate di questa pagina, la prossima in uscita per prima.
- `count`
Quante email ci sono in questa pagina.
- `has_more / next_cursor`
Finché `has_more` è `true`, invia `next_cursor` come `cursor` per ottenere la pagina successiva. Non c'è un conteggio totale.
- `scheduled[].id`
L'ID dell'email, lo stesso `id` che hai ricevuto all'invio.
- `scheduled[].from / scheduled[].to`
Indirizzi del mittente e del destinatario.
- `scheduled[].subject`
L'oggetto dell'email.
- `scheduled[].scheduled_at`
Quando parte l'email (ISO 8601, UTC).
- `scheduled[].source / scheduled[].campaign_id`
`api` per la Email API, `campaign` per una campagna. Con `campaign`, `campaign_id` è compilato.
- `scheduled[].created_at`
Quando è stata programmata l'email (ISO 8601, UTC).

## Leggere tutte le pagine

Continua a chiamare con `next_cursor` finché `has_more` è `false`.

Node.js

```
const scheduled = [];
let cursor;

do {
  const [result] = await call({
    command: 'list_scheduled',
    args: { limit: 50, ...(cursor ? { cursor } : {}) },
  });
  scheduled.push(...result.data.scheduled);
  cursor = result.data.has_more ? result.data.next_cursor : null;
} while (cursor);
```

## Errori

Gli errori a livello HTTP restituiscono `type`, `code` e `message`. Gli errori marcati CMD tornano dentro il risultato del comando, con HTTP 200.

- 401`INVALID_API_KEY`
La API key non esiste, è stata revocata o disattivata nella dashboard.
- 429`RATE_LIMITED`
Più di 15 richieste/s o 15 in corso per la stessa IP + API key. Attendi i secondi indicati in Retry-After.
- CMD`MISSING_SCOPE`
La API key non ha `logs:read`.
- CMD`INVALID_ARGS`
Un argomento non è valido: stato sconosciuto, destinatario che non è un'email completa, limit fuori intervallo, id che non è un UUID, after successivo a before…
- CMD`INVALID_CURSOR`
Il cursore non è valido, oppure proviene da un'altra ricerca o da un altro account. Ricomincia senza cursore.
- CMD`INTERNAL`
Errore del server. Il dettaglio viene scritto solo nel log del server.
