コンテンツにスキップ

Yagra's built-in subject and body for a node alert, written as templates, once per lifecycle point.

GET
/api/v1/notification-channels/builtin-template
curl --request GET \
--url 'https://example.com/api/v1/notification-channels/builtin-template?kind=webhook' \
--header 'Authorization: Bearer <token>'

The template editor shows this text for a channel that has no template, so an operator sees what is sent today and can start from it. Rendering it produces exactly the built-in subject and body for that channel kind. A poller pool’s and a Meraki organization’s alerts have built-in wording of their own, which is not described here. Webhook and PagerDuty have no body template: their built-in body is the whole alert as JSON.

kind

A delivery channel kind.

string
Allowed values: webhook email pagerduty jsm

The channel kind. JSM and email name the node in their built-in subject; webhook and PagerDuty carry its id. Omitted means webhook, which is what this endpoint described before the parameter existed.

The built-in subject and body of a node alert as templates, for fire, resolve and suppress

Media typeapplication/json
Array<object>

One lifecycle point’s built-in subject, written as a template.

object
body

The template that renders Yagra’s built-in body for a node alert at this point (ADR-197). null for webhook and PagerDuty, whose built-in body is the whole alert as JSON and is not a template.

string | null
event
required

fire, resolve, or suppress.

string
Allowed values: fire resolve suppress
subject
required

The template that renders Yagra’s built-in subject for a node alert at this point.

string
Example
[
{
"event": "fire"
}
]

No valid bearer token

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

Role lacks ManageSystem

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}