Skip to content

Preview segment filters

Request

Preview how many contacts match given filter conditions WITHOUT creating a segment.

Use cases:

  • Test filters before creating segment
  • Estimate audience size for campaigns
  • Validate filter logic

Returns: Contact count only (no actual contact data for performance)

Security
ApiKeyAuth
Bodyapplication/jsonrequired
filter_conditionsobjectrequired

Filter rules to test.

Supports both simple and filter builder formats.

Example:
{ "filters": [ {}, {} ], "match_type": "all" }
curl -i -X POST \
  https://api.mailerlogic.net/api/v1/contacts/segments/preview \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "filter_conditions": {
      "filters": [
        {
          "field": "status",
          "operator": "equals",
          "value": "subscribed"
        },
        {
          "field": "campaign_opened",
          "operator": "has_opened",
          "value": "campaign-uuid"
        }
      ],
      "match_type": "all"
    }
  }'

Responses

Preview count retrieved successfully

Bodyapplication/json
successboolean
Example:true
countinteger

Number of contacts matching filters

Example:842
Response
{ "success": true, "count": 842 }