Ir al contenido

Post an alert the ntfy way

POST/api/alerts/{id}/{token}

The body is the message; the rest goes in headers or the query. With the token message, it is Gotify's create-message, the secret as ?token= or X-Gotify-Key.

Necesita una clave de API en la cabecera Authorization.

En esta página

Parámetros

CampoEnTipoDescripción
idobligatoriorutastring
The alert address's id.
  • formato: uuid
tokenobligatoriorutastring
The alert address's secret.
Titlecabecerastring
The alert's title.
Prioritycabecerastring
1-5, or min, low, default, high, urgent.
Tagscabecerastring
Comma-separated tags.
Clickcabecerastring
An http or https link the alert opens.
Actionscabecerastring
View actions: view, Label, https://link; separated by semicolons.
Markdowncabecerastring
yes to render the message as Markdown.
X-Dedup-Keycabecerastring
Repeats with the same key fold into one alert for an hour.

Petición de ejemplo

curl -X POST "https://polaris.example.com/api/alerts/{id}/{token}" \
  -H "Authorization: Bearer $POLARIS_API_KEY"

Respuestas

EstadoQué es
200OK

También puede dar los errores comunes 400, 401, 403, 404, 429. Ver errores comunes