Checks

Replace alert templates for a check

Replaces the complete set of custom alert message templates for the check (replace-the-set semantics).

  • Keys present in the body with a non-empty string → stored as the custom template for that key.
  • Keys absent from the body or mapped to an empty string → the custom template is deleted and the built-in default text is used instead.

All entries are validated before any writes: if any key is invalid or any template body references an unknown {variable}, the entire request is rejected with 400 and nothing is written.

Key format: bare event type (down, recovery, fail, every-run, success, started, blocked, note) or event_type/cause for a per-cause override (e.g. "down/silence", "down/overrun", "down/never_started", "fail/runaway"). Per-cause entries take priority over the event-type-wide entry for that event.

Returns the resulting set (same shape as GET) on success.

put/api/v1/checks/{id}/templates

Request

  • Base URL: https://app.lastping.dev
  • URL: https://app.lastping.dev/api/v1/checks/{id}/templates
  • Auth: API key in header X-Api-Key

Request body

templatesobject required

Map of template key → template body.

Keys are a bare event type (down, recovery, fail, every-run, success, started, blocked, note) or event_type/cause (e.g. "down/silence", "down/overrun", "down/never_started", "fail/runaway").

Absent keys or empty-string values reset that key to the built-in plain-language default.

Example request

{
  "templates": {
    "down": "[LastPing] {check_name} is down.",
    "down/silence": "[LastPing] {check_name} hasn't checked in; last seen {last_ping}."
  }
}

Response

Resulting custom templates after applying the replace-the-set operation.

templatesobject required

Map of template key → custom template body.

Key format:

  • Event-type-wide: "down", "fail", "recovery", "every-run", "success", "started", "blocked", "note".
  • Per-cause override: "event_type/cause", e.g. "down/silence", "down/overrun", "down/never_started", "fail/runaway". Per-cause keys take priority over the event-type-wide key.

Only keys with a custom template are included; absent keys fall back to the per-cause built-in default, then to the event-type-wide custom template, then to the built-in default text.

Example response

{
  "templates": {
    "down": "[LastPing] {check_name} is down.",
    "down/silence": "[LastPing] {check_name} hasn't checked in; last seen {last_ping}.",
    "fail": "{failing_stage} failed on {branch} — {run_url}."
  }
}

Changes

No recorded changes to this operation across all 2 revisions of this API.