Numberly
Lists

Create a list

This technical guide details the process of programmatically creating contact lists via the NMP API. Currently, the API supports the management of static lists.

Lifecycle and Statuses

List management relies on a strict lifecycle defined by the status field. This status determines the allowed actions on the resource:

  • draft: Default status upon creation.
    • Allowed actions: Complete modification of the structure (columns, primary key, contactability).
    • Forbidden actions: Importing members (operations).
  • published: Active status.
    • Allowed actions: Importing members via operations, usage in campaigns.
    • Forbidden actions: Modification of the data structure (columns, primary key, contactability).

Note: The list name (name) and its expiration date (expiration_date) remain modifiable via the PATCH endpoint, regardless of the status.

Prerequisites: Identifiers

To create a list, providing a group_id is mandatory.

If you do not have this identifier, retrieve the list of accessible groups via:

HTTP Request:

GET {subdomain}.api.numberly.com/v1/settings/groups?limit=20

List Creation

Initialization is done via a POST request. This is the critical step where you define the data schema (columns), deduplication rules (primary_key), and contactability rules.

Endpoint

POST {subdomain}.api.numberly.com/v1/lists

Payload Example (JSON)

This example configures a list containing an email and a first name, using the email as the unique identifier.

{
  "name": "API Client List 2024",
  "group_id": "5ef0cf15fac2a200016bcaaa",
  "status": "draft",
  "expiration_date": "2025-12-31",
  "primary_key": [
    "EMAIL"
  ],
  "columns": [
    {
      "name": "EMAIL",
      "type": "string",
      "required": true
    },
    {
      "name": "FIRSTNAME",
      "type": "string",
      "required": false
    }
  ],
  "contactability": [
    {
      "channel": "email",
      "column_name": "EMAIL"
    }
  ]
}

Configuration Parameters

FieldRequiredDescription
group_idYesIdentifier of the parent group.
nameYesList name (Max 255 characters).
columnsNo*Field definitions. Accepted types: int, float, string, date, datetime, boolean.
primary_keyNo*Array of column names used as a unique key (Composite key possible).
contactabilityNo*Mapping of channels (email, sms) to data columns.

*These fields are technically optional during creation in draft mode, but are mandatory to switch the list to published.

Finalization and Publication

Once the list is created, the API returns an object containing its id (e.g., c2feab59-d124-4b69-9d81-579a76603c7b). To start importing contacts into it, you must publish it.

Endpoint

PATCH {subdomain}.api.numberly.com/v1/lists/{id}

cURL Request

curl -X PATCH "https://{subdomain}.api.numberly.com/v1/lists/c2feab59-d124-4b69-9d81-579a76603c7b" \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "published"
}'

Validation Constraints

Switching to the published status will fail if the list is not valid. It must strictly contain:

  1. At least one contactability rule.
  2. A defined primary_key.
  3. Defined columns.

Security Warning: Once published, the primary_key, columns, and contactability fields become immutable. This restriction guarantees the integrity of imported data.

Next Steps

Once the list ID is obtained and the status set to published, you can proceed to populate the list:

  1. Import data: Use the POST {subdomain}.api.numberly.com/v1/lists/{id}/operations endpoint to send files or raw data (available actions: upsert, insert, replace, delete).
  2. Verify content: Use the GET {subdomain}.api.numberly.com/v1/lists/{id}/contacts endpoint to preview imported members.