Skip to content

Lists ​

A list holds recipients. Campaigns reference an existing list or create one implicitly. See Lists & recipients for the field-schema model.

List all lists ​

GET/api/v1/lists
requires lists:read

Requires lists:read. Not paginated — it returns every list in the account, newest first, each with its recipient count.

bash
curl -H "x-api-key: drse_your_api_key" \
  https://api.utskick.dr.se/api/v1/lists
ts
const res = await fetch("https://api.utskick.dr.se/api/v1/lists", {
  headers: { "x-api-key": process.env.DRSE_API_KEY! },
});
const { data, meta } = await res.json();
console.log(`${meta.listCount} lists, ${meta.totalRecipientCount} recipients`);

200 OK

json
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Summer list",
      "createdAt": "2026-07-25T09:00:00.000Z",
      "updatedAt": "2026-07-25T09:30:00.000Z",
      "recipientCount": 250
    }
  ],
  "meta": { "totalRecipientCount": 250, "listCount": 1 }
}

Note the meta shape differs from the cursor-paginated endpoints: there are no cursors, because there are no pages.

FieldNotes
recipientCountLive count of recipients in this list
meta.totalRecipientCountRecipients across the whole account, not just these lists
meta.listCountNumber of lists returned

Failures ​

StatuscodeWhen
401unauthorizedKey problem
403forbiddenKey lacks lists:read

Create a list ​

POST/api/v1/lists
requires lists:create

Requires lists:create. Creates an empty list with an unlocked field schema.

Body ​

FieldTypeRequiredNotes
namestringyes1–200 characters
bash
curl -X POST https://api.utskick.dr.se/api/v1/lists \
  -H "x-api-key: drse_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Summer list" }'
ts
const res = await fetch("https://api.utskick.dr.se/api/v1/lists", {
  method: "POST",
  headers: {
    "x-api-key": process.env.DRSE_API_KEY!,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ name: "Summer list" }),
});
const { data } = await res.json();
console.log(data.id);

201 Created

json
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "name": "Summer list",
    "userId": "user_2abc",
    "schemaLockedAt": null,
    "lastActivityAt": "2026-07-25T09:00:00.000Z",
    "createdAt": "2026-07-25T09:00:00.000Z",
    "updatedAt": "2026-07-25T09:00:00.000Z"
  }
}
FieldNotes
userIdThe account owning the list. Returned but not useful to API consumers
schemaLockedAtnull until the first recipient is added, which locks the custom-field schema
lastActivityAtDrives retention: an untouched list is deleted after 90 days of inactivity

Failures ​

StatuscodeWhen
400validation_failedname empty or over 200 characters
401unauthorizedKey problem
403forbiddenKey lacks lists:create

Retrieve a list's field schema ​

GET/api/v1/lists/:listId/schema
requires lists:read

Requires lists:read. Tells you which custom fields this list accepts — call it before importing into an existing list so your column mapping matches.

bash
curl -H "x-api-key: drse_your_api_key" \
  https://api.utskick.dr.se/api/v1/lists/550e8400-e29b-41d4-a716-446655440001/schema
ts
const listId = "550e8400-e29b-41d4-a716-446655440001";
const res = await fetch(
  `https://api.utskick.dr.se/api/v1/lists/${listId}/schema`,
  { headers: { "x-api-key": process.env.DRSE_API_KEY! } },
);
const { data } = await res.json();
if (data.status === "locked") {
  console.log(data.fields.map((f) => f.fieldKey));
}

200 OK — an empty list whose schema has not been locked yet:

json
{ "data": { "status": "unlocked", "fields": [] } }

Once the first recipient has been added the schema is frozen:

json
{
  "data": {
    "status": "locked",
    "fields": [
      {
        "fieldKey": "vip",
        "fieldLabel": "VIP",
        "defaultValue": null,
        "missingBehavior": "skip"
      }
    ]
  }
}
FieldNotes
statusunlocked = no recipients yet, the first add defines the schema. locked = frozen; every later add must conform
fields[].fieldKeyAlphanumeric + underscore, ≤64 characters
fields[].defaultValueSubstituted when a row omits the field. null means no default
fields[].missingBehaviorskip = drop rows missing this field, fail = reject the import. Only consulted when defaultValue is null

Failures ​

StatuscodeWhen
400validation_failedlistId is not a UUID (List ID must be a valid UUID)
401unauthorizedKey problem
403forbiddenKey lacks lists:read
404not_foundList not found — unknown id, or a list in another account