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

Contacten: lijsten

# Lijst aanmaken

Maak een lijst aan. Kies een eigen id zodat je code ernaar kan verwijzen, of laat de server er een maken.

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

Vereist de scope `contact:create` op je API key.

Een lijst groepeert contacten voor verzending. Het contact zelf hoort bij het account: toevoegen aan een lijst kopieert het niet.

## Argumenten

- `list_id` string optioneel
Je eigen id: `a-z`, `0-9`, `_` en `-`, tot 40 tekens. Wordt gemaakt als je het weglaat. Een id dat al bestaat faalt met `ALREADY_EXISTS`.
bijv. `"customers"`
- `name` string optioneel
Weergavenaam.
bijv. `"Customers"`
- `description` string optioneel
Vrije tekst die bij de lijst wordt getoond.
- `source` string optioneel
Waar de contacten vandaan kwamen, ter referentie.
bijv. `"checkout"`
- `custom` object optioneel
Je eigen data, tot 50 sleutels.
bijv. `{ "origin": "checkout", "year": 2026 }`

## Snel starten

```
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);
```

## Response

```
{
  "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
        }
      }
    }
  ]
}
```

### Responsevelden

- `list_id`
Het id dat je stuurde of het gemaakte id.
- `status`
`ready`.
- `stats`
Tellers, allemaal `0` bij een nieuwe lijst.

## Volgende stap: vul hem

Stuur `list_id` mee met Upsert Contacts om direct in de lijst te importeren, of gebruik Add To Lists voor contacten die je al hebt.

## Fouten

Fouten op HTTP-niveau geven `type`, `code` en `message` terug. Fouten met CMD komen terug in het resultaat van de opdracht, met HTTP 200.

- 401`INVALID_API_KEY`
De API key bestaat niet, is ingetrokken of is uitgeschakeld in het dashboard.
- 429`RATE_LIMITED`
Meer dan 15 requests/s of 15 tegelijk voor hetzelfde IP + API key. Wacht het aantal seconden uit Retry-After.
- CMD`MISSING_SCOPE`
De API key heeft niet de scope die deze opdracht nodig heeft. De andere opdrachten in het request draaien gewoon.
- CMD`INVALID_ARGS`
Een verplicht argument ontbreekt of is ongeldig: e-mailadres, veldwaarde, enum-optie, where-sleutel, lijst-id…
- CMD`ALREADY_EXISTS`
create_list werd aangeroepen met een list_id dat al bestaat.
- CMD`INTERNAL`
Serverfout. Het detail wordt alleen in het serverlog geschreven.
