Alert sources

Rotate the source's URL

Gives the source a new secret webhook_url (and email_address); the old ones stop working at once, so update the tool right after.

post/alert-sources/{source}/rotate-token

Request

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

Path parameters

sourcestring uuid required

Alert source ID.

Response

The source with its new URL.

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.