Create a list
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 thePATCHendpoint, 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
| Field | Required | Description |
|---|---|---|
group_id | Yes | Identifier of the parent group. |
name | Yes | List name (Max 255 characters). |
columns | No* | Field definitions. Accepted types: int, float, string, date, datetime, boolean. |
primary_key | No* | Array of column names used as a unique key (Composite key possible). |
contactability | No* | 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:
- At least one contactability rule.
- A defined primary_key.
- Defined columns.
Security Warning: Once published, the
primary_key,columns, andcontactabilityfields 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:
- Import data: Use the
POST {subdomain}.api.numberly.com/v1/lists/{id}/operationsendpoint to send files or raw data (available actions:upsert,insert,replace,delete). - Verify content: Use the
GET {subdomain}.api.numberly.com/v1/lists/{id}/contactsendpoint to preview imported members.
Retrieve Statistics
This endpoint retrieves the statistics for a campaign based on its ID. Each value is a raw volume, aggregated across all send orders attached to the campaign.
Populate a list
Once a list is created and published, its content is managed via operations. This asynchronous mechanism allows you to add, update, or delete contacts in bulk or individually via the API.