MailerEstimateCampaignRecipients¶
POST mailer/campaign/estimate-recipients
Counts how many recipients a filter would match, before anything is queued.
A warning before the rollout is cheaper than an investigation after it: a filter that accidentally matches the entire customer base is only obvious when the number is on screen.
Access Control¶
Allowed roles: admin, leader.
Request¶
POST https://{broker_domain}/mailer/campaign/estimate-recipients
{
"recipientType": "CUSTOMER",
"recipientConfig": {
"filters": {
"country": "UA",
"status": "ACTIVE"
}
}
}
{
"command": "MailerEstimateCampaignRecipients",
"extID": "1",
"data": {
"recipientType": "CUSTOMER",
"recipientConfig": {
"filters": {
"country": "UA",
"status": "ACTIVE"
}
}
}
}
const res = await platform.MailerEstimateCampaignRecipients({
recipientType: "CUSTOMER",
recipientConfig: {
filters: {
country: "UA",
status: "ACTIVE"
}
}
});
Request Data¶
| Field | Type | Required | Description |
|---|---|---|---|
recipientType |
enum | Yes | CUSTOMER, LEAD, or MANAGER |
recipientConfig |
object | Yes | { ids: [...] }, { filters: {...} }, or both |
Response Data¶
limit is the configured campaign ceiling; exceedsLimit: true means the rollout would be refused.
{
"recipientType": "CUSTOMER",
"byIds": 0,
"byFilters": 5400,
"total": 5400,
"limit": 20000,
"exceedsLimit": false
}
Errors¶
| Code | Error | Description |
|---|---|---|
400 |
VALIDATION_ERROR |
Empty recipient config |
500 |
PLATFORM_PREFIX_MISSING |
The platform service prefix is not configured, so recipients cannot be resolved |