---
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/contacts/lists/create-list

Contatti: liste

# Crea lista

Crea una lista. Scegli un tuo id così il codice può riferirsi a essa, o lascia che il server ne generi uno.

POST `https://g.sendcorex.com/v1/contacts` command: create_list

Richiede lo scope `contact:create` sulla tua API key.

Una lista raggruppa contatti per l'invio. Il contatto appartiene all'account: aggiungerlo a una lista non lo copia.

## Argomenti

- `list_id` string facoltativo
Il tuo id: `a-z`, `0-9`, `_` e `-`, fino a 40 caratteri. Generato se omesso. Un id già esistente fallisce con `ALREADY_EXISTS`.
es. `"customers"`
- `name` string facoltativo
Nome visualizzato.
es. `"Customers"`
- `description` string facoltativo
Testo libero mostrato con la lista.
- `source` string facoltativo
Da dove arrivano i contatti, come promemoria.
es. `"checkout"`
- `custom` object facoltativo
I tuoi dati, fino a 50 chiavi.
es. `{ "origin": "checkout", "year": 2026 }`

## Avvio rapido

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/contacts',
  {
    commands: [
      {
        command: "create_list",
        args: {
          list_id: "customers",
          name: "Customers",
          description: "Everyone who bought at least once",
          source: "checkout",
          custom: {
            origin: "checkout",
            year: 2026
          }
        }
      }
    ]
  },
  { 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": "create_list",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 14,
      "data": {
        "list_id": "customers",
        "name": "Customers",
        "description": "Everyone who bought at least once",
        "source": "checkout",
        "status": "ready",
        "custom": {
          "origin": "checkout",
          "year": 2026
        },
        "created_at": "2026-10-01T10:00:00.000Z",
        "updated_at": "2026-10-12T15:22:41.000Z",
        "stats": {
          "total": 0,
          "ok": 0,
          "opened": 0,
          "clicked": 0
        }
      }
    }
  ]
}
```

### Campi della risposta

- `list_id`
L'id inviato o quello generato.
- `status`
`ready`.
- `stats`
Contatori, tutti `0` per una lista nuova.

## Poi: riempila

Invia `list_id` con Upsert Contacts per importare direttamente nella lista, o usa Add To Lists per i contatti che hai già.

## 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 lo scope richiesto da questo comando. Gli altri comandi della richiesta vengono comunque eseguiti.
- CMD`INVALID_ARGS`
Un argomento obbligatorio manca o non è valido: email, valore di campo, opzione enum, chiave del where, id della lista…
- CMD`ALREADY_EXISTS`
create_list è stato chiamato con un list_id già esistente.
- CMD`INTERNAL`
Errore del server. Il dettaglio viene scritto solo nel log del server.
