Set alert template
set_alert_templateRequires the write scope or higher. Sets or clears one alert message template on a monitor; every other template is kept (read-modify-write). The template is validated for allowed variables before saving, and an empty template resets that entry to the built-in default. Event types: 'down', 'recovery', 'fail', 'every-run', 'success', 'started', 'blocked', 'note', 'expiring'. The template argument lists the variables.
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', 'upstream'; 'cert' or 'domain' for 'expiring'). Omitted or empty: an event-type-wide template. | |
| template | Yes | Template text with {variable} placeholders; an empty string resets to the default. 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}, {reminder}, {open_for}, {subject}, {expires_in}, {expires_at}, {issuer}, {registrar}, {monitors}. {failing_stage}: CI only (GitLab; GitHub workflow_job). {body}: the ping's text. {title}: the run's title. {reminder}, {open_for}: a reminder's number and age. {subject} to {monitors}: 'expiring' only. | |
| event_type | Yes | Event type: 'down', 'recovery', 'fail', 'every-run', 'success', 'started', 'blocked', 'note', 'expiring'. |