Update a detection
curl --request PUT \
--url https://api.withsplendor.com/v1/admin/detections/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-splendor-tenant-id: <x-splendor-tenant-id>' \
--data '
{
"name": "<string>",
"schedule_cron": "<string>",
"webhook_url": "<string>",
"code": "<string>",
"description": "",
"enabled": true,
"kind": "threshold",
"query": {},
"threshold": 123
}
'import requests
url = "https://api.withsplendor.com/v1/admin/detections/{rule_id}"
payload = {
"name": "<string>",
"schedule_cron": "<string>",
"webhook_url": "<string>",
"code": "<string>",
"description": "",
"enabled": True,
"kind": "threshold",
"query": {},
"threshold": 123
}
headers = {
"x-splendor-tenant-id": "<x-splendor-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-splendor-tenant-id': '<x-splendor-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
schedule_cron: '<string>',
webhook_url: '<string>',
code: '<string>',
description: '',
enabled: true,
kind: 'threshold',
query: {},
threshold: 123
})
};
fetch('https://api.withsplendor.com/v1/admin/detections/{rule_id}', 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.withsplendor.com/v1/admin/detections/{rule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'schedule_cron' => '<string>',
'webhook_url' => '<string>',
'code' => '<string>',
'description' => '',
'enabled' => true,
'kind' => 'threshold',
'query' => [
],
'threshold' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-splendor-tenant-id: <x-splendor-tenant-id>"
],
]);
$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.withsplendor.com/v1/admin/detections/{rule_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"schedule_cron\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"\",\n \"enabled\": true,\n \"kind\": \"threshold\",\n \"query\": {},\n \"threshold\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-splendor-tenant-id", "<x-splendor-tenant-id>")
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.put("https://api.withsplendor.com/v1/admin/detections/{rule_id}")
.header("x-splendor-tenant-id", "<x-splendor-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"schedule_cron\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"\",\n \"enabled\": true,\n \"kind\": \"threshold\",\n \"query\": {},\n \"threshold\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withsplendor.com/v1/admin/detections/{rule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-splendor-tenant-id"] = '<x-splendor-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"schedule_cron\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"\",\n \"enabled\": true,\n \"kind\": \"threshold\",\n \"query\": {},\n \"threshold\": 123\n}"
response = http.request(request)
puts response.read_body{
"code": null,
"condition_type": "count_gt",
"consecutive_triggers": 0,
"created_at": "2026-01-15T09:30:00Z",
"description": "Alerts when error volume spikes.",
"enabled": true,
"kind": "threshold",
"last_run_at": "2026-01-15T09:30:00Z",
"last_triggered_at": null,
"name": "High error rate",
"query": {
"text": "error"
},
"rule_id": 3,
"schedule_cron": "*/5 * * * *",
"tenant_id": "acme",
"threshold": 100,
"updated_at": "2026-01-15T09:30:00Z",
"webhook_url": "https://hooks.example.com/splendor"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Detections
Update a detection
Updates a detection rule. Requires an admin role.
PUT
/
v1
/
admin
/
detections
/
{rule_id}
Update a detection
curl --request PUT \
--url https://api.withsplendor.com/v1/admin/detections/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-splendor-tenant-id: <x-splendor-tenant-id>' \
--data '
{
"name": "<string>",
"schedule_cron": "<string>",
"webhook_url": "<string>",
"code": "<string>",
"description": "",
"enabled": true,
"kind": "threshold",
"query": {},
"threshold": 123
}
'import requests
url = "https://api.withsplendor.com/v1/admin/detections/{rule_id}"
payload = {
"name": "<string>",
"schedule_cron": "<string>",
"webhook_url": "<string>",
"code": "<string>",
"description": "",
"enabled": True,
"kind": "threshold",
"query": {},
"threshold": 123
}
headers = {
"x-splendor-tenant-id": "<x-splendor-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-splendor-tenant-id': '<x-splendor-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
schedule_cron: '<string>',
webhook_url: '<string>',
code: '<string>',
description: '',
enabled: true,
kind: 'threshold',
query: {},
threshold: 123
})
};
fetch('https://api.withsplendor.com/v1/admin/detections/{rule_id}', 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.withsplendor.com/v1/admin/detections/{rule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'schedule_cron' => '<string>',
'webhook_url' => '<string>',
'code' => '<string>',
'description' => '',
'enabled' => true,
'kind' => 'threshold',
'query' => [
],
'threshold' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-splendor-tenant-id: <x-splendor-tenant-id>"
],
]);
$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.withsplendor.com/v1/admin/detections/{rule_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"schedule_cron\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"\",\n \"enabled\": true,\n \"kind\": \"threshold\",\n \"query\": {},\n \"threshold\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-splendor-tenant-id", "<x-splendor-tenant-id>")
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.put("https://api.withsplendor.com/v1/admin/detections/{rule_id}")
.header("x-splendor-tenant-id", "<x-splendor-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"schedule_cron\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"\",\n \"enabled\": true,\n \"kind\": \"threshold\",\n \"query\": {},\n \"threshold\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withsplendor.com/v1/admin/detections/{rule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-splendor-tenant-id"] = '<x-splendor-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"schedule_cron\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"\",\n \"enabled\": true,\n \"kind\": \"threshold\",\n \"query\": {},\n \"threshold\": 123\n}"
response = http.request(request)
puts response.read_body{
"code": null,
"condition_type": "count_gt",
"consecutive_triggers": 0,
"created_at": "2026-01-15T09:30:00Z",
"description": "Alerts when error volume spikes.",
"enabled": true,
"kind": "threshold",
"last_run_at": "2026-01-15T09:30:00Z",
"last_triggered_at": null,
"name": "High error rate",
"query": {
"text": "error"
},
"rule_id": 3,
"schedule_cron": "*/5 * * * *",
"tenant_id": "acme",
"threshold": 100,
"updated_at": "2026-01-15T09:30:00Z",
"webhook_url": "https://hooks.example.com/splendor"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
API token issued from the Splendor console.
Headers
Selects the tenant (workspace) the request acts within.
Path Parameters
Body
application/json
Required string length:
1 - 255Minimum string length:
1Required string length:
1 - 2048Maximum string length:
100000Available options:
count_gt, count_lt, avg_gt, avg_lt, p95_gt Available options:
threshold, code Response
Successful Response
Available options:
threshold, code ⌘I