Skip to main content
POST
/
v1
/
admin
/
detections
Create a detection
curl --request POST \
  --url https://api.withsplendor.com/v1/admin/detections \
  --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
}
'
{
  "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"
}

Authorizations

Authorization
string
header
required

API token issued from the Splendor console.

Headers

x-splendor-tenant-id
string
required

Selects the tenant (workspace) the request acts within.

Body

application/json
name
string
required
Required string length: 1 - 255
schedule_cron
string
required
Minimum string length: 1
webhook_url
string
required
Required string length: 1 - 2048
code
string | null
Maximum string length: 100000
condition_type
enum<string> | null
Available options:
count_gt,
count_lt,
avg_gt,
avg_lt,
p95_gt
description
string
default:""
enabled
boolean
default:true
kind
enum<string>
default:threshold
Available options:
threshold,
code
query
Query · object
threshold
number | null

Response

Successful Response

code
string | null
required
condition_type
string | null
required
consecutive_triggers
integer
required
created_at
string<date-time>
required
description
string
required
enabled
boolean
required
kind
enum<string>
required
Available options:
threshold,
code
last_run_at
string<date-time> | null
required
last_triggered_at
string<date-time> | null
required
name
string
required
query
Query · object
required
rule_id
integer
required
schedule_cron
string
required
tenant_id
string
required
threshold
number | null
required
updated_at
string<date-time>
required
webhook_url
string
required