PUT

mailing-lists/{id}/statuses

Update the Status of Multiple Contacts in a Contact List

Variable name

Validation rules

Description

all

required | boolean

If all entries should be modified. If true, then the values of the entry_ids array won't be considered.

entry_ids

required | array

Entry IDs which statuses needs to be updated

status

required | valid status*

Status of the entry

Valid statuses*:

  • Subscribed

  • Unsubscribed

  • Bounced

  • Removed

Request example:

  • mailing-lists/47/statuses

{
"all": false,
"entry_ids":[2,4],
"status":"Subscribed"
}

Response example:

  • Status code: 200 OK

{
"success": true,
"data": {
"id": 47,
"organization_id": 8,
"name": "Renamed list",
"detail": null,
"created_at": "2020-11-27 09:48:44",
"updated_at": "2021-01-07 11:02:04",
"used_default_columns": [
"email"
],
"used_custom_columns": [],
"entry_number": 3,
"upload_in_progress": false,
"subscribed_entry_number": 3,
"custom_fields": [],
"unsubscribed": 0,
"bounced": 0
}
}

Code example:

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '.../mailing-lists/47/statuses', //replace ... with the whole API url
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"all": false,
"entry_ids":[2,4],
"status":"Subscribed"
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: YOUR-API-KEY',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Did this answer your question?