• /
  • Log in

Customize your webhook payload

If you use webhooks as your alerts notification channel, you can use the default values. You can also customize the payload in the POST message for further integration into your system.

Define webhooks

When defining JSON webhooks, use the format "name":"value",. For example:

"current_state":"acknowledged",

When defining static webhook variables in a form payload, use the format name="value". For example:

current_state="acknowledged"

Do not include any custom, self-signed SSL certificates in your webhook. Our agents enable SSL by default. Due to our security policy, custom SSL certificates will not be imported into our Trust store.

Webhook values

We support these default dynamic webhook values. For your convenience, they are listed in alphabetical order, but you can define your webhook values in any order. You may also add custom variables by using your own key/value pairs.

Key

Variable

"account_id"

$ACCOUNT_ID

Possible values: New Relic account ID (string)

"account_name"

$ACCOUNT_NAME

Possible values: New Relic account name (string)

"closed_violations_count_critical"

$CLOSED_VIOLATIONS_COUNT_CRITICAL

"closed_violations_count_warning"

$CLOSED_VIOLATIONS_COUNT_WARNING

"condition_id"

$CONDITION_ID

"condition_description"

$DESCRIPTION

This includes the description field from the alert condition, if there is one.

"condition_name"

$CONDITION_NAME

Possible values: (user-defined string)

"current_state"

$EVENT_STATE

Possible values: [open|acknowledged|closed]

"details"

$EVENT_DETAILS

"duration"

$DURATION

"event_type"

$EVENT_TYPE

Possible values: [INCIDENT]

"incident_acknowledge_url"

$INCIDENT_ACKNOWLEDGE_URL

"incident_id"

$INCIDENT_ID

"incident_url"

$INCIDENT_URL

"metadata"

$METADATA

Currently used only for Synthetic monitoring multi-location failure conditions.

"open_violations_count_critical"

$OPEN_VIOLATIONS_COUNT_CRITICAL

"open_violations_count_warning"

$OPEN_VIOLATIONS_COUNT_WARNING

"owner"

$EVENT_OWNER

"policy_name"

$POLICY_NAME

Possible values: (user-defined string)

"policy_url"

$POLICY_URL

"runbook_url"

$RUNBOOK_URL

"severity"

$SEVERITY

Possible values: [CRITICAL]

"targets"

$TARGETS

The $TARGETS variable cannot be used with FORM data, but is compatible with JSON data.

For static NRQL faceted alerts, the name of the facet that triggered the alert will be populated in the target’s name field.

For a description of the available fields, see Target values.

"timestamp"

$TIMESTAMP

"timestamp_utc_string"

$TIMESTAMP_UTC_STRING

A human-readable timestamp in the YYYY-MM-DD, HH:MM UTC format.

"version"

$VERSION

"violation_callback_url"

$VIOLATION_CALLBACK_URL

"violation_chart_url"

$VIOLATION_CHART_URL

Targets values

This section describes the $TARGETS field in your webhook. This data is not customizable and is provided here for reference. Your $TARGETS contain a list of zero or more targets (entities). Each target is described by a JSON object with the following fields.

Key

Variable

"id"

ID of the target or entity

"name"

Name of the target or entity

"labels"

Combined entity tags and NRQL facets that are derived from the condition evaluation and available entity tags.

"link"

URL link to this target or entity.

"product"

Type of product for this target or entity; for example, APM

"type"

Type of target or entity under product; for example, Application

Webhook format example

The following examples show a webhook payload using both the default dynamic variables and a custom variable. You can use some or all of the dynamic variables, along with any custom variables, to define your own payload.

For more help

If you need more help, check out these support and learning resources:

Create issueEdit page
Copyright © 2021 New Relic Inc.