Saves the CALLER's alerting configuration layer (one row per
organization in alert_config_layers). The body is an
AlertingConfigLayer: three channel toggles plus three recipient
lists. Each recipient carries its own severities[]; email
recipients additionally carry language and format.
After save, the effective per-tenant Mimir YAML is recomputed
server-side (merge of all layers walking up to the Owner) and
pushed to every tenant in the caller's hierarchy with bounded
concurrency. Per-tenant push failures are returned in warnings[];
the caller's layer is saved regardless of push outcome (Mimir can
be reconciled by saving again).
Additive-only contract: descendants can ADD recipients but cannot
disable channels enabled by ancestors. The server normalises any
explicit false in enabled.{email,webhook,telegram} from
non-Owner layers to null on storage.
Save+propagate is serialised per-organization (in-process mutex) to prevent two concurrent saves from racing at the Mimir push step. Body is capped at 1 MiB; oversized payloads are rejected with 413.
Requires manage:alerts permission.
Body
Required
-
Per-layer enable/disable for each notification channel. Each value is tri-state:
true— explicitly enabled at this layerfalse— explicitly disabled (Owner only; non-Owner false is normalised to null on save)null— no opinion at this layer; effective state inherits from the merge of any ancestor layer that took a position. If no layer in the chain enables a channel, the channel stays off.
-
Not more than
50elements. -
Not more than
20elements. -
Not more than
20elements.
curl \
--request POST 'https://api.your-domain.com/api/alerts/config' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"enabled":{"email":true,"webhook":true,"telegram":false},"email_recipients":[{"address":"noc@msp.example","severities":[],"language":"it","format":"html"}],"webhook_recipients":[{"name":"central-siem","url":"https://siem.example/api/alerts","severities":[]}],"telegram_recipients":[]}'
{
"enabled": {
"email": true,
"webhook": true,
"telegram": false
},
"email_recipients": [
{
"address": "noc@msp.example",
"severities": [],
"language": "it",
"format": "html"
}
],
"webhook_recipients": [
{
"name": "central-siem",
"url": "https://siem.example/api/alerts",
"severities": []
}
],
"telegram_recipients": []
}
{
"enabled": {
"email": null,
"webhook": null,
"telegram": null
},
"email_recipients": [
{
"address": "noc@reseller.example",
"severities": [
"critical",
"warning"
],
"language": "en",
"format": "html"
}
],
"webhook_recipients": [],
"telegram_recipients": []
}
{
"enabled": {
"email": null,
"webhook": null,
"telegram": null
},
"email_recipients": [
{
"address": "oncall@customer.example",
"severities": [
"critical"
],
"language": "en",
"format": "plain"
},
{
"address": "manager@customer.example",
"severities": [],
"language": "it",
"format": "html"
}
],
"webhook_recipients": [],
"telegram_recipients": []
}
{
"enabled": {
"email": null,
"webhook": null,
"telegram": null
},
"email_recipients": [],
"webhook_recipients": [
{
"name": "ops-slack",
"url": "https://hooks.slack.com/services/T000/B000/XXX",
"severities": [
"critical"
]
}
],
"telegram_recipients": []
}
{
"enabled": {
"email": null,
"webhook": null,
"telegram": true
},
"email_recipients": [],
"webhook_recipients": [],
"telegram_recipients": [
{
"bot_token": "123456:ABC-DEF1234ghIkl",
"chat_id": -1001234567890,
"severities": []
}
]
}
{
"enabled": {
"email": null,
"webhook": null,
"telegram": null
},
"email_recipients": [],
"webhook_recipients": [],
"telegram_recipients": []
}
{
"code": 200,
"message": "alerting configuration updated successfully",
"data": {
"affected_tenants": 42,
"propagated_to": 42,
"warnings": [
"string"
]
}
}
{
"code": 400,
"message": "validation failed",
"data": {
"type": "validation_error",
"errors": [
{
"key": "username",
"message": "required",
"value": "string"
}
]
}
}
{
"code": 401,
"message": "invalid token",
"data": {}
}
{
"code": 403,
"message": "insufficient permissions",
"data": {}
}
{
"code": 413,
"message": "request body exceeds the configured maximum"
}
{
"code": 500,
"message": "internal server error",
"data": {}
}