Overview

You can use this request to update the properties of a specific list.

The Method

API-Method
RESTPUThttps://[Your URL]/api/2.0/lists/:id
XML-RPCCalllists.UpdateList

Your method must be structured as follows:

Parameters

Required Parameters

The following parameters are required for this request to work:

PropertyTypeDescriptionRequired
$idintegerThe ID of the list to update.yes
$propertiesstructarrayThe properties that need to be updated in the list.yes

Properties

You can update the following list properties using this method.

PropertyTypeDescriptionDefaultRead Only
list_group_idintegerList group identifier.0 no
namestringName of the list.emptyno
public_namestringPublic name of the list.emptyno
owner_namestringName of the list owner.emptyno
owner_emailstringEmail address for the list owner.emptyno
owner_reply_emailstringThe list owner’s reply address.emptyno
company_namestringNameemptyno
company_addressstringAddressemptyno
company_citystringCityemptyno
company_statestringStateemptyno
company_countrystringCountryemptyno
company_postal_codestringPostal Codeemptyno
company_telephonestringTelephone Numberemptyno
company_mobilestringMobile Numberemptyno
company_faxstringFax Numberemptyno
company_emailstringEmail Addressemptyno
company_urlstringURLemptyno
notify_owner_on_list_subscribestringNotify owner on list subscribe Possible values:
yes
no
nono
notify_owner_on_list_unsubscribestringNotify owner on list unsubscribe Possible values:
yes
no
nono
ask_for_unsubscribe_reasonstringAsk for reason on list unsubscribe Possible Values:
yes
no
nono
send_unsubscribe_confirmationstringConfirmation message sent on unsubscribe Possible values:
yes
no
nono
redirect_url_on_unsubscribestringCustom unsubscribe URLemptyno

Responses

TypeDescription
integerThe ID of the updated list.

Code Samples

PHP (using REST API):

$json = '
{
"public_name":"New list public name",
}
';
$url = '(Your URL)/api/2.0/lists';
$method = 'POST';
$cSession = curl_init();
$headers = array();
$auth = base64_encode($username . ':' . $apikey);
$headers[] = 'Authorization: Basic ' . $auth;
curl_setopt($cSession, CURLOPT_URL, $url);
curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cSession, CURLOPT_HEADER, false);
curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method));
curl_setopt($cSession, CURLOPT_POSTFIELDS, $json);
$headers[] = 'Content-Type: application/json';
curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($cSession);
curl_close($cSession);