Update privacy preferences
curl --request PATCH \
--url https://api.mail.gorillaa.one/v1/privacy/preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"doNotSell": true,
"marketingEmails": true,
"productUpdates": true
}
'import requests
url = "https://api.mail.gorillaa.one/v1/privacy/preferences"
payload = {
"doNotSell": True,
"marketingEmails": True,
"productUpdates": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({doNotSell: true, marketingEmails: true, productUpdates: true})
};
fetch('https://api.mail.gorillaa.one/v1/privacy/preferences', 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.mail.gorillaa.one/v1/privacy/preferences",
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([
'doNotSell' => true,
'marketingEmails' => true,
'productUpdates' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.mail.gorillaa.one/v1/privacy/preferences"
payload := strings.NewReader("{\n \"doNotSell\": true,\n \"marketingEmails\": true,\n \"productUpdates\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.mail.gorillaa.one/v1/privacy/preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"doNotSell\": true,\n \"marketingEmails\": true,\n \"productUpdates\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mail.gorillaa.one/v1/privacy/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"doNotSell\": true,\n \"marketingEmails\": true,\n \"productUpdates\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"doNotSell": true,
"marketingEmails": true,
"productUpdates": true,
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_request",
"message": "Request validation failed",
"details": {
"validation": {
"subject": [
"Subject is required"
]
}
},
"suggestion": "Check the request body against the API documentation"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key provided",
"suggestion": "Include a valid API key in the Authorization header: Bearer grl_live_..."
}
}Privacy
Update privacy preferences
Update the organization’s privacy preferences. Partial updates supported.
Requires privacy:manage scope.
PATCH
/
v1
/
privacy
/
preferences
Update privacy preferences
curl --request PATCH \
--url https://api.mail.gorillaa.one/v1/privacy/preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"doNotSell": true,
"marketingEmails": true,
"productUpdates": true
}
'import requests
url = "https://api.mail.gorillaa.one/v1/privacy/preferences"
payload = {
"doNotSell": True,
"marketingEmails": True,
"productUpdates": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({doNotSell: true, marketingEmails: true, productUpdates: true})
};
fetch('https://api.mail.gorillaa.one/v1/privacy/preferences', 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.mail.gorillaa.one/v1/privacy/preferences",
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([
'doNotSell' => true,
'marketingEmails' => true,
'productUpdates' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.mail.gorillaa.one/v1/privacy/preferences"
payload := strings.NewReader("{\n \"doNotSell\": true,\n \"marketingEmails\": true,\n \"productUpdates\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.mail.gorillaa.one/v1/privacy/preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"doNotSell\": true,\n \"marketingEmails\": true,\n \"productUpdates\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mail.gorillaa.one/v1/privacy/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"doNotSell\": true,\n \"marketingEmails\": true,\n \"productUpdates\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"doNotSell": true,
"marketingEmails": true,
"productUpdates": true,
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_request",
"message": "Request validation failed",
"details": {
"validation": {
"subject": [
"Subject is required"
]
}
},
"suggestion": "Check the request body against the API documentation"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key provided",
"suggestion": "Include a valid API key in the Authorization header: Bearer grl_live_..."
}
}Authorizations
API key authentication. Pass your Gorillaa Mail API key as a Bearer token.
Example: Authorization: Bearer grl_live_xxxxxxxxxxxx
Keys prefixed grl_test_ operate in test mode with reduced limits.
Response
Updated preferences
Show child attributes
Show child attributes