curl --request PUT \
--url https://cloudapi.mailercloud.com/v1/contacts/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"city": "string",
"country": "string",
"department": "string",
"industry": "string",
"job_title": "string",
"last_name": "string",
"lead_source": "string",
"middle_name": "string",
"first_name": "string",
"company_name": "string",
"phone": "string",
"salary": 0,
"state": "string",
"postal_code": "string",
"tags": [
"string"
]
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/contacts/{id}"
payload = {
"city": "string",
"country": "string",
"department": "string",
"industry": "string",
"job_title": "string",
"last_name": "string",
"lead_source": "string",
"middle_name": "string",
"first_name": "string",
"company_name": "string",
"phone": "string",
"salary": 0,
"state": "string",
"postal_code": "string",
"tags": ["string"]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<api-key>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': '<content-type>', Authorization: '<api-key>'},
body: JSON.stringify({
city: 'string',
country: 'string',
department: 'string',
industry: 'string',
job_title: 'string',
last_name: 'string',
lead_source: 'string',
middle_name: 'string',
first_name: 'string',
company_name: 'string',
phone: 'string',
salary: 0,
state: 'string',
postal_code: 'string',
tags: ['string']
})
};
fetch('https://cloudapi.mailercloud.com/v1/contacts/{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/contacts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'city' => 'string',
'country' => 'string',
'department' => 'string',
'industry' => 'string',
'job_title' => 'string',
'last_name' => 'string',
'lead_source' => 'string',
'middle_name' => 'string',
'first_name' => 'string',
'company_name' => 'string',
'phone' => 'string',
'salary' => 0,
'state' => 'string',
'postal_code' => 'string',
'tags' => [
'string'
]
]),
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/contacts/{id}"
payload := strings.NewReader("{\n \"city\": \"string\",\n \"country\": \"string\",\n \"department\": \"string\",\n \"industry\": \"string\",\n \"job_title\": \"string\",\n \"last_name\": \"string\",\n \"lead_source\": \"string\",\n \"middle_name\": \"string\",\n \"first_name\": \"string\",\n \"company_name\": \"string\",\n \"phone\": \"string\",\n \"salary\": 0,\n \"state\": \"string\",\n \"postal_code\": \"string\",\n \"tags\": [\n \"string\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"message": "Contact updated"
}{
"error": {
"field": "name",
"message": "Invalid name"
}
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}{
"errors": [
{
"field": "id",
"message": "Record not found with the given Id"
}
]
}Update Contact
Update contact details based on contact ID or Email using this API. However, you can’t update the list ID and email.
curl --request PUT \
--url https://cloudapi.mailercloud.com/v1/contacts/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"city": "string",
"country": "string",
"department": "string",
"industry": "string",
"job_title": "string",
"last_name": "string",
"lead_source": "string",
"middle_name": "string",
"first_name": "string",
"company_name": "string",
"phone": "string",
"salary": 0,
"state": "string",
"postal_code": "string",
"tags": [
"string"
]
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/contacts/{id}"
payload = {
"city": "string",
"country": "string",
"department": "string",
"industry": "string",
"job_title": "string",
"last_name": "string",
"lead_source": "string",
"middle_name": "string",
"first_name": "string",
"company_name": "string",
"phone": "string",
"salary": 0,
"state": "string",
"postal_code": "string",
"tags": ["string"]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<api-key>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': '<content-type>', Authorization: '<api-key>'},
body: JSON.stringify({
city: 'string',
country: 'string',
department: 'string',
industry: 'string',
job_title: 'string',
last_name: 'string',
lead_source: 'string',
middle_name: 'string',
first_name: 'string',
company_name: 'string',
phone: 'string',
salary: 0,
state: 'string',
postal_code: 'string',
tags: ['string']
})
};
fetch('https://cloudapi.mailercloud.com/v1/contacts/{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/contacts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'city' => 'string',
'country' => 'string',
'department' => 'string',
'industry' => 'string',
'job_title' => 'string',
'last_name' => 'string',
'lead_source' => 'string',
'middle_name' => 'string',
'first_name' => 'string',
'company_name' => 'string',
'phone' => 'string',
'salary' => 0,
'state' => 'string',
'postal_code' => 'string',
'tags' => [
'string'
]
]),
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/contacts/{id}"
payload := strings.NewReader("{\n \"city\": \"string\",\n \"country\": \"string\",\n \"department\": \"string\",\n \"industry\": \"string\",\n \"job_title\": \"string\",\n \"last_name\": \"string\",\n \"lead_source\": \"string\",\n \"middle_name\": \"string\",\n \"first_name\": \"string\",\n \"company_name\": \"string\",\n \"phone\": \"string\",\n \"salary\": 0,\n \"state\": \"string\",\n \"postal_code\": \"string\",\n \"tags\": [\n \"string\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"message": "Contact updated"
}{
"error": {
"field": "name",
"message": "Invalid name"
}
}{
"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
Contact Id or Email
Body
The city of the contact
Maximum: 100
100The country of the contact
Maximum: 50
50Json for custom property
Text - maximum: 100
Textarea - maximum: 500
Number - Numeric values only
Date - maximum: 10,format = 2006-01-02
Show child attributes
Show child attributes
The department of contact
Maximum: 100
100The industry of the contact
Maximum: 100
100The job title of the contact
Maximum: 100
100The last name for the contact
Maximum: 25
25The lead sorce of contact
Maximum: 50
50The middle name of contact
Maximum: 25
25Name of your contact
Maximum: 25
25The company name of your contact
Maximum: 150
150The phone number of your contact
Maximum: 25
25The salary of your contact
Maximum: 15
The state of your contact
Maximum: 100
100The postal code of your contact
Maximum: 25
25Allowed values - active, bounce, abuse, unsubscribe, suppressed, spam complaints
The tags of your contact
Open-tracking consent for this contact.
Accepted values are case-insensitive and whitespace-trimmed:
- granted:
granted,yes,true,1,subscribed - denied:
denied,revoked,no,false,0,unsubscribed - unknown:
unknown,never subscribed
The subscribed / unsubscribed / never subscribed aliases let Klaviyo exports be imported unchanged.
An unrecognised or empty value is ignored and leaves any existing consent untouched - it is not a validation error, so a blank field in a re-upload never erases a previously recorded answer.
Setting a value also stamps tracking_consent_date and sets tracking_consent_source to 5 (API). Those two fields cannot be set directly.
Maximum: 20
20Response
OK
1