---
title: "Count fans with a JSON filter body"
method: POST
path: "/v1/fans/segments/search"
tags: ["fans"]
---

# Count fans with a JSON filter body

`POST /v1/fans/segments/search`

## Request body

- object
  - `conversionIds` string[]
  - `dropIds` string[]
  - `excludedConversionIds` string[]
  - `excludedDropIds` string[]
  - `excludedLocations` union[]
    - union
      - object
        - `city` string, required
        - `country` string, required
        - `radius` number
        - `state` string, required
      - object
        - `country` string, required
        - `state` string, required
      - object
        - `country` string, required
  - `locations` union[]
    - union
      - object
        - `city` string, required
        - `country` string, required
        - `radius` number
        - `state` string, required
      - object
        - `country` string, required
        - `state` string, required
      - object
        - `country` string, required
  - `signUpType` 'sms' | 'email', required

## Response `200`

The number of fans matching the supplied filters.

- object
  - `numberOfFans` number, required

## Other responses

- `400` — The request body is malformed.
- `401` — The integrator credential or customer API key is invalid.
- `403` — The customer account behind the API key has no paid Laylo plan.
- `404` — No route matches the requested path.
- `405` — The path exists, but the HTTP method is not supported.
- `429` — The per-integrator rate limit for this operation is exceeded.
- `500` — An unexpected server error occurred.

---

[API](https://skmtc.dev/laylo/apis/laylo-api.md) · [All operations](https://skmtc.dev/laylo/apis/laylo-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/laylo/laylo-api/revisions/000d81a01b74/schema)
