POST
/
v1
/
segments
/
preview
cURL
curl --request POST \
  --url https://api.comm.com/api/v1/segments/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "numbers",
  "query": {
    "condition": "AND",
    "rules": [
      {
        "field": "clicked_count",
        "operator": "greater",
        "value": 0
      },
      {
        "field": "country_id",
        "operator": "equal",
        "value": 225
      },
      {
        "condition": "OR",
        "rules": [
          {
            "field": "leads_count",
            "operator": "equal",
            "value": 1
          },
          {
            "field": "sales_count",
            "operator": "equal",
            "value": 1
          }
        ]
      },
      {
        "field": "date_created",
        "operator": "equal",
        "value": "2023-07-05"
      }
    ]
  },
  "page": 2,
  "per_page": 50
}'
{
  "total": 123,
  "rows": [
    {
      "team_id": "<string>",
      "phone_normalized": "<string>",
      "contact_id": "<string>",
      "foreign_id": "<string>",
      "last_sent": "<string>",
      "last_clicked": "<string>",
      "sent_count": 123,
      "clicked_count": 123,
      "leads_count": 123,
      "sales_count": 123,
      "network_brand": "<string>",
      "network_id": "<string>",
      "network_reason": "<string>",
      "phone_is_good": "<string>",
      "phone_is_good_reason": "<string>",
      "name": "<string>",
      "country_id": "<string>",
      "state_id": "<string>",
      "state_id_reason": "<string>",
      "custom1_str": "<string>",
      "custom2_str": "<string>",
      "custom3_str": "<string>",
      "custom4_str": "<string>",
      "custom5_str": "<string>",
      "custom1_int": "<string>",
      "custom2_int": "<string>",
      "custom3_int": "<string>",
      "custom4_int": "<string>",
      "custom5_int": "<string>",
      "custom1_dec": "<string>",
      "custom2_dec": "<string>",
      "custom1_datetime": "<string>",
      "custom2_datetime": "<string>",
      "custom3_datetime": "<string>",
      "custom4_datetime": "<string>",
      "custom5_datetime": "<string>",
      "meta": "<string>",
      "date_created": "<string>",
      "date_updated": "<string>"
    }
  ],
  "stats": {},
  "sql": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

200
application/json

The response is of type object.