Update Tag
curl --request PUT \
--url https://cloudapi.mailercloud.com/v1/tags/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "string"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/tags/{id}"
payload = { "name": "string" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'string'})
};
fetch('https://cloudapi.mailercloud.com/v1/tags/{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/tags/{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([
'name' => 'string'
]),
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/tags/{id}"
payload := strings.NewReader("{\n \"name\": \"string\"\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"id": "YCJ"
}{
"error": {
"field": "name",
"message": "Name must be a maximum of 100 characters in length"
}
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}{
"errors": [
{
"field": "id",
"message": "Record not found with the given Id"
}
]
}Update Tag
API for updating tag name of contacts and campaign.
PUT
/
tags
/
{id}
Update Tag
curl --request PUT \
--url https://cloudapi.mailercloud.com/v1/tags/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "string"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/tags/{id}"
payload = { "name": "string" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'string'})
};
fetch('https://cloudapi.mailercloud.com/v1/tags/{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/tags/{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([
'name' => 'string'
]),
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/tags/{id}"
payload := strings.NewReader("{\n \"name\": \"string\"\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"id": "YCJ"
}{
"error": {
"field": "name",
"message": "Name must be a maximum of 100 characters in length"
}
}{
"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
Tag Id
Query Parameters
Body
application/json
Name of tag
Required string length:
1 - 100Response
OK
The response is of type object.
⌘I