Contacts: Lists
Create List
Create a list. Pick your own id so your code can refer to it, or let the server generate one.
https://g.sendcorex.com/v1/contactscommand: create_listNeeds the contact:create scope on your API key.
A list groups contacts for sending. The contact itself belongs to the account: adding it to a list does not copy it.
Arguments
list_idstringoptionalYour own id:
a-z,0-9,_and-, up to 40 characters. Generated when left out. An id that already exists fails withALREADY_EXISTS.e.g.
"customers"namestringoptionalDisplay name.
e.g.
"Customers"descriptionstringoptionalFree text shown with the list.
sourcestringoptionalWhere the contacts came from, for your reference.
e.g.
"checkout"customobjectoptionalYour 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_idThe id you sent or the one generated.
statusready.statsCounters, all
0for 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.
- 401
INVALID_API_KEYThe API key does not exist, was revoked or was disabled in the dashboard.
- 429
RATE_LIMITEDMore than 15 requests/s or 15 in flight for the same IP + API key. Wait the number of seconds in Retry-After.
- CMD
MISSING_SCOPEThe API key does not have the scope this command needs. The other commands in the request still run.
- CMD
INVALID_ARGSA required argument is missing or invalid: email, field value, enum option, where key, list id…
- CMD
ALREADY_EXISTScreate_list was called with a list_id that already exists.
- CMD
INTERNALServer error. The detail is only written to the server log.