Contacts: Lists

Create List

Create a list. Pick your own id so your code can refer to it, or let the server generate one.

POSThttps://g.sendcorex.com/v1/contactscommand: create_list
i

Needs the contact:create scope on your API key.

i

A list groups contacts for sending. The contact itself belongs to the account: adding it to a list does not copy it.

Arguments

  • list_idstringoptional

    Your own id: a-z, 0-9, _ and -, up to 40 characters. Generated when left out. An id that already exists fails with ALREADY_EXISTS.

    e.g. "customers"

  • namestringoptional

    Display name.

    e.g. "Customers"

  • descriptionstringoptional

    Free text shown with the list.

  • sourcestringoptional

    Where the contacts came from, for your reference.

    e.g. "checkout"

  • customobjectoptional

    Your own data, up to 50 keys.

    e.g. { "origin": "checkout", "year": 2026 }

Quick start

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
        }
      }
    }
  ]
}

Response fields

  • list_id

    The id you sent or the one generated.

  • status

    ready.

  • stats

    Counters, all 0 for a new list.

Next: fill it

Send list_id with Upsert Contacts to import straight into the list, or use Add To Lists for contacts you already have.

Errors

HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.

  • 401INVALID_API_KEY

    The API key does not exist, was revoked or was disabled in the dashboard.

  • 429RATE_LIMITED

    More than 15 requests/s or 15 in flight for the same IP + API key. Wait the number of seconds in Retry-After.

  • CMDMISSING_SCOPE

    The API key does not have the scope this command needs. The other commands in the request still run.

  • CMDINVALID_ARGS

    A required argument is missing or invalid: email, field value, enum option, where key, list id…

  • CMDALREADY_EXISTS

    create_list was called with a list_id that already exists.

  • CMDINTERNAL

    Server error. The detail is only written to the server log.