Update Property
curl --request PATCH \
--url https://cloudapi.mailercloud.com/v1/contact/property/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "Gender"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/contact/property/{id}"
payload = { "name": "Gender" }
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: 'Gender'})
};
fetch('https://cloudapi.mailercloud.com/v1/contact/property/{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/contact/property/{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' => 'Gender'
]),
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/contact/property/{id}"
payload := strings.NewReader("{\n \"name\": \"Gender\"\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))
}{
"id": "YCJ"
}{
"error": {
"field": "name",
"message": "The name field must be at least 3 characters"
}
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}{
"errors": [
{
"field": "id",
"message": "Record not found with the given Id"
}
]
}Update Property
API for updating custom property of contacts. Editing custom property type using this API is not possible. You can only edit the name and description.
PATCH
/
contact
/
property
/
{id}
Update Property
curl --request PATCH \
--url https://cloudapi.mailercloud.com/v1/contact/property/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "Gender"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/contact/property/{id}"
payload = { "name": "Gender" }
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: 'Gender'})
};
fetch('https://cloudapi.mailercloud.com/v1/contact/property/{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/contact/property/{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' => 'Gender'
]),
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/contact/property/{id}"
payload := strings.NewReader("{\n \"name\": \"Gender\"\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))
}{
"id": "YCJ"
}{
"error": {
"field": "name",
"message": "The name field must be at least 3 characters"
}
}{
"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
Custom Property Id
Body
application/json
Response
OK
⌘I