Alerts API

API link: Swagger UI

Create an alert

To create a new alert, use the API https://api.emailconsul.com/api/v1.0/doc/#/Alerts/post_alerts

Get an alert

To get an alert by id, use the API https://api.emailconsul.com/api/v1.0/doc/#/Alerts/get_alerts__id_

Update an alert

To update an alert by id, use the API https://api.emailconsul.com/api/v1.0/doc/#/Alerts/put_alerts__id_

Delete an alert

To delete an alert by id, use the API https://api.emailconsul.com/api/v1.0/doc/#/Alerts/delete_alerts__id_

Get an alert logs

To get logs for a specific alert, use the API https://api.emailconsul.com/api/v1.0/doc/#/Alerts/get_alerts__id__log

Get all alerts

To get list of all alerts, use the API https://api.emailconsul.com/api/v1.0/doc/#/Alerts/get_alerts

Get alerts stats

To get stats for alerts us APIs:

Timeseries stats:

Aggregated stats:

Alert fields description

{string} id - Unique identifier of the document

{string} name - Name of the alert

{string} profile_id - Profile ID that an alert is attached to

{boolean} is_active - Whether the alert is active or not

{boolean} is_in_daily_report - Whether the alert will be added as part of the daily report. Works only if the daily report is configured to include alerts.

{boolean} is_instant_alert - Whether the alert will be sent to an email immediately after it is triggered. Works in conjunction with the instant_alert_email_email field.

{string} instant_alert_email_email - an email where to send an instant alert. Works in conjunction with the is_instant_alert field.

{string} webhook_url - If set, the alert will be sent as a POST request to this URL immediately after it is triggered (see Webhook payloads).

{array} rules - Set of rule configs (see Rules description).

An alert is considered to happen only if all events related to the rules are triggered within the last 24 hours. Works in conjunction with the formula field and rule.key field.

NOTE: As of now, rules supports only one rule, which means one alert = one rule. Sending multiple rules to the rules + formula will have no results, and only the first rule in the array will be applied.

{Date} created_at - Timestamp when a rule was created

{Date} updated_at - Timestamp of last rule update

Rules description

{string} type - rule type. Every rule type has its own settings (see Rule Types).

{string} key - works in conjunction with formula and if more than one rule in the alert. Currently unsupported.

Rule types

IP_IN_RBL - if an IP is listed on a blocklist.

Required rule fields:

{array<string>} ips - an array of IPs OR an array with one string ALL_IPS.

Examples:

  • ['1.1.1.1', '123.123.123.123']

  • ['ALL_IPS']

{array<string>} rbls - an array of blocklist hosts OR an array with one string HIGH_REPUTATION.

See https://api.emailconsul.com/api/v1.0/doc/#/Checkers/get_checkers_rbl_dictionary to get the list of available rbl hosts.

Examples:

  • ['hostname.one', 'hostname.two']

  • ['HIGH_REPUTATION']

DOMAIN_IN_RBL - if a domain is listed on a blocklist.

Required rule fields:

{array<string>} domains - an array of domains OR an array with one string ALL_DOMAINS.

Examples:

  • ['domain.one', ‘domain.twoʼ]

  • ['ALL_IPS']

{array<string>} rbls - an array of blocklist hosts OR an array with one string HIGH_REPUTATION.

See https://api.emailconsul.com/api/v1.0/doc/#/Checkers/get_checkers_rbl_dictionary to get the list of available rbl hosts.

Examples:

  • ['hostname.one', 'hostname.two'']

  • ['HIGH_REPUTATION']

GP_DOMAIN_REPUTATION - if a domain in Google Postmaster is in Bad/Low/Medium/High reputation

Required rule fields:

{array<string>} gp_domains - an array of domains OR an array with one string ALL_GP_DOMAINS.

Examples:

  • ['domain.one', 'domain.two']

  • ['ALL_GP_DOMAINS']

{array<string>} gp_domain_reputations - an array of Google Postmaster domain reputations

Available options: REPUTATION_CATEGORY_UNSPECIFIED, HIGH, MEDIUM, LOW, BAD

Examples:

  • ['BAD', 'LOW']

GP_IP_REPUTATION - if an IP in Google Postmaster is in Bad/Low/Medium/High reputation

Required rule fields:

{array<string>} gp_ips - an array of IPs OR an array with one string ALL_GP_IPS.

Examples:

  • ['1.1.1.1', '123.123.123.123']

  • ['ALL_GP_IPS']

{array<string>} gp_ip_reputations - an array of Google Postmaster IP reputations

Available options: REPUTATION_CATEGORY_UNSPECIFIED, HIGH, MEDIUM, LOW, BAD

Examples:

  • ['BAD', 'LOW']

GP_USER_REPORTED_SPAM_RATIO - if a domain’s spam ratio in Google Postmaster is within the specific range

Required rule fields:

{object} gp_user_reported_spam_ratio

{number} gp_user_reported_spam_ratio.value

Range: 0 ≤ x ≤ 1

{string} gp_user_reported_spam_ratio.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 0.2, operator: 'gt' }

GP_SPF_SUCCESS_RATIO - if a domain’s spf success ratio in Google Postmaster is within the specific range

Required rule fields:

{object} gp_spf_success_ratio

{number} gp_spf_success_ratio.value

Range: 0 ≤ x ≤ 1

{string} gp_spf_success_ratio.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 0.2, operator: 'gt' }

GP_DKIM_SUCCESS_RATIO - if a domain’s dkim success ratio in Google Postmaster is within the specific range

Required rule fields:

{object} gp_dkim_success_ratio

{number} gp_dkim_success_ratio.value

Range: 0 ≤ x ≤ 1

{string} gp_dkim_success_ratio.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 0.2, operator: 'gt' }

GP_DMARC_SUCCESS_RATIO - if a domain’s dmarc success ratio in Google Postmaster is within the specific range

Required rule fields:

{object} gp_dmarc_success_ratio

{number} gp_dmarc_success_ratio.value

Range: 0 ≤ x ≤ 1

{string} gp_dmarc_success_ratio.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 0.2, operator: 'gt' }

GP_INBOUND_ENCRYPTION_RATIO - if a domain’s inbound encryption ratio in Google Postmaster is within the specific range

Required rule fields:

{object} gp_inbound_encryption_ratio

{number} gp_inbound_encryption_ratio.value

Range: 0 ≤ x ≤ 1

{string} gp_inbound_encryption_ratio.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 0.2, operator: 'gt' }

GP_OUTBOUND_ENCRYPTION_RATIO - if a domain’s outbound encryption ratio in Google Postmaster is within the specific range

Required rule fields:

{object} gp_outbound_encryption_ratio

{number} gp_outbound_encryption_ratio.value

Range: 0 ≤ x ≤ 1

{string} gp_outbound_encryption_ratio.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 0.2, operator: 'gt' }

GP_DELIVERY_ERROR_RATIO - if a domain’s delivery error ratio in Google Postmaster is within the specific range

Required rule fields:

{object} gp_delivery_error_ratio

{number} gp_delivery_error_ratio.value

Range: 0 ≤ x ≤ 1

{string} gp_delivery_error_ratio.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 0.2, operator: 'gt' }

SNDS_FILTER_RESULT - if an IP in SNDS Postmaster is in Green/Yellow/Red reputation

Required rule fields:

{array<string>} snds_ips - an array of IPs OR an array with one string ALL_SNDS_IPS.

Examples:

  • ['1.1.1.1', '123.123.123.123']

  • ['ALL_SNDS_IPS']

{array<string>} snds_filter_result - an array of SNDS filter results

Available options: GREEN, YELLOW, RED

Examples:

  • ['RED', 'YELLOW']

SNDS_BOUNCE_RATE - if an IP bounce rate in SNDS Postmaster is within the specific range

Required rule fields:

{object} snds_bounce_rate

{number} snds_bounce_rate.value

Range: 0 ≤ x ≤ 100

{string} snds_bounce_rate.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 50, operator: 'gt' }

SNDS_COMPLAINT_RATE - if an IP bounce rate in SNDS Postmaster is within the specific range

Required rule fields:

{object} snds_complaint_rate

{number} snds_complaint_rate.value

Range: 0 ≤ x ≤ 100

{string} snds_complaint_rate.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 50, operator: 'gt' }

SNDS_TRAP_HITS - if an IP trap hits in SNDS Postmaster is within the specific range

Required rule fields:

{object} snds_trap_hits

{number} snds_trap_hits.value

Range: ≥ 0

{string} snds_trap_hits.operator

Available options: eq, gt, gte, lt, lte

Examples:

  • { value: 2, operator: 'gt' }

LOOKALIKE_REG_CREATED_DATE - if a lookalike domain was created

Required rule fields:

{object} lookalike_reg_created_date

{string} lookalike_reg_created_date.value

Available options: ONE_DAY, ONE_WEEK, ONE_MONTH, ONE_YEAR

{number}lookalike_reg_created_date.operator

Available options:gt, lt

Examples:

  • { value: 'ONE_DAY', operator: 'lt' }

LOOKALIKE_REG_UPDATED_DATE - if a lookalike domain was updated

Required rule fields:

{object} lookalike_reg_updated_date

{string} lookalike_reg_updated_date.value

Available options: ONE_DAY, ONE_WEEK, ONE_MONTH, ONE_YEAR

{number} lookalike_reg_updated_date.operator

Available options: gt, lt

Examples:

  • { value: 'ONE_DAY', operator: 'lt' }

DMARC_SPF_FAIL - if DMARC SPF fails for the last day/week/month

Required rule fields:

{object} dmarc_spf_fail

{number} dmarc_spf_fail.value

Range: ≥ 0

{number} dmarc_spf_fail.operator

Available options: eq, gt, gte, lt, lte

{string} dmarc_spf_fail.time_range

Available options: ONE_DAY, ONE_WEEK, ONE_MONTH

Examples:

  • { value: 2, operator: 'gt', time_range: 'ONE_DAY' }

DMARC_DKIM_FAIL - if DMARC DKIM fails for the last day/week/month

Required rule fields:

{object} dmarc_dkim_fail

{number} dmarc_dkim_fail.value

Range: ≥ 0

{number} dmarc_dkim_fail.operator

Available options: gt, gte

{string} dmarc_dkim_fail.time_range

Available options: ONE_DAY, ONE_WEEK, ONE_MONTH

Examples:

  • { value: 2, operator: 'gt', time_range: 'ONE_DAY' }

DMARC_DMARC_FAIL - if DMARC fails for the last day/week/month

Required rule fields:

{object} dmarc_dmarc_fail

{number} dmarc_dmarc_fail.value

Range: ≥ 0

{number} dmarc_dmarc_fail.operator

Available options: gt, gte

{string} dmarc_dkim_fail.time_range

Available options: ONE_DAY, ONE_WEEK, ONE_MONTH

Examples:

  • { value: 2, operator: 'gt', time_range: 'ONE_DAY' }

DMARC_SPF_ALIGNMENT_FAIL - if DMARC SPF alignment fails for the last day/week/month

Required rule fields:

{object} dmarc_spf_alignment_fail

{number} dmarc_spf_alignment_fail.value

Range: ≥ 0

{number} dmarc_spf_alignment_fail.operator

Available options: gt, gte

{string} dmarc_spf_alignment_fail.time_range

Available options: ONE_DAY, ONE_WEEK, ONE_MONTH

Examples:

  • { value: 2, operator: 'gt', time_range: 'ONE_DAY' }

DMARC_DKIM_ALIGNMENT_FAIL - if DMARC DKIM alignment fails for the last day/week/month

Required rule fields:

{object} dmarc_dkim_alignment_fail

{number} dmarc_dkim_alignment_fail.value

Range: ≥ 0

{number} dmarc_dkim_alignment_fail.operator

Available options: gt, gte

{string} dmarc_dkim_alignment_fail.time_range

Available options: ONE_DAY, ONE_WEEK, ONE_MONTH

Examples:

  • { value: 2, operator: 'gt', time_range: 'ONE_DAY' }

TRAPS_IP - if an IP is caught by the spam traps filter

Required rule fields:

{array<string>} traps_ips - an array of IPs OR an array with one string ALL_TRAPS_IPS.

Examples:

  • ['1.1.1.1', '123.123.123.123']

  • ['ALL_TRAPS_IPS']

TRAPS_DOMAIN_FROM - if a domain is caught by the spam traps filter

Required rule fields:

{array<string>} traps_domains_from - an array of domains OR an array with one string ALL_TRAPS_DOMAINS.

Examples:

  • ['one.com', 'two.com']

  • ['ALL_TRAPS_DOMAINS']

Webhook payloads

The common payload structure is

Rule's snapshot and matching differ based on the type and rule settings:

IP_IN_RBL:

DOMAIN_IN_RBL:

GP_DOMAIN_REPUTATION:

GP_IP_REPUTATION:

GP_USER_REPORTED_SPAM_RATIO:

GP_SPF_SUCCESS_RATIO:

GP_DKIM_SUCCESS_RATIO:

GP_DMARC_SUCCESS_RATIO:

GP_INBOUND_ENCRYPTION_RATIO:

GP_OUTBOUND_ENCRYPTION_RATIO:

GP_DELIVERY_ERROR_RATIO:

SNDS_FILTER_RESULT:

SNDS_BOUNCE_RATE:

SNDS_COMPLAINT_RATE:

SNDS_TRAP_HITS:

LOOKALIKE_REG_CREATED_DATE:

LOOKALIKE_REG_UPDATED_DATE:

DMARC_SPF_FAIL:

DMARC_DKIM_FAIL:

DMARC_DMARC_FAIL:

DMARC_SPF_ALIGNMENT_FAIL:

DMARC_DKIM_ALIGNMENT_FAIL:

TRAPS_IP:

TRAPS_DOMAIN_FROM: