curl --request PATCH \
--url https://api.spreadjam.com/v1/notification-rules/{category} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
"chat",
"custom_webhook"
],
"isActive": true
}
'import requests
url = "https://api.spreadjam.com/v1/notification-rules/{category}"
payload = {
"channels": ["chat", "custom_webhook"],
"isActive": 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({channels: ['chat', 'custom_webhook'], isActive: true})
};
fetch('https://api.spreadjam.com/v1/notification-rules/{category}', 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.spreadjam.com/v1/notification-rules/{category}",
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([
'channels' => [
'chat',
'custom_webhook'
],
'isActive' => 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.spreadjam.com/v1/notification-rules/{category}"
payload := strings.NewReader("{\n \"channels\": [\n \"chat\",\n \"custom_webhook\"\n ],\n \"isActive\": 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.spreadjam.com/v1/notification-rules/{category}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channels\": [\n \"chat\",\n \"custom_webhook\"\n ],\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spreadjam.com/v1/notification-rules/{category}")
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 \"channels\": [\n \"chat\",\n \"custom_webhook\"\n ],\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"eventCategory": "action_required",
"channels": [
"<string>"
],
"isActive": true,
"batchingEnabled": true,
"batchWindowMinutes": 123,
"quietHoursStart": "<string>",
"quietHoursEnd": "<string>",
"quietHoursTimezone": "<string>"
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}Change a notification rule
Turn a category on or off, or set its channels. To receive GEO events at a webhook, add custom_webhook to the categories you want (for example action_required and completion) and add the webhook with POST /v1/webhooks.
curl --request PATCH \
--url https://api.spreadjam.com/v1/notification-rules/{category} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
"chat",
"custom_webhook"
],
"isActive": true
}
'import requests
url = "https://api.spreadjam.com/v1/notification-rules/{category}"
payload = {
"channels": ["chat", "custom_webhook"],
"isActive": 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({channels: ['chat', 'custom_webhook'], isActive: true})
};
fetch('https://api.spreadjam.com/v1/notification-rules/{category}', 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.spreadjam.com/v1/notification-rules/{category}",
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([
'channels' => [
'chat',
'custom_webhook'
],
'isActive' => 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.spreadjam.com/v1/notification-rules/{category}"
payload := strings.NewReader("{\n \"channels\": [\n \"chat\",\n \"custom_webhook\"\n ],\n \"isActive\": 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.spreadjam.com/v1/notification-rules/{category}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channels\": [\n \"chat\",\n \"custom_webhook\"\n ],\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spreadjam.com/v1/notification-rules/{category}")
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 \"channels\": [\n \"chat\",\n \"custom_webhook\"\n ],\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"eventCategory": "action_required",
"channels": [
"<string>"
],
"isActive": true,
"batchingEnabled": true,
"batchWindowMinutes": 123,
"quietHoursStart": "<string>",
"quietHoursEnd": "<string>",
"quietHoursTimezone": "<string>"
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}Authorizations
A workspace API key issued in Settings → Developer, sent as Bearer sk_….
Path Parameters
The event category the rule covers.
action_required, error, status_update, insight, completion "action_required"
Body
Response
The updated rule.
action_required (needs input), error, status_update, insight, completion. GEO notification types map one to one: geo_action_required, geo_error, geo_status_update, geo_insight, geo_completion.
action_required, error, status_update, insight, completion Where this category goes: chat, email, slack, discord, telegram, imessage, custom_webhook. custom_webhook sends to every enabled webhook in GET /v1/webhooks.
False: this category does not notify at all.
HH:MM, in quietHoursTimezone.