Update a List
curl --request PATCH \
--url https://cloudapi.mailercloud.com/v1/list/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "Subscibers List"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/list/{id}"
payload = { "name": "Subscibers List" }
headers = {
"Content-Type": "<content-type>",
"Authorization": "<api-key>"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': '<content-type>', Authorization: '<api-key>'},
body: JSON.stringify({name: 'Subscibers List'})
};
fetch('https://cloudapi.mailercloud.com/v1/list/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloudapi.mailercloud.com/v1/list/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Subscibers List'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloudapi.mailercloud.com/v1/list/{id}"
payload := strings.NewReader("{\n \"name\": \"Subscibers List\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"listdetails": {
"id": "HHda",
"list_type": "Normal",
"name": "List Registration"
}
}{
"errors": [
{
"field": "name",
"message": "Only alphanumeric characters, underscore, hyphen, dot and space allowed"
}
]
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}{
"errors": [
{
"field": "id",
"message": "Record not found with the given Id"
}
]
}Update a List
Update the details of a specific list by id. However, you can only update the names using this API
PATCH
/
list
/
{id}
Update a List
curl --request PATCH \
--url https://cloudapi.mailercloud.com/v1/list/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "Subscibers List"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/list/{id}"
payload = { "name": "Subscibers List" }
headers = {
"Content-Type": "<content-type>",
"Authorization": "<api-key>"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': '<content-type>', Authorization: '<api-key>'},
body: JSON.stringify({name: 'Subscibers List'})
};
fetch('https://cloudapi.mailercloud.com/v1/list/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloudapi.mailercloud.com/v1/list/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Subscibers List'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloudapi.mailercloud.com/v1/list/{id}"
payload := strings.NewReader("{\n \"name\": \"Subscibers List\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"listdetails": {
"id": "HHda",
"list_type": "Normal",
"name": "List Registration"
}
}{
"errors": [
{
"field": "name",
"message": "Only alphanumeric characters, underscore, hyphen, dot and space allowed"
}
]
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}{
"errors": [
{
"field": "id",
"message": "Record not found with the given Id"
}
]
}Authorizations
Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings → API.
Headers
Request body type
Path Parameters
List Id
Query Parameters
Body
application/json
Your List name. Only alphanumeric characters, underscore, hyphen, dot and space allowed.
Minimum: 3 Maximum: 100
Required string length:
3 - 100Pattern:
^[a-zA-Z0-9._ \-]+$/iResponse
OK
Show child attributes
Show child attributes
⌘I