For the complete documentation index, see llms.txt. This page is also available as Markdown.

Preview contacts matching conditions

Preview the contacts matching a set of conditions without saving a segment.

Preview contacts matching conditions

post

Preview the contacts matching a set of conditions without saving a segment.

The body is the same set of conditions accepted when creating or updating a segment, so this is how to check who a filter reaches, and how many, before persisting it. Nothing is stored and no contact is modified.

Call the segment filter attributes endpoint first to discover the valid attribute, operator and value combinations.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
profileUuidstringRequired

Profile uuid parameter

Example: 550e8400-e09b-41d4-a716-400055000000
Body

Conditions to preview, in the same shape accepted when creating a segment

logicstring · enumRequired

How to combine multiple conditions

Example: ANDPossible values:
pageintegerOptional

Page number

Example: 1
per_pageinteger · min: 1 · max: 100Optional

Number of items per page

Example: 25
searchstringOptional

Narrow the preview to contacts whose email matches

Example: john.doe@example.com
sort_bystring · enumOptionalExample: emailPossible values:
sort_directionstring · enumOptionalExample: ascPossible values:
Responses
200

Success response

application/json
post/api/reach/v1/profiles/{profileUuid}/segmentation/filters/contacts
POST /api/reach/v1/profiles/{profileUuid}/segmentation/filters/contacts HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 198

{
  "conditions": [
    {
      "attribute": "email",
      "operator": "equals",
      "value": "example@example.com"
    }
  ],
  "logic": "AND",
  "page": 1,
  "per_page": 25,
  "search": "john.doe@example.com",
  "sort_by": "email",
  "sort_direction": "asc"
}
{
  "data": [
    {
      "uuid": "550e8400-e29b-41d4-a716-446655440000",
      "name": "John",
      "surname": "Doe",
      "email": "john.doe@example.com",
      "phone": "+14155552671",
      "subscription_status": "subscribed",
      "subscribed_at": "2023-01-01T00:00:00Z",
      "unsubscribed_at": "2023-06-15T00:00:00Z",
      "source": "api",
      "note": "VIP customer"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 15,
    "total": 100
  }
}

Last updated

Was this helpful?