LogoDark mode logo
LogoDark mode logo
Contact SupportLoading Light/Dark Toggle

  • Getting started
  • Perspectives
  • Tile Editor
  • Sharing
  • Data streams
  • Objects
  • Data Explorer
  • Users and groups
  • Monitors
    • Adding a custom webhook destination
    • Adding an email destination
    • Adding a ServiceNow destination
    • Adding a Slack destination
    • Adding a Teams destination
    • Adding a Zapier destination
  • Workspaces
  • Organization home
  • Access control
  • KPI
  • Map
  • Search

Data sources

first stepsnotificationsadding a custom webhook destination

Adding a custom webhook destination

This feature is available with a Pro or Enterprise plan

When configuring notifications in SquaredUp, you can specify a custom webhook to be used as a notification destination.

While configuring a custom webhook is more complex than the other available destination options it is also powerful, allowing you to send a notification to any HTTP POST endpoint.

For example, you can use a third-party service like https://apify.com/ to send a customized email.

Configuring a custom webhook

The JSON body of the webhook request is customizable, using inserts to specify elements of the notification – including the name of the monitored entity (e.g. SquaredUp Workspace name), the previous and new states, and a link back to the SquaredUp app.

This is an example of the JSON body:

{
  "text": "{{stateSymbol}} {{name}} changed from {{oldState}} to {{newState}}.",
  "link": "{{link}}"
}
This is just an example, and will need to be edited to match the requirements of the particular webhook being used. For example, this JSON is in the structure required for sending emails through apify.com:
{
  "subject": "{{stateSymbol}} {{name}} has changed from {{oldState}} to {{newState}}.",
  "html": "Hi there t<p>{{stateSymbol}} The health of <b><a href='{{link}}'>{{name}}</a></b> has changed from <b>{{oldState}}</b> to <b>{{newState}}</b>.<p style='color:blue;font-size:0.9em''><em>Brought to you by SquaredUp Alerts™</em>",
  "to": "[email protected]"
}

Custom Notifications Guide

A custom notification destination consists of a URL and a template for the message body that is POST-ed to the URL.

A web site like https://webhook.site can be used to experiment with custom notifications before integrating with your destination.

Supported webhooks

The webhook must take a JSON body passed via POST. It is not possible to pass headers. Authentication is not supported. The URL can include query parameters but they must be fixed - the URL cannot contain variables like the body.

Template structure

The body of the notification must be specified as a template. The template specifies the structure of the JSON passed to the webhook, along with variables that are replaced with details of the notification when each notification is sent.

A simple webhook body structure is

{
	"text": "{{stateSymbol}} {{name}} changed from {{oldState}} to {{newState}}."
}

The JSON is an object with a single text property. This structure works for many destinations - Slack, Teams, Google Chat etc. However, often more advanced structures can be used to give more options and more sophisticated formatting. Consult the documentation for the destination system to discover all of the options. A web search for incoming webhook and your destination type may prove useful.

Template variables

Template variables use the Mustache syntax. The following parameters are available.

Variable
Notification Types
Example
Notes
{{stateSymbol}}
All
Visual indicator for the state of the workspace or tile. Red for error, orange for warning, green for success and gray for unknown.
Note that this is a Unicode character rather than an image. It may not render correctly on all environments.
{{name}}
All
App ABC Response Time
Name of the monitored object. Typically a workspace name or a tile name.
{{oldState}}
All
Warning
The state of the monitored object before the latest state change.
{{newState}}
All
Error
The state that the monitored object has just transitioned to.
{{link}}
All
http://app.squaredup.com/dashboard/dash-snzu2jsbnVwNA00zdWt3
Link to the monitored object in SquaredUp. Typically a link to a workspace or dashboard.
{{{notificationsConfigLink}}}
All
http://app.squaredup.com/monitoring/space-eje3K958peQJJTiziriF
Link to the relevant monitoring configuration in SquaredUp.
{{stateReason}}
Tile monitors
Duration mean for the last 24 hours is 557, which is greater than the error threshold 500
An English description of the reason the monitored object changed state. Use a conditional block to only render when the reason is available, e.g. {{#stateReason}}State reason is: {{stateReason}}.{{/stateReason}}
{{{imagePreviewUrl}}}
Tile monitors
https://s3.amazonaws.com/squaredup-account-common-notify-images-dev/transient/f976ed8e-ace7-4ad1-887e-41d28e394039.png
A link to an image that shows the tile shortly after the state change. Use a conditional block to only render when the image is available, e.g. {{#imagePreviewUrl}}Tile preview: {{{imagePreviewUrl}}}{{/imagePreviewUrl}}
{{workspaceName}}
All
Application ABC
Name of the workspace that contains the monitored object.
{{{workspaceLink}}}
All
http://app.squaredup.com/workspace/space-eje3K958peQJJTiziriJ
Link to the workspace that contains the monitored object.
{{dashboardName}}
Tile monitors
Application ABC Performance
Name of the dashboard containing the tile monitor.
{{{dashboardLink}}}
Tile monitors
http://app.squaredup.com/dashboard/dash-snzu2jsbnVwNA00zdWt3
Link to the dashboard that contains the monitored object.
{{tileName}}
Tile monitors
EC2 Server Response Time
Name of the tile whose monitor has changed state. As this is only populated for tile monitors, it can be useful for conditional blocks based on whether the notification is for a tile monitor or a workspace, e.g. {{#tileName}}This is tile monitor notification!{{/tileName}}

Template variable tips

Normal text variables should use double-curly-brackets, e.g. {{name}}.

URLs should use triple-curly-brackets to avoid being broken by escaping, e.g. {{{link}}}.

Some variables are not populated for all notification types. To make a section of the template conditional on a variable having a value, use a conditional block, e.g. {{#var1}} This is only included if var1 has a value{{/var1}}.

Examples

Plain text

A simple notification that supports all notification types but does not include any details for tile monitor notifications. This will work with many destination types including Slack, Teams and Google Chat.

{
	"text": "{{stateSymbol}} {{name}} changed from {{oldState}} to {{newState}}. View in SquaredUp: {{{link}}}"
}
Plain text with tile monitor details (state reason, tile preview link):

This will work with many destination types including Slack, Teams and Google Chat.

{
	"text": "{{stateSymbol}} {{name}} changed from {{oldState}} to {{newState}}. {{#stateReason}}{{stateReason}}. {{/stateReason}}{{#imagePreviewUrl}}Tile preview: {{imagePreviewUrl}}. {{/imagePreviewUrl}}View in SquaredUp: {{{link}}}. Change your notification preferences: {{{notificationsConfigLink}}}"
}

Rich formatting using Slack ‘blocks’:

This will only work with Slack.

{
	"blocks": [
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "{{stateSymbol}} *<{{{link}}}|{{name}}>* changed from {{oldState}} to *{{newState}}*.{{#stateReason}}\n {{stateReason}}.{{/stateReason}}{{#tileName}}\nThis monitor is part of the <{{{dashboardLink}}}|*{{dashboardName}}*> dashboard in the <{{{workspaceLink}}}|*{{workspaceName}}*> workspace.{{/tileName}}{{#imagePreviewUrl}}\nTile preview <{{imagePreviewUrl}}|here>.{{/imagePreviewUrl}}\nChange your notification preferences <{{{notificationsConfigLink}}}|here>."
			}
		}
	]
}

Rich formatting using Teams ‘MessageCard’

This will only work with MS Teams.

{
	"@context": "https://schema.org/extensions",
	"@type": "MessageCard",
	"themeColor": "5D3FD3",
	"text": "{{stateSymbol}} [**{{name}}**]({{&link}}) changed from {{oldState}} to **{{newState}}**.",
	"sections": [
		{
			"text": "{{#stateReason}}{{stateReason}}. {{/stateReason}}{{#tileName}}This monitor is configured on the [**{{dashboardName}}**]({{&dashboardLink}}) dashboard in the [**{{workspaceName}}**]({{&workspaceLink}}) workspace.{{#imagePreviewUrl}}![Tile preview]({{&imagePreviewUrl}}){{/imagePreviewUrl}}{{/tileName}}",
			"potentialAction": [
				{
					"@type": "OpenUri",
					"name": "View",
					"targets": [
						{ "os": "default", "uri": "{{{link}}}" }
					]
				}
			]
		},
		{
			"text": "Change your notification preferences [**here**]({{{notificationsConfigLink}}})."
		}
	]
}

Adding a destination in SquaredUp

  1. A new destination can be configured when adding a notification rule in the Monitors section inside a workspace, or under Settings > Notifications

  2. Destination Name:
    Enter a name for your destination. This helps you to identify this destination in the list of your destinations.

  3. URL:
    Paste the webhook URL to configure the destination in SquaredUp.

  4. Body:
    Enter the JSON body for the channel.
  5. Test:
    Click to send a test notification and check that it is working as expected.

Was this article helpful?


Have more questions or facing an issue?
Submit a ticket

On this page

  • Configuring a custom webhook
  • Custom Notifications Guide
  • Supported webhooks
  • Template structure
  • Template variables
  • Template variable tips
  • Examples
  • Adding a destination in SquaredUp

Footer

Sites

  • SquaredUp
  • SQUAREDUP DS
  • DOWNLOAD
  • COMMUNITY ANSWERS

Quick Links

  • Contact Support
  • Events
  • Careers

Small Print

  • Privacy Policy
  • Terms and Conditions
YoutubeX (Twitter)LinkedInBlueSky

© SquaredUp 2025