Alerts API

Email Alerts API Guide

The Email Alerts API enables you to configure and manage email performance alerts for your account. You can create up to 8 alerts per account to monitor metrics like Usage and receive notifications when thresholds are reached.

Permissions Required

To access Email Alerts API endpoints, the user must have the following permissions:

  • EmailConfiguration.Alerts_Create
  • EmailConfiguration.Alerts_Delete
  • EmailConfiguration.Alerts_Read
  • EmailConfiguration.Alerts_Update

Fact Sheet

FeatureSupportRemark
Maximum Alerts8Per logical account limit
Logical Account IDYesMust be a valid GUID, cannot be empty
Alert NamesYesCustom names for easy identification
Alert MetricsYesUsage
Threshold OperatorsYesOver (>), Below (<), Equal (=)
Multiple RecipientsYesComma-separated email addresses
Alert ManagementYesCreate, Read, Update, Delete operations

Managing Email Alerts

The Email Alerts API uses a logical account ID (GUID) to identify and manage alerts for specific accounts. Each alert monitors a specific metric and sends notifications to designated recipients when thresholds are met.

API Endpoints

1. List All Alerts

Retrieve all alerts configured for a logical account.

Required Permission: EmailConfiguration.Alerts_Read

GET /v1/account/{logicalAccount}/alerts/list

Successful Response

{
    "isSuccess": true,
    "statusCode": 200,
    "message": "Alerts found.",
    "data": [
        {
            "id": 1,
            "logicalAccountId": "123e4567-e89b-12d3-a456-426614174000",
            "alertName": "High Open Rate Alert",
            "metric": "Usage",
            "threshold": ">90",
            "recipient": "[email protected], [email protected]",
            "createdDate": "2024-01-15T10:30:00Z",
            "updatedDate": "2024-01-15T10:30:00Z"
        }
    ]
}

2. Create New Alert

Create a new alert for monitoring email metrics.

Required Permission: EmailConfiguration.Alerts_Create

POST /v1/account/{logicalAccount}/alerts/create
Content-Type: application/json

{
    "alertName": "Low Open Rate Alert",
    "metric": "Usage",
    "threshold": "<50",
    "recipient": "[email protected], [email protected]"
}

Successful Response

{
    "isSuccess": true,
    "statusCode": 200,
    "message": "Successfully inserted new email alert.",
    "data": 2
}

Maximum Limit Error Response

{
    "isSuccess": false,
    "statusCode": 400,
    "message": "Maximum alert limit reached, cannot add more alerts.",
    "data": -1
}

3. Update Existing Alert

Update an existing alert configuration.

Required Permission: EmailConfiguration.Alerts_Update

PUT /v1/account/{logicalAccount}/alerts/update/{id}
Content-Type: application/json

{
    "alertName": "Updated Open Rate Alert",
    "metric": "Usage",
    "threshold": ">85",
    "recipient": "[email protected], [email protected]"
}

Successful Response

{
    "isSuccess": true,
    "statusCode": 200,
    "message": "Updated email alert",
    "data": 1
}

4. Delete Alert

Delete an existing alert.

Required Permission: EmailConfiguration.Alerts_Delete

DELETE /v1/account/{logicalAccount}/alerts/delete/{id}

Successful Response

{
    "isSuccess": true,
    "statusCode": 200,
    "message": "Successfully deleted email alert with id 1",
    "data": 1
}

Alert Not Found Error Response

{
    "isSuccess": false,
    "statusCode": 400,
    "message": "Alert not found or already deleted.",
    "data": -1
}

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
Logical AccountGUIDYesUnique identifier for the logical account
idint32YesAlert ID (for update/delete operations only)

Request Body Fields

FieldTypeRequiredDescription
Alert NamestringYesName of the alert
metricstringYesUsage
thresholdstringYesThreshold with operator (e.g., ">90", "<50", "=75")
recipientstringYesEmail addresses (comma-separated for multiple)

Threshold Operators

OperatorSymbolDescription
Over>Alert when metric is above threshold
Below<Alert when metric is below threshold
Equal=Alert when metric equals threshold

Status Codes

Status CodeDescription
200OK: Request processed successfully
400Bad Request: Invalid request or maximum limit reached
404Not Found: Alert or account not found
500Internal Server Error: Server-side error occurred

Error Handling

All error responses follow a consistent format:

{
    "isSuccess": false,
    "statusCode": 400,
    "message": "Error description",
    "data": null
}

Best Practices

  1. Alert Limit: Remember the 8-alert limit per account. Plan your alerts strategically.
  2. Threshold Values: Use percentage values (0-100) for thresholds.
  3. Multiple Recipients: Use comma-separated email addresses for multiple notifications. You can add max 5 recipients per alert.
  4. Meaningful Names: Use descriptive alert names for easy identification.
  5. Monitor Performance: Regularly review and update alert thresholds based on your email performance trends.

Example Use Cases

High Performance Alert

Monitor when open rates exceed expectations:

{
    "alertName": "Excellent Campaign Performance",
    "metric": "Usage",
    "threshold": ">95",
    "recipient": "[email protected]"
}

Deliverability Issue Alert

Monitor for delivery problems:

{
    "alertName": "High Bounce Rate Warning",
    "metric": "Usage",
    "threshold": ">10",
    "recipient": "[email protected], [email protected]"
}

Spam Monitoring Alert

Watch for spam complaints:

{
    "alertName": "Spam Complaint Monitor",
    "metric": "Usage",
    "threshold": ">1",
    "recipient": "[email protected]"
}