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": "sue.bloggs@squaredup.com"
}

Custom Notifications Guide

Note

You can use a site like https://webhook.site to experiment with custom notifications before integrating with your destination.

In SquaredUp, a custom destination consists of a URL endpoint and a JSON Body that is sent to the URL via a POST request.

You can also define any additional Query parameters that need to be attached to the URL.

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
Description
Monitor usage
{{stateSymbol}}
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.
All
{{name}}
Name of the monitored object. Typically a workspace name or a tile name.
All
{{oldState}}
The state of the monitored object before the latest state change.
All
{{newState}}
The state that the monitored object has just transitioned to.
All
{{link}}
Link to the monitored object in SquaredUp. Typically a link to a workspace or dashboard.
All
{{{notificationsConfigLink}}}
Link to the relevant monitoring configuration in SquaredUp.
All
{{stateReason}}
A 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}}
Tile monitors
{{{imagePreviewUrl}}}
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}}
Tile monitors
{{workspaceName}}
Name of the workspace that contains the monitored object.
All
{{{workspaceLink}}}
Link to the workspace that contains the monitored object.
All
{{dashboardName}}
Name of the dashboard containing the tile monitor.
Tile monitors
{{{dashboardLink}}}
Link to the dashboard that contains the monitored object.
Tile monitors
{{tileName}}
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}}
Tile monitors
{{tileData}}
The JSON tile data of the tile where the monitor notification was fired.
Tile monitors

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}}.

Including tile data

For tile monitor notifications, you can include the data displayed by the monitored tile using the {{tileData}} variable.

Tile data is only generated when an alert targets a specific tile monitor and one of its configured notification channels requires tile data. It is not generated for alerts configured to match all tiles in a workspace. This reduces unnecessary processing and network usage.

Tile data is returned as a JSON object. Each dataset contains:

  • columns: The included column names.
  • rows: The tile data, with each row represented as an array of values matching the column order.
  • truncated: Indicates whether the data was shortened to meet the notification payload limit.

For example:

{
  "deploymentPerformance": {
    "columns": [
      "Timestamp",
      "Service",
      "Environment",
      "Status",
      "DurationSeconds"
    ],
    "rows": [
      [
        "2026-07-23T09:42:00.000Z",
        "checkout-api",
        "Production",
        "Succeeded",
        184
      ]
    ],
    "truncated": false
  },
  "text": "Latest deployment performance"
}

To include the tile data as a JSON property in the webhook body, use triple braces so that the JSON is inserted without being escaped:

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

Where necessary, SquaredUp may truncate the tile data included in the notification. Check the truncated property for each dataset to determine whether all rows were included.

Payload size and truncation

The maximum size of the tile data payload is currently 100 KB.

If the tile data exceeds this limit, it is truncated after the last complete row that fits within the payload. The dataset's truncated property is then set to true.

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. Add a new notification destination by doing one of the following:

    • Navigate to Monitors and click Add notification rule.
    • Navigate to Settings > Notifications and click Add destination.
  2. Select the destination to configure. If prompted, click Add destination

    . The Add destination window displays.

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

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

  5. Query parameters:
    Click Add query parameter

    to include additional key:value pairs in your request URL. Each parameter is appended to the query string when the request is sent.

    Toggle encryption for a parameter value using the encrypt icons

    /
    next to it.

  6. Body:
    Enter the JSON body for the channel.
  7. Test:
    Click to send a test message and check that it is working as expected.

  8. In SquaredUp Add a notification rule to configure when a notification should be sent, and select this destination. For Scheduled sharing select this destination on the Destination tab.

Was this article helpful?


Have more questions or facing an issue?