Skip to main content
Alerting & Response/Alert Templates
POSTAlertingSince 1.0SynchronousAuth Required

RenderAlertTemplate

Render a template with sample data to preview the output

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • contentStringRequired

    Template content to render

    Example: # Alert: {{.AlertName}}

  • formatStringRequired

    Template format for rendering

    Example: markdown

  • payloadStringRequired

    JSON payload data for template variable substitution

    Example: {"AlertName": "High CPU"}

Responses

200 OK

On success, this API returns the following response structure.

  • outputString

    Rendered template output

    Example: # Alert: High CPU

  • errorString

    Error message if rendering failed

    Example: connection refused

Endpoint

POST/api/v1/alerting/templates/render

/api/v1/alerting/templates/render

Operation ID

RenderAlertTemplate

Permalink

Request Example

curl -X POST '{host}/api/v1/alerting/templates/render' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"content":"# Alert: {{.AlertName}}","format":"markdown","payload":"{\"AlertName\": \"High CPU\"}"}'

Response Example

200
{
  "output": "# Alert: High CPU",
  "error": "connection refused"
}

Change History

This API has no change history records yet.

View all change history