Alert sources

Update an alert source

Changes only the fields you send; settings merge into the current settings.

patch/alert-sources/{source}

Request

  • Base URL
    https://api.spectate.net/v1
  • Auth
    HTTP bearer

Path parameters

sourcestring uuid required

Alert source ID.

Request body

namestring

Name shown on its alerts

enabledboolean

Whether requests fire alerts

default_severity'critical' | 'high' | 'medium' | 'low'

How urgent an alert or incident is. Escalation paths can branch on it.

critical <br/> Customers are affected right now.
high <br/> Serious, needs attention soon.
medium <br/> Should be looked at.
low <br/> Informational.
auto_resolve_minutesinteger nullable

Minutes, 5 to 10080, after which an alert the tool stopped repeating resolves; null keeps it until resolved

secretstring nullable

Signing secret; an empty string or null removes it. Write-only

project_idstring uuid nullable

Project whose escalation paths apply; null for none

escalation_path_idsstring[]

Escalation paths for the source's alerts; replaces the current ones

Example request

{
  "name": "Production Alertmanager",
  "settings": {
    "signature_header": "X-Grafana-Alerting-Signature"
  }
}

Response

The updated alert source.

idstring uuid required

Alert source ID

namestring required

Name shown on its alerts

type'webhook' | 'email' | 'alertmanager' | 'grafana' | 'sentry' required

The external tool behind an alert source; decides how its requests are read.

webhook <br/> Spectate's own JSON format, for scripts, CI and anything that can call a URL.
email <br/> Emails to the source's own address (subject becomes the alert).
alertmanager <br/> Prometheus Alertmanager webhook_configs.
grafana <br/> Grafana Alerting webhook contact point (Alertmanager format plus Grafana links).
sentry <br/> Sentry internal integration webhooks (SaaS and self-hosted), or the legacy WebHooks plugin.
enabledboolean required

Whether requests fire alerts; a disabled source rejects them

webhook_urlstring uri required

Where the tool sends its webhooks. Secret: rotate it with rotateAlertSourceToken if it leaks

email_addressstring email nullable required

email sources: the address to send mails to. Secret like the URL

has_secretboolean required

Whether a signing secret is set (Sentry client secret, Grafana HMAC secret, Alertmanager bearer token); it's never returned

default_severity'critical' | 'high' | 'medium' | 'low' required

How urgent an alert or incident is. Escalation paths can branch on it.

critical <br/> Customers are affected right now.
high <br/> Serious, needs attention soon.
medium <br/> Should be looked at.
low <br/> Informational.
auto_resolve_minutesinteger nullable required

Minutes after which an alert the tool stopped repeating resolves; null keeps it until the tool resolves it

project_idstring uuid nullable required

The project whose escalation paths apply when the source has none of its own; null for none

last_event_atstring date-time nullable required

When the source last received a request

events_countinteger required

Requests the source has received in total

firing_alerts_countinteger required

Alerts of the source that are firing now

created_atstring date-time required

When the source was created

Example response

{
  "name": "Production Alertmanager",
  "auto_resolve_minutes": 60,
  "settings": {
    "signature_header": "X-Grafana-Alerting-Signature"
  },
  "escalation_paths": [
    {
      "name": "On-call engineers"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.