Update notification preferences
curl --request PATCH \
--url https://api.runaether.dev/user/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"preferences": {}
}
'import requests
url = "https://api.runaether.dev/user/notification-preferences"
payload = { "preferences": {} }
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({preferences: {}})
};
fetch('https://api.runaether.dev/user/notification-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.runaether.dev/user/notification-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([
'preferences' => [
]
]),
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.runaether.dev/user/notification-preferences"
payload := strings.NewReader("{\n \"preferences\": {}\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.runaether.dev/user/notification-preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"preferences\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/user/notification-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 \"preferences\": {}\n}"
response = http.request(request)
puts response.read_body{
"pr_review_filter": "none",
"preferences": {
"plan_requested": {
"channels": [
"email"
]
},
"pr_review_submitted": {
"channels": [
"email"
]
},
"question_requested": {
"channels": [
"email"
]
},
"task_failed": {
"channels": [
"email"
]
},
"task_response_ready": {
"channels": [
"email"
]
}
}
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "org_membership_required",
"error": "<string>"
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Notifications
Update notification preferences
Sets the channels of each kind the body names to exactly the channels given, keeps every kind and the PR review filter it omits, and returns the whole configuration.
Use this tool when you need to:
- Turn email, Slack direct messages or push on or off for a kind of notification
- Choose which submitted PR reviews notify the caller at all
Examples:
- PATCH /user/notification-preferences {"preferences": {"task_failed": {"channels": ["email", "push"]}, "question_requested": {"channels": ["slack_dm", "push"]}}}
- PATCH /user/notification-preferences {"pr_review_filter": "changes_requested"}
Hints:
- Both fields are optional. preferences maps a kind (question_requested, plan_requested, task_response_ready, task_failed, pr_review_submitted) to its channels, a list of email, slack_dm and push, where an empty list turns the kind off; pr_review_filter is none, changes_requested, approved or all. An unknown kind, channel or filter is refused with 422 by the schema.
- Returns the same shape as getNotificationPreferences; a body that names nothing changes nothing.
- Only a channel the update turns on is checked: a channel the caller cannot be reached on, Slack direct messages without a linked Slack identity in an organization with Slack connected (or email without a profile email), is refused with 400. Push is never checked.
- Use linkSlackIdentity first to link the caller's Slack identity before turning on slack_dm; use getNotificationPreferences instead to read without changing.
- Any authenticated caller may change their own.
PATCH
/
user
/
notification-preferences
Update notification preferences
curl --request PATCH \
--url https://api.runaether.dev/user/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"preferences": {}
}
'import requests
url = "https://api.runaether.dev/user/notification-preferences"
payload = { "preferences": {} }
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({preferences: {}})
};
fetch('https://api.runaether.dev/user/notification-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.runaether.dev/user/notification-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([
'preferences' => [
]
]),
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.runaether.dev/user/notification-preferences"
payload := strings.NewReader("{\n \"preferences\": {}\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.runaether.dev/user/notification-preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"preferences\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/user/notification-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 \"preferences\": {}\n}"
response = http.request(request)
puts response.read_body{
"pr_review_filter": "none",
"preferences": {
"plan_requested": {
"channels": [
"email"
]
},
"pr_review_submitted": {
"channels": [
"email"
]
},
"question_requested": {
"channels": [
"email"
]
},
"task_failed": {
"channels": [
"email"
]
},
"task_response_ready": {
"channels": [
"email"
]
}
}
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "org_membership_required",
"error": "<string>"
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json