MailSlurp logo

Domain monitor schedules and alerts

Documentation navigation
Search documentation

Schedule domain checks and route severity-based alerts to email, Slack, Teams or a webhook.

View MarkdownAgent setup

Create a saved domain monitor before adding alerts. Choose a check interval that fits how quickly your team needs to detect a DNS or sender change. Use an immediate run after an intentional configuration change instead of waiting for the next scheduled check.

Enable a schedule

Set schedulingEnabled: true and intervalSeconds when creating or updating the monitor. For example, 86400 requests a daily interval. Turning scheduling off pauses future scheduled checks; an explicit run-now request is still permitted.

PUT /domain-monitor/monitors/{monitorId}

Update domain monitor

Request, parameters, and responses

Path parameters

NameTypeRequiredDescription
monitorIdstring:uuidYes

Request body (required)

UpdateDomainMonitorOptions application/json
FieldTypeRequiredDescription
namestringNoOptional display name
intervalSecondsinteger:int64NoInterval in seconds
enabledbooleanNoEnable/disable scheduled monitor runs (legacy alias for schedulingEnabled)
schedulingEnabledbooleanNoEnable/disable scheduled monitor runs. Direct run-now remains available.
Request example
{
  "name": "Example name",
  "intervalSeconds": 1,
  "enabled": true,
  "schedulingEnabled": true
}

Responses

StatusSchemaDescription
200DomainMonitorDtoOK
HTTP and SDK snippets

HTTP

HTTP
PUT /domain-monitor/monitors/00000000-0000-4000-8000-000000000000 HTTP/1.1
Host: api.mailslurp.com
x-api-key: YOUR_API_KEY
Accept: application/json
Content-Type: application/json

{
  "name": "Example name",
  "intervalSeconds": 1,
  "enabled": true,
  "schedulingEnabled": true
}

cURL

cURL
curl -X PUT "https://api.mailslurp.com/domain-monitor/monitors/00000000-0000-4000-8000-000000000000" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  --data '{"name":"Example name","intervalSeconds":1,"enabled":true,"schedulingEnabled":true}'

JavaScript SDK

JavaScript SDK
import { Configuration, DomainMonitorControllerApi } from "mailslurp-client";

const config = new Configuration({ apiKey: "YOUR_API_KEY" });
const domainMonitorController = new DomainMonitorControllerApi(config);
const request = {
  "monitorId": "00000000-0000-4000-8000-000000000000",
  "updateDomainMonitorOptions": {
    "name": "Example name",
    "intervalSeconds": 1,
    "enabled": true,
    "schedulingEnabled": true
  }
};

const result = await domainMonitorController.updateDomainMonitor(request);

Python SDK

Python SDK
import mailslurp_client
from mailslurp_client.api.domain_monitor_controller_api import DomainMonitorControllerApi

configuration = mailslurp_client.Configuration()
configuration.api_key["x-api-key"] = "YOUR_API_KEY"

with mailslurp_client.ApiClient(configuration) as api_client:
    domainMonitorController = DomainMonitorControllerApi(api_client)
    update_domain_monitor_options = {
      "name": "Example name",
      "intervalSeconds": 1,
      "enabled": True,
      "schedulingEnabled": True
    }
    result = domainMonitorController.update_domain_monitor("00000000-0000-4000-8000-000000000000", update_domain_monitor_options)

Keep one history for the domain when changing its interval. Creating a new monitor for every check makes it harder to compare the same sender over time.

Choose an alert destination

An alert sink belongs to one monitor. It specifies a destination type, target, minimum severity and enabled state.

Destination Setup
Email Use an address monitored by the people responsible for the sender.
Webhook Use an HTTPS receiver in your operations system.
Slack or Teams Configure the destination required by the monitor's alert settings, then select the severity.

Start with HIGH when only urgent findings should interrupt the team, or MEDIUM when the channel is used for regular sender review. The supported thresholds are LOW, MEDIUM, HIGH and CRITICAL.

// Add an alert sink and get the verification address for observed auth samples.
const alertSink =
  await mailslurp.domainMonitorController.createDomainMonitorAlertSink({
    monitorId: monitor.id,
    createDomainMonitorAlertSinkOptions: {
      type: "EMAIL",
      target: YOUR_ALERT_EMAIL,
      severityThreshold: "MEDIUM",
      enabled: true,
    },
  });

const verification =
  await mailslurp.domainMonitorController.createDomainMonitorEmailVerificationAddress({
    monitorId: monitor.id,
  });

console.log({
  alertTarget: alertSink.target,
  verificationAddress: verification.emailAddress,
  verificationStatus: verification.status,
});

This example uses the mailslurp client and monitor from the setup page. Set YOUR_ALERT_EMAIL to your team address. It creates an email sink and a verification address for receiving authentication samples.

POST /domain-monitor/monitors/{monitorId}/alert-sinks

Create alert sink for monitor

Request, parameters, and responses

Path parameters

NameTypeRequiredDescription
monitorIdstring:uuidYes

Request body (required)

FieldTypeRequiredDescription
typeenum: EMAIL | WEBHOOK | SLACK | TEAMSYes
targetstringYes
severityThresholdenum: LOW | MEDIUM | HIGH | CRITICALNo
enabledbooleanNo
Request example
{
  "type": "EMAIL",
  "target": "value",
  "severityThreshold": "LOW",
  "enabled": true
}

Responses

StatusSchemaDescription
201DomainMonitorAlertSinkDtoCreated
HTTP and SDK snippets

HTTP

HTTP
POST /domain-monitor/monitors/00000000-0000-4000-8000-000000000000/alert-sinks HTTP/1.1
Host: api.mailslurp.com
x-api-key: YOUR_API_KEY
Accept: application/json
Content-Type: application/json

{
  "type": "EMAIL",
  "target": "value",
  "severityThreshold": "LOW",
  "enabled": true
}

cURL

cURL
curl -X POST "https://api.mailslurp.com/domain-monitor/monitors/00000000-0000-4000-8000-000000000000/alert-sinks" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  --data '{"type":"EMAIL","target":"value","severityThreshold":"LOW","enabled":true}'

JavaScript SDK

JavaScript SDK
import { Configuration, DomainMonitorControllerApi } from "mailslurp-client";

const config = new Configuration({ apiKey: "YOUR_API_KEY" });
const domainMonitorController = new DomainMonitorControllerApi(config);
const request = {
  "monitorId": "00000000-0000-4000-8000-000000000000",
  "createDomainMonitorAlertSinkOptions": {
    "type": "EMAIL",
    "target": "value",
    "severityThreshold": "LOW",
    "enabled": true
  }
};

const result = await domainMonitorController.createDomainMonitorAlertSink(request);

Python SDK

Python SDK
import mailslurp_client
from mailslurp_client.api.domain_monitor_controller_api import DomainMonitorControllerApi

configuration = mailslurp_client.Configuration()
configuration.api_key["x-api-key"] = "YOUR_API_KEY"

with mailslurp_client.ApiClient(configuration) as api_client:
    domainMonitorController = DomainMonitorControllerApi(api_client)
    create_domain_monitor_alert_sink_options = {
      "type": "EMAIL",
      "target": "value",
      "severityThreshold": "LOW",
      "enabled": True
    }
    result = domainMonitorController.create_domain_monitor_alert_sink("00000000-0000-4000-8000-000000000000", create_domain_monitor_alert_sink_options)
GET /domain-monitor/monitors/{monitorId}/alert-sinks

List alert sinks for monitor

Request, parameters, and responses

Path parameters

NameTypeRequiredDescription
monitorIdstring:uuidYes

Responses

StatusSchemaDescription
200DomainMonitorAlertSinkDto[]OK
HTTP and SDK snippets

HTTP

HTTP
GET /domain-monitor/monitors/00000000-0000-4000-8000-000000000000/alert-sinks HTTP/1.1
Host: api.mailslurp.com
x-api-key: YOUR_API_KEY
Accept: application/json

cURL

cURL
curl -X GET "https://api.mailslurp.com/domain-monitor/monitors/00000000-0000-4000-8000-000000000000/alert-sinks" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Accept: application/json"

JavaScript SDK

JavaScript SDK
import { Configuration, DomainMonitorControllerApi } from "mailslurp-client";

const config = new Configuration({ apiKey: "YOUR_API_KEY" });
const domainMonitorController = new DomainMonitorControllerApi(config);
const request = {
  "monitorId": "00000000-0000-4000-8000-000000000000"
};

const result = await domainMonitorController.getDomainMonitorAlertSinks(request);

Python SDK

Python SDK
import mailslurp_client
from mailslurp_client.api.domain_monitor_controller_api import DomainMonitorControllerApi

configuration = mailslurp_client.Configuration()
configuration.api_key["x-api-key"] = "YOUR_API_KEY"

with mailslurp_client.ApiClient(configuration) as api_client:
    domainMonitorController = DomainMonitorControllerApi(api_client)
    result = domainMonitorController.get_domain_monitor_alert_sinks("00000000-0000-4000-8000-000000000000")

Investigate a missing alert

Check that the monitor's schedule is enabled, a run has completed, the alert sink is enabled and the finding meets the severity threshold. Inspect the actual run: an unchanged or lower-severity result may not be the event you expected. Confirm the destination configuration before broadening the alert threshold.

Use notification settings for account and device-render notifications. Domain-monitor sinks have their own monitor-specific configuration. Read monitor results to investigate the evidence behind an alert.