Skip to content
Contact lists

Contact lists

By Loïc Bresler 7 min read

These methods manage the contact lists stored on the platform, for your account or for your sub-accounts. To load contacts directly into a campaign without going through a list, see Campaign recipients.

They are all called with POST, with a JSON body that contains your api_key. Parameter tables do not repeat it. See the common rules.

List an account’s lists

Access point: https://www.mdworks.fr/api_http/list_list

This method returns the contact lists of an account or a sub-account.

Parameters:

ParameterTypeRequiredDescription
user_idintegernoID of the account whose lists you want (see user_list). If missing, the main account’s lists are returned

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "user_id": "4781"
}

Response: an array of objects.

FieldDescription
idunique ID of the list
nomname of the list
field_emailfield that holds the email address
field_smsfield that holds the mobile phone number, empty if none
total_lignesnumber of contacts in the list
[
  {
    "id": "254698",
    "nom": "BASE_TEST_EDIWARE",
    "field_email": "EMAIL",
    "field_sms": "",
    "total_lignes": "100868"
  },
  {
    "id": "125478",
    "nom": "My new list",
    "field_email": "EMAIL",
    "field_sms": "",
    "total_lignes": "254"
  }
]

Errors:

MessageCause
Problem with this userthe sub-account does not exist or does not belong to your account

Read a list’s fields

Access point: https://www.mdworks.fr/api_http/list_fields

This method returns the fields of a contact list. Use it to match your data to the list’s fields before a list_insert or a list_insert_or_update. The list can belong to your account or to one of your sub-accounts.

Parameters:

ParameterTypeRequiredDescription
list_idintegeryesID of the list (see list_list)

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "list_id": 4567
}

Response:

{
  "list_id": 4567,
  "name": "Prospects 2026",
  "field_email": "email",
  "field_sms": "",
  "fields": [
    {"name": "email", "type": "varchar(1000)"},
    {"name": "nom", "type": "varchar(1000)"}
  ]
}
FieldDescription
namename of the list
field_email, field_smsfield used as email address or SMS number. Its case may differ from the one in fields
fields[].namefield name, in lowercase. These are exactly the keys to use in the tab_insert of list_insert. The platform’s technical fields are not listed
fields[].typedata type of the field

Errors:

MessageCause
Error list_id is missing or is not numeric
Error this list not owned by auth userthe list belongs neither to your account nor to one of your sub-accounts
Error No fields in this listthe list has no fields

Create a list

Access point: https://www.mdworks.fr/api_http/list_create

This method creates a new list for an account or a sub-account.

Parameters:

ParameterTypeRequiredDescription
nomtextyesname of the list
field_listtextyescomma-separated list of fields, letters and the _ character only. 50 fields at most
field_emailtextyesname of the field that holds the email addresses. It must appear in field_list
field_indextextnocomma-separated fields on which search is enabled, with the same names as in field_list. 20 fields at most
user_idintegernoID of the account on which to create the list (see user_list). If missing, the list is created on the main account
email_crypt0 or 1no0 by default. With 1, email addresses are never accessible to the user, but they can still be used in campaigns

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "user_id": "4781",
  "nom": "My new list",
  "field_list": "email,nom,prenom,civilite,societe,code_naf",
  "field_index": "code_naf",
  "field_email": "email"
}

Response: the ID of the new list.

{"list_id": "33541"}

Errors:

MessageCause
Param nom is missing
Param field_list is missing
Param field_email is missing
Error field_list as disallowed charactersa character other than a letter, _ or a comma
Error field_index as disallowed characters
Error field_email as disallowed characters
Error field_email not in field_listfield_email is not in field_list
Problem with this userthe sub-account does not exist or does not belong to your account

Delete a list

Access point: https://www.mdworks.fr/api_http/list_delete

This method deletes a contact list from your account or from one of your sub-accounts.

Parameters:

ParameterTypeRequiredDescription
list_idintegeryesID of the list to delete (see list_list)

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "list_id": "4781"
}

Response:

{"result": "ok"}

Errors:

MessageCause
Error list_id is missing
Error list_id should ne numericlist_id is not a number
Error this list not owned by auth userthe list belongs neither to your account nor to one of your sub-accounts
Error this list protected against delete, go to the dashboardthe list is protected against deletion. The protection can be removed in the interface

Insert contacts into a list

Access point: https://www.mdworks.fr/api_http/list_insert

This method inserts contacts into a list of an account or a sub-account. You send the data in the call (“push” method).

Parameters:

ParameterTypeRequiredDescription
list_idintegeryesID of the list (see list_list)
tab_insertarray of objectsyescontacts to insert, 255 rows at most per call

Each row of tab_insert is an object whose keys are the list’s field names, as returned by list_fields. Their order does not matter. Only the field holding the email address is required, missing fields are filled with an empty value.

For performance reasons, we advise against adding rows one by one: group them in batches.

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "list_id": "4781",
  "tab_insert": [
    {"email": "test@test.com", "nom": "Dupont", "prenom": "Martin", "civilite": "Monsieur"},
    {"email": "test1@test.com", "nom": "Durant", "prenom": "Myrlène"}
  ]
}

Example of a PHP variable:

$tab = array(
    0 => array("email" => "test@test.com", "nom" => "Dupont", "prenom" => "Martin", "civilite" => "Monsieur"),
    1 => array("email" => "test1@test.com", "nom" => "Durant", "prenom" => "Myrlène", "civilite" => "Madame")
);

Response:

{"result": "ok"}

Errors:

MessageCause
Error list_id is missing
Error this list not owned by auth userthe list belongs neither to your account nor to one of your sub-accounts
Error tab_insert is missing
Error tab_insert is not an array
Error No fields in this listthe list has no fields

Insert contacts from a URL

Access point: https://www.mdworks.fr/api_http/list_insert_url

With this method (“get”), you give the platform the URL of a file that it fetches itself. The data must be in CSV format, with a semicolon as separator.

We recommend restricting access to this file, hosted on your side, to our IPs. The IPs we use to fetch your file are 193.200.171.13 and 193.200.171.14.

Parameters:

ParameterTypeRequiredDescription
list_idintegeryesID of the list (see list_list)
urltextyesURL of the CSV file that contains the data to insert

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "list_id": "4781",
  "url": "https://www.example.com/export/mylist.csv"
}

Response:

{"result": "ok"}

Errors:

MessageCause
Error list_id is missing
Error url is missing
Error this list not owned by auth userthe list belongs neither to your account nor to one of your sub-accounts

Insert or update contacts

Access point: https://www.mdworks.fr/api_http/list_insert_or_update

This method inserts new contacts and updates existing contacts in a list of an account or a sub-account.

If there are no updates to handle, prefer list_insert: list_insert_or_update is slower, because it checks whether each row already exists.

Parameters:

ParameterTypeRequiredDescription
list_idintegeryesID of the list (see list_list)
tab_insertarray of objectsyescontacts to insert or update, 255 rows at most per call, in the same format as for list_insert
index_keytextyesfield used for the lookup, to know whether a row is a new contact or a contact to update

For an existing contact, only the fields present in the row are updated: a missing field keeps its value. A field sent empty or null is emptied.

The index_key field must have the “uniqueness” setting enabled in the interface, otherwise an error is returned. This check prevents existing data from being compromised.

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "list_id": "4781",
  "tab_insert": [
    {"email": "test@test.com", "nom": "Dupont", "prenom": "Martin", "civilite": "Monsieur"},
    {"email": "test1@test.com", "nom": "Durant", "prenom": "Myrlène"}
  ],
  "index_key": "email"
}

Response:

{"result": "ok"}

Errors:

MessageCause
Error list_id is missing
Error this list not owned by auth userthe list belongs neither to your account nor to one of your sub-accounts
Error tab_insert is missing
Error tab_insert is not an array
Error No fields in this listthe list has no fields
Error index_key should not be empty
Error index_key is not in the list of fieldsindex_key matches no field of the list
Error index_key must have the unique property activated in the interfaceenable “uniqueness” on this field in the interface
Last updated on