Skip to content

Alerts

API information

The alert resource is managed by the Alerts API.

XPKit Portal

It is recommended distributions are created in XPKit Portal, and alerts are triggered by your applications making direct API requests.

Service URLs

Region URL
AMER https://alerts.amer.xpkit.net
APAC https://alerts.apac.xpkit.net
China https://alerts.china.xpkit.cn
EMEA https://alerts.emea.xpkit.net

OpenAPI Specification

Resource names Documentation Download
Alert, Distribution View Link

Example distribution configuration

{
    "list_id": "network-alerts",
    "name": "Network alerts",
    "channels": {
        "email": {
            "template": "https://abc.s3.amazonaws.com/capacity-alert.html",
            "addresses": [
                "project-managers@abc.com",
                "development-team@abc.com"
            ]
        },
        "sentry": {
            "configs": [
                "sentry_dsn": "https://xxx@o110861.ingest.sentry.io/xxx",
                "name": "Company Sentry account"
            ]
        },
        "slack": {
            "configs": [
                {
                    "channel": "#alerts",
                    "webhook": "https://hooks.slack.com/services/xxx/xxx",
                    "name": "Company Slack account"
                }
            ]
        },
        "teams": {
            "configs": [
                {
                    "webhook": "https://outlook.office.com/webhook/xxx/IncomingWebhook/xxx/xxx",
                    "name": "Company Teams account"
                }
            ]
        }
    }
}

Notes on using the email channel

When selecting the email channel you need to provide a link to a HTML template that should be used for the alerts. In your template you can add personalisation tags using hypens to prefix and suffix the tag. For example: -title- and -error_message-.

Example alert trigger request

{
    "distribution_list": "network-alerts",
    "context": {
        "title": "Failed to establish a new connection",
        "error_message": "nodename nor servname provided, or not known"
    },
    "channel_context": {
        "sentry": {
            "culprit": "company.project.class.method"
        },
        "slack": {
            "title": "[Slack specific title] Connection error"
        }
    }
}

Notes on alerts and distributions

  • Do not provide a list_id field in distribution CRUD requests. The field will be ignored and auto generated from the provided name field.
  • The list_id field should be used when calling the trigger alert endpoint as the distribution_list field (see API spec).