Communications
Apply a mailbox one-click unsubscribe
Mailbox providers submit the List-Unsubscribe form value and a category-scoped signed token in the query. Opts the address out of that source category. Legacy whole-email links are rejected. Requires no bearer token or cookies. Responses use Cache-Control: no-store.
POST
/
unsubscribe
/
one-click
Apply a mailbox one-click unsubscribe
curl --request POST \
--url https://api.gratona.com/v1/unsubscribe/one-click \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data List-Unsubscribe=One-Clickimport requests
url = "https://api.gratona.com/v1/unsubscribe/one-click"
payload = { "List-Unsubscribe": "One-Click" }
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({'List-Unsubscribe': 'One-Click'})
};
fetch('https://api.gratona.com/v1/unsubscribe/one-click', 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://api.gratona.com/v1/unsubscribe/one-click",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "List-Unsubscribe=One-Click",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://api.gratona.com/v1/unsubscribe/one-click"
payload := strings.NewReader("List-Unsubscribe=One-Click")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gratona.com/v1/unsubscribe/one-click")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("List-Unsubscribe=One-Click")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/unsubscribe/one-click")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "List-Unsubscribe=One-Click"
response = http.request(request)
puts response.read_bodyUnsubscribed.Invalid one-click unsubscribe request.This unsubscribe link is invalid or no longer available.Query Parameters
Category-scoped signed token from the List-Unsubscribe URL.
Required string length:
1 - 4096Body
application/x-www-form-urlencoded
Available options:
One-Click Example:
"One-Click"
Response
Category unsubscribed.
The response is of type string.
Example:
"Unsubscribed."
⌘I
Apply a mailbox one-click unsubscribe
curl --request POST \
--url https://api.gratona.com/v1/unsubscribe/one-click \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data List-Unsubscribe=One-Clickimport requests
url = "https://api.gratona.com/v1/unsubscribe/one-click"
payload = { "List-Unsubscribe": "One-Click" }
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({'List-Unsubscribe': 'One-Click'})
};
fetch('https://api.gratona.com/v1/unsubscribe/one-click', 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://api.gratona.com/v1/unsubscribe/one-click",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "List-Unsubscribe=One-Click",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://api.gratona.com/v1/unsubscribe/one-click"
payload := strings.NewReader("List-Unsubscribe=One-Click")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gratona.com/v1/unsubscribe/one-click")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("List-Unsubscribe=One-Click")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/unsubscribe/one-click")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "List-Unsubscribe=One-Click"
response = http.request(request)
puts response.read_bodyUnsubscribed.Invalid one-click unsubscribe request.This unsubscribe link is invalid or no longer available.