Change my message settings
curl --request PATCH \
--url https://api.example.com/v1/settings/messages \
--header 'Content-Type: application/json' \
--cookie __Secure-better-auth.session_token= \
--data '
{
"operationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"at": "2023-11-07T05:31:56Z",
"supersedes": "<string>",
"nightOn": true,
"unmute": "<string>",
"stopped": true
}
'import requests
url = "https://api.example.com/v1/settings/messages"
payload = {
"operationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"at": "2023-11-07T05:31:56Z",
"supersedes": "<string>",
"nightOn": True,
"unmute": "<string>",
"stopped": True
}
headers = {
"cookie": "__Secure-better-auth.session_token=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
cookie: '__Secure-better-auth.session_token=',
'Content-Type': 'application/json'
},
body: JSON.stringify({
operationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
at: '2023-11-07T05:31:56Z',
supersedes: '<string>',
nightOn: true,
unmute: '<string>',
stopped: true
})
};
fetch('https://api.example.com/v1/settings/messages', 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.example.com/v1/settings/messages",
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([
'operationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'at' => '2023-11-07T05:31:56Z',
'supersedes' => '<string>',
'nightOn' => true,
'unmute' => '<string>',
'stopped' => true
]),
CURLOPT_COOKIE => "__Secure-better-auth.session_token=",
CURLOPT_HTTPHEADER => [
"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.example.com/v1/settings/messages"
payload := strings.NewReader("{\n \"operationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"supersedes\": \"<string>\",\n \"nightOn\": true,\n \"unmute\": \"<string>\",\n \"stopped\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "__Secure-better-auth.session_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.example.com/v1/settings/messages")
.header("cookie", "__Secure-better-auth.session_token=")
.header("Content-Type", "application/json")
.body("{\n \"operationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"supersedes\": \"<string>\",\n \"nightOn\": true,\n \"unmute\": \"<string>\",\n \"stopped\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/settings/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cookie"] = '__Secure-better-auth.session_token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"operationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"supersedes\": \"<string>\",\n \"nightOn\": true,\n \"unmute\": \"<string>\",\n \"stopped\": true\n}"
response = http.request(request)
puts response.read_body{
"settings": {
"id": "<string>",
"nightTime": "18:00",
"nightOn": true,
"mode": "all",
"mutedTopics": [
{
"topicId": "<string>",
"label": "<string>"
}
],
"stoppedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "<string>",
"details": {}
}{
"code": "<string>",
"details": {}
}{
"code": "request.timeout",
"correlationId": "<string>"
}{
"code": "request.timeout",
"correlationId": "<string>"
}Messages
Change my message settings
Writes the caller’s settings as a new fact that supersedes the current one. supersedes is the current settings.id, null only while it is null; a stale one is a conflict. A field already at its value writes nothing and returns the current settings. operationId makes a retry safe.
PATCH
/
v1
/
settings
/
messages
Change my message settings
curl --request PATCH \
--url https://api.example.com/v1/settings/messages \
--header 'Content-Type: application/json' \
--cookie __Secure-better-auth.session_token= \
--data '
{
"operationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"at": "2023-11-07T05:31:56Z",
"supersedes": "<string>",
"nightOn": true,
"unmute": "<string>",
"stopped": true
}
'import requests
url = "https://api.example.com/v1/settings/messages"
payload = {
"operationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"at": "2023-11-07T05:31:56Z",
"supersedes": "<string>",
"nightOn": True,
"unmute": "<string>",
"stopped": True
}
headers = {
"cookie": "__Secure-better-auth.session_token=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
cookie: '__Secure-better-auth.session_token=',
'Content-Type': 'application/json'
},
body: JSON.stringify({
operationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
at: '2023-11-07T05:31:56Z',
supersedes: '<string>',
nightOn: true,
unmute: '<string>',
stopped: true
})
};
fetch('https://api.example.com/v1/settings/messages', 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.example.com/v1/settings/messages",
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([
'operationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'at' => '2023-11-07T05:31:56Z',
'supersedes' => '<string>',
'nightOn' => true,
'unmute' => '<string>',
'stopped' => true
]),
CURLOPT_COOKIE => "__Secure-better-auth.session_token=",
CURLOPT_HTTPHEADER => [
"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.example.com/v1/settings/messages"
payload := strings.NewReader("{\n \"operationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"supersedes\": \"<string>\",\n \"nightOn\": true,\n \"unmute\": \"<string>\",\n \"stopped\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "__Secure-better-auth.session_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.example.com/v1/settings/messages")
.header("cookie", "__Secure-better-auth.session_token=")
.header("Content-Type", "application/json")
.body("{\n \"operationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"supersedes\": \"<string>\",\n \"nightOn\": true,\n \"unmute\": \"<string>\",\n \"stopped\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/settings/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cookie"] = '__Secure-better-auth.session_token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"operationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"supersedes\": \"<string>\",\n \"nightOn\": true,\n \"unmute\": \"<string>\",\n \"stopped\": true\n}"
response = http.request(request)
puts response.read_body{
"settings": {
"id": "<string>",
"nightTime": "18:00",
"nightOn": true,
"mode": "all",
"mutedTopics": [
{
"topicId": "<string>",
"label": "<string>"
}
],
"stoppedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "<string>",
"details": {}
}{
"code": "<string>",
"details": {}
}{
"code": "request.timeout",
"correlationId": "<string>"
}{
"code": "request.timeout",
"correlationId": "<string>"
}Authorizations
The session cookie set when you sign in to the web app.
Body
application/json
Maximum string length:
64Available options:
18:00, 18:30, 19:00, 19:30, 20:00, 20:30, 21:00, 21:30, 22:00, 22:30 Available options:
all, changes A topicId in mutedTopics: receive it again.
Required string length:
1 - 64true stops the messages, false receives them again.
Response
The settings after the change.
Show child attributes
Show child attributes