set_alert_template
Set or clear a single alert message template on a monitor. The template is validated for allowed variables before saving. Pass an empty string for template to reset that entry to the built-in default. All other existing templates are preserved (read-modify-write). Available variables: {check_name}, {event}, {status}, {cause}, {last_ping}, {schedule}, {incident_url}, {run_url}, {branch}, {commit}, {actor}, {failing_stage}, {duration}, {latency}, {status_code}, {url}, {last_step}, {step_count}, {run_duration}, {body}, {detail}, {title}. {failing_stage} is CI-only and provider-dependent: always populated on GitLab; on GitHub only if the repository webhook also subscribes to the workflow_job event; never on Jenkins, whose Notification Plugin payload carries no step detail. {body} is the triggering ping's own text (pings.body_excerpt) — it is how a 'blocked' or 'note' event's reason reaches the alert, and a custom template is the only way to control where in the message it appears. {title} is the title of the run the alert is about — the free-text body posted with that run's /start ping. Populated for 'fail' (when the failing ping's rid resolves to a titled /start) and for 'stalled'/'overrun' under the same run-identification rule as {last_step}; empty otherwise, including for any run with no title, which is every run until a caller starts posting one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Monitor UUID. | |
| cause | No | Optional cause for a per-cause override (e.g. 'silence', 'overrun', 'never_started', 'stalled', 'runaway'). Omit or leave empty for an event-type-wide template. | |
| template | Yes | Template text with {variable} placeholders. Empty string resets to the built-in default. | |
| event_type | Yes | Event type: 'down', 'recovery', 'fail', 'every-run', 'success', 'started', 'blocked', 'note'. |