Count an unsaved cohort definition's members now
Authorization
bearerAuth AuthorizationBearer <token>
Session token issued by the accounts service (or the legacy /v1/auth routes).
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/cohorts/preview" \ -H "Content-Type: application/json" \ -d '{ "definition": { "match": "all", "rules": [ { "count": { "operator": "gte", "value": 2 }, "event": "purchase", "type": "event", "window": { "last_days": 30 } }, { "filters": [ { "operator": "ends_with", "property": "$email", "scope": "user", "values": [ "@example.com" ] } ], "negate": true, "type": "property" } ], "schema": "cohort/1" } }'{ "as_of": "2026-09-13T12:30:45Z", "count": 412}