Remove Contact Tag
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/contact/tag/remove \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "example@example.com",
"tag_ids": [
"ccj",
"ddg"
],
"tag_names": [
"my tag",
"new tag"
]
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/contact/tag/remove"
payload = {
"id": "example@example.com",
"tag_ids": ["ccj", "ddg"],
"tag_names": ["my tag", "new tag"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'example@example.com',
tag_ids: ['ccj', 'ddg'],
tag_names: ['my tag', 'new tag']
})
};
fetch('https://cloudapi.mailercloud.com/v1/contact/tag/remove', 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/tag/remove",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'example@example.com',
'tag_ids' => [
'ccj',
'ddg'
],
'tag_names' => [
'my tag',
'new tag'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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/tag/remove"
payload := strings.NewReader("{\n \"id\": \"example@example.com\",\n \"tag_ids\": [\n \"ccj\",\n \"ddg\"\n ],\n \"tag_names\": [\n \"my tag\",\n \"new tag\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "Contact tag removed successfully"
}{
"error": "Contact Id is a required field"
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}Remove Contact Tag
API to remove contact-tags from individual contacts
When you send a request, the API first checks if the contact already exists in your database. If the contact is found, the API will check if the tags you provided are valid. You can give both tag names or tag ids.
The API allows you to remove contact-tags. You can do this in two ways:
- By Contact ID: You can add the contact ID from your panel to remove tags.
- By Email: Alternatively, you can use the email ID of the contact whose tag you want to update.
POST
/
contact
/
tag
/
remove
Remove Contact Tag
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/contact/tag/remove \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "example@example.com",
"tag_ids": [
"ccj",
"ddg"
],
"tag_names": [
"my tag",
"new tag"
]
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/contact/tag/remove"
payload = {
"id": "example@example.com",
"tag_ids": ["ccj", "ddg"],
"tag_names": ["my tag", "new tag"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'example@example.com',
tag_ids: ['ccj', 'ddg'],
tag_names: ['my tag', 'new tag']
})
};
fetch('https://cloudapi.mailercloud.com/v1/contact/tag/remove', 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/tag/remove",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'example@example.com',
'tag_ids' => [
'ccj',
'ddg'
],
'tag_names' => [
'my tag',
'new tag'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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/tag/remove"
payload := strings.NewReader("{\n \"id\": \"example@example.com\",\n \"tag_ids\": [\n \"ccj\",\n \"ddg\"\n ],\n \"tag_names\": [\n \"my tag\",\n \"new tag\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "Contact tag removed successfully"
}{
"error": "Contact Id is a required field"
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}⌘I