Update Preferences
curl --request PATCH \
--url https://relay.snipp.gg/preferences \
--header 'Content-Type: application/json' \
--header 'relay-key: <api-key>' \
--data '
{
"notifications": {
"likes": false
},
"uploads": {
"default_privacy": "private"
}
}
'import requests
url = "https://relay.snipp.gg/preferences"
payload = {
"notifications": { "likes": False },
"uploads": { "default_privacy": "private" }
}
headers = {
"relay-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'relay-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({notifications: {likes: false}, uploads: {default_privacy: 'private'}})
};
fetch('https://relay.snipp.gg/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://relay.snipp.gg/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([
'notifications' => [
'likes' => false
],
'uploads' => [
'default_privacy' => 'private'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"relay-key: <api-key>"
],
]);
$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://relay.snipp.gg/preferences"
payload := strings.NewReader("{\n \"notifications\": {\n \"likes\": false\n },\n \"uploads\": {\n \"default_privacy\": \"private\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("relay-key", "<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))
}HttpResponse<String> response = Unirest.patch("https://relay.snipp.gg/preferences")
.header("relay-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"notifications\": {\n \"likes\": false\n },\n \"uploads\": {\n \"default_privacy\": \"private\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://relay.snipp.gg/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["relay-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"notifications\": {\n \"likes\": false\n },\n \"uploads\": {\n \"default_privacy\": \"private\"\n }\n}"
response = http.request(request)
puts response.read_body{
"notifications": {
"follows": true,
"likes": false,
"comments": true
},
"emails": {
"sign_ins": true
},
"uploads": {
"default_privacy": "private",
"adaptive_streaming": true,
"auto_compress": false,
"include_metadata": false,
"auto_copy_url": false
},
"sharing": {
"share_policy": "everyone"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}Account
Update Preferences
Change any subset of your preferences.
PATCH
/
preferences
Update Preferences
curl --request PATCH \
--url https://relay.snipp.gg/preferences \
--header 'Content-Type: application/json' \
--header 'relay-key: <api-key>' \
--data '
{
"notifications": {
"likes": false
},
"uploads": {
"default_privacy": "private"
}
}
'import requests
url = "https://relay.snipp.gg/preferences"
payload = {
"notifications": { "likes": False },
"uploads": { "default_privacy": "private" }
}
headers = {
"relay-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'relay-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({notifications: {likes: false}, uploads: {default_privacy: 'private'}})
};
fetch('https://relay.snipp.gg/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://relay.snipp.gg/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([
'notifications' => [
'likes' => false
],
'uploads' => [
'default_privacy' => 'private'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"relay-key: <api-key>"
],
]);
$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://relay.snipp.gg/preferences"
payload := strings.NewReader("{\n \"notifications\": {\n \"likes\": false\n },\n \"uploads\": {\n \"default_privacy\": \"private\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("relay-key", "<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))
}HttpResponse<String> response = Unirest.patch("https://relay.snipp.gg/preferences")
.header("relay-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"notifications\": {\n \"likes\": false\n },\n \"uploads\": {\n \"default_privacy\": \"private\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://relay.snipp.gg/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["relay-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"notifications\": {\n \"likes\": false\n },\n \"uploads\": {\n \"default_privacy\": \"private\"\n }\n}"
response = http.request(request)
puts response.read_body{
"notifications": {
"follows": true,
"likes": false,
"comments": true
},
"emails": {
"sign_ins": true
},
"uploads": {
"default_privacy": "private",
"adaptive_streaming": true,
"auto_compress": false,
"include_metadata": false,
"auto_copy_url": false
},
"sharing": {
"share_policy": "everyone"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"username": "<string>",
"quota": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"failed": [
{
"index": 123,
"error": "<unknown>"
}
]
}
}Change any of your notification, email, upload and sharing preferences.
Behavior
- Send a JSON body with only the sections and keys you want to change. Anything you leave out keeps its value.
notificationsacceptsfollows,likesandcomments.emailsacceptssign_ins.uploadsacceptsdefault_privacy,adaptive_streaming,auto_compress,include_metadataandauto_copy_url.sharingacceptsshare_policy.- Every toggle must be a boolean.
uploads.default_privacymust bepublic,unlistedorprivate.sharing.share_policymust beeveryone,followingornobody. - An unknown key or a wrong value returns
400and nothing is saved. - The response is the full set of preferences after the change. See Get Preferences for what each one does.
- Shares a rate limit bucket with Get Preferences: 20 requests per minute.
Examples
curl -X PATCH "https://relay.snipp.gg/preferences" \
-H "relay-key: YOUR_RELAY_KEY" \
-H "Content-Type: application/json" \
-d '{"notifications": {"likes": false}, "uploads": {"default_privacy": "private"}}'
Responses
{
"notifications": {
"follows": true,
"likes": false,
"comments": true
},
"emails": {
"sign_ins": true
},
"uploads": {
"default_privacy": "private",
"adaptive_streaming": true,
"auto_compress": false,
"include_metadata": false,
"auto_copy_url": false
},
"sharing": {
"share_policy": "everyone"
}
}
Errors
| Status | Type | When |
|---|---|---|
400 | invalid_request | An unknown key or an invalid value |
401 | unauthorized | Missing or invalid key |
403 | suspended | Your account is suspended |
429 | rate_limited | More than 20 requests per minute |
Authorizations
Your relay key from snipp.gg/settings/relay
Body
application/json