{
"error": {
"type": "permission_denied",
"code": "missing_scope",
"message": "This API key does not have the required \"read\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}
Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.
{
"error": {
"type": "permission_denied",
"code": "missing_scope",
"message": "This API key does not have the required \"read\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}
Conditions from the filter catalog (GET /v1/segment-builder/catalog). Up to 30.
Required array length: 1 - 30 elements
One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.
Option 1
Option 2
Option 3
Option 4
Show child attributes
match
enum<string>
all: customers who match every condition. any: customers who match at least one.
Available options:
all,
any
sample_size
integer
default:5
Number of customers in the sample.
Required range: 0 <= x <= 20
Response
Segment preview. Nothing was saved.
object
string
required
Allowed value: "segment_preview"
customer_count
integer
required
Required range: x >= 0
whatsapp_reachable_count
integer
required
Matching customers with a phone who did not opt out.
Required range: x >= 0
email_reachable_count
integer
required
Matching customers with an email who are subscribed to emails.
Required range: x >= 0
match
enum<string>
required
all: customers who match every condition. any: customers who match at least one.
Available options:
all,
any
conditions
object[]
required
One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.
Option 1
Option 2
Option 3
Option 4
Show child attributes
sample
object[]
required
Show child attributes
evaluated_at
string<date-time>
required
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bevits","colors":{"primary":"#F97316","light":"#FB923C","dark":"#EA580C"},"logo":{"light":"https://mintcdn.com/bevits/1nYG20dqbMUuey8F/logo/light.svg?fit=max\u0026auto=format\u0026n=1nYG20dqbMUuey8F\u0026q=85\u0026s=e3888ae21616d4de0a83364106aade8c","dark":"https://mintcdn.com/bevits/1nYG20dqbMUuey8F/logo/dark.svg?fit=max\u0026auto=format\u0026n=1nYG20dqbMUuey8F\u0026q=85\u0026s=a4cb0c23c9b869db5134b256820f2dce"},"favicon":"https://mintcdn.com/bevits/1nYG20dqbMUuey8F/favicon.svg?fit=max\u0026auto=format\u0026n=1nYG20dqbMUuey8F\u0026q=85\u0026s=0860c45a6d0cf16a9e741cd3ef465c1b","styling":{"latex":false},"navigation":{"languages":[{"language":"pt-BR","default":true,"navbar":{"links":[{"href":"mailto:hey@bevits.com","label":"Suporte"}],"primary":{"type":"button","label":"Painel","href":"https://app.bevits.com"}},"href":"pt-BR/overview"},{"language":"en","navbar":{"links":[{"href":"mailto:hey@bevits.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.bevits.com"}},"href":"en/overview"},{"language":"es","navbar":{"links":[{"href":"mailto:hey@bevits.com","label":"Soporte"}],"primary":{"type":"button","label":"Panel","href":"https://app.bevits.com"}},"href":"es/overview"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bevits","hasAudioNarration":false,"actualSubdomain":"bevits","customDomains":["docs.bevits.com"],"gitSource":{"type":"github","owner":"zenvios","repo":"zenvios-monorepo","deployBranch":"main","contentDirectory":"bevits-docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b00e682edb39c90a37ab9ba","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"en","tag":"API","count":60},{"language":"es","tag":"API","count":60},{"language":"pt-BR","tag":"API","count":60},{"language":"en","tag":"Reference","count":53},{"language":"es","tag":"Referencia","count":53},{"language":"pt-BR","tag":"Referência","count":53},{"language":"en","tag":"Documentation","count":20},{"language":"es","tag":"Documentación","count":20},{"language":"pt-BR","tag":"Documentação","count":20},{"language":"en","tag":"Features","count":10},{"language":"es","tag":"Funcionalidades","count":10},{"language":"pt-BR","tag":"Funcionalidades","count":10},{"language":"en","tag":"Sending methods","count":6},{"language":"es","tag":"Métodos de envío","count":6},{"language":"pt-BR","tag":"Métodos de envio","count":6},{"language":"es","tag":"Primeros pasos","count":5},{"language":"pt-BR","tag":"Primeiros passos","count":5},{"language":"en","tag":"Getting started","count":4},{"language":"en","tag":"Integrations","count":3},{"language":"es","tag":"Integraciones","count":3},{"language":"pt-BR","tag":"Integrações","count":3},{"language":"en","tag":"Custom events","count":2},{"language":"es","tag":"Eventos personalizados","count":2},{"language":"pt-BR","tag":"Eventos personalizados","count":2},{"language":"en","tag":"Fundamentals","count":1},{"language":"en","tag":"Changelog","count":1},{"language":"es","tag":"Fundamentos","count":1},{"language":"es","tag":"Changelog","count":1},{"language":"pt-BR","tag":"Fundamentos","count":1},{"language":"pt-BR","tag":"Changelog","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"en/api-reference/segments/preview-segment","slug":"/en/api-reference/segments/preview-segment","pageMetadata":{"title":"Preview segment","description":"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/segment-builder/preview","href":"/en/api-reference/segments/preview-segment","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Preview segment","description":"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/segment-builder/preview","href":"/en/api-reference/segments/preview-segment","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Preview segment","description":"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.","operationId":"previewSegment","tags":["Segments"],"requestBody":"ca0df31d-316d-4cec-a00e-51e9ce59788b","responses":{"200":"eb735bc6-ce44-4540-a141-f138ce78d574","400":"e85a42a2-ac11-4908-8f6b-5628c512ea1e","401":"aa0097d4-a8cf-43b6-a6b3-883d03521c16","403":"c9aa6cbe-b4dc-44d3-81e3-348166a7f41d","422":"6c90766d-62ec-4ffb-a2fd-8332d2e79996","429":"aa908534-de6a-4ec8-a267-ca58120b0856","500":"a4e1bec8-eb94-416f-b00e-9a1f3354ee32"},"method":"post","type":"path","servers":["7069ccf3-9562-4ac9-9667-21d8c3988907"],"security":["a2b5bdb9-1855-4cd3-a9bc-9478e454e8e4"],"path":"/v1/segment-builder/preview","baseUrlOptions":["https://api.bevits.com"],"title":"Preview segment","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["conditions"],"properties":{"conditions":{"type":"array","items":{"oneOf":[{"type":"object","description":"One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.","required":["kind","field","operator"],"properties":{"kind":{"type":"string","const":"field","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.0.kind","typeLabel":"string"},"field":{"type":"string","minLength":1,"maxLength":256,"description":"A customer field (such as totalSpentInCents, lastPurchaseDate, or city) or the ID of a custom attribute (atr_...), from the filter catalog.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.0.field","typeLabel":"string"},"operator":{"type":"string","minLength":1,"maxLength":32,"description":"One of the field's operators in the catalog. Text: eq, neq, in, not_in, contains, not_contains, starts_with, is_null, is_not_null. Number: eq, neq, gt, gte, lt, lte. Boolean: eq_true, eq_false, is_null, is_not_null. Date: gt, lt, between.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.0.operator","typeLabel":"string"},"value":{"oneOf":[{"type":"string","description":"Leave it out for is_null, is_not_null, eq_true, and eq_false. A list for in and not_in. Money in cents. Dates in ISO 8601 with a timezone.","maxLength":512,"uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.0","typeLabel":"string"},{"type":"number","description":"Leave it out for is_null, is_not_null, eq_true, and eq_false. A list for in and not_in. Money in cents. Dates in ISO 8601 with a timezone.","uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"Leave it out for is_null, is_not_null, eq_true, and eq_false. A list for in and not_in. Money in cents. Dates in ISO 8601 with a timezone.","uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","minLength":1,"maxLength":256,"uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"Leave it out for is_null, is_not_null, eq_true, and eq_false. A list for in and not_in. Money in cents. Dates in ISO 8601 with a timezone.","maxItems":500,"minItems":1,"uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.3","typeLabel":"string[]"}],"uniqueKey":"conditions.items.[INDEX].oneOf.0.value","typeLabel":"string | number | boolean | string[]"},"value_to":{"oneOf":[{"type":"string","description":"End of a between range.","maxLength":64,"uniqueKey":"conditions.items.[INDEX].oneOf.0.value_to.oneOf.0","typeLabel":"string"},{"type":"number","description":"End of a between range.","uniqueKey":"conditions.items.[INDEX].oneOf.0.value_to.oneOf.1","typeLabel":"number"}],"uniqueKey":"conditions.items.[INDEX].oneOf.0.value_to","typeLabel":"string | number"}},"additionalProperties":false,"uniqueKey":"conditions.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.","required":["kind","operator","tag_ids"],"properties":{"kind":{"type":"string","const":"tags","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.1.kind","typeLabel":"string"},"operator":{"type":"string","enum":["has_any","has_all","has_none"],"description":"has_any: has any of the tags. has_all: has all of them. has_none: has none of them, including customers without any tag.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.1.operator","typeLabel":"enum\u003cstring>"},"tag_ids":{"type":"array","items":{"type":"string","pattern":"^tag_[A-Za-z0-9_-]+$","uniqueKey":"conditions.items.[INDEX].oneOf.1.tag_ids.items.[INDEX]","typeLabel":"string"},"minItems":1,"maxItems":50,"description":"Tag IDs (tag_...), from GET /v1/tags.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.1.tag_ids","typeLabel":"string[]"}},"additionalProperties":false,"uniqueKey":"conditions.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","description":"One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.","required":["kind","operator"],"properties":{"kind":{"type":"string","const":"product","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.2.kind","typeLabel":"string"},"operator":{"type":"string","enum":["has_purchased","has_not_purchased","purchased_in_category"],"isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.2.operator","typeLabel":"enum\u003cstring>"},"product_id":{"type":"string","minLength":1,"maxLength":256,"description":"The store's product ID, as in purchase items. For has_purchased and has_not_purchased.","uniqueKey":"conditions.items.[INDEX].oneOf.2.product_id","typeLabel":"string"},"category":{"type":"string","minLength":1,"maxLength":256,"description":"Product category name. For purchased_in_category.","uniqueKey":"conditions.items.[INDEX].oneOf.2.category","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"conditions.items.[INDEX].oneOf.2","typeLabel":"object"},{"type":"object","description":"One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.","required":["kind","status"],"properties":{"kind":{"type":"string","const":"coupon","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.3.kind","typeLabel":"string"},"status":{"type":"string","enum":["has_available","has_unused","has_expired_unused","has_used","has_received","has_not_received"],"description":"has_available: has an unused, unexpired coupon, with credit to spend now. has_unused: has a coupon they never used, expired or not. has_expired_unused: let a coupon expire without using it. has_used: used a coupon in a purchase. has_received: received a coupon. has_not_received: never received a coupon.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.3.status","typeLabel":"enum\u003cstring>"},"source":{"type":"string","enum":["cashback","any","flows"],"default":"cashback","description":"cashback: coupons generated by a purchase (cashback or giftback, online or in store). any: every coupon Bevits issued to the customer. flows: only the coupons of the automations in flow_ids.","uniqueKey":"conditions.items.[INDEX].oneOf.3.source","typeLabel":"enum\u003cstring>"},"flow_ids":{"type":"array","items":{"type":"string","pattern":"^flw_[A-Za-z0-9_-]+$","uniqueKey":"conditions.items.[INDEX].oneOf.3.flow_ids.items.[INDEX]","typeLabel":"string"},"minItems":1,"maxItems":50,"description":"With source flows: automations that issue coupons, listed in the catalog.","uniqueKey":"conditions.items.[INDEX].oneOf.3.flow_ids","typeLabel":"string[]"},"received_within_days":{"type":"integer","minimum":1,"maximum":3650,"description":"Only coupons issued in the last N days.","uniqueKey":"conditions.items.[INDEX].oneOf.3.received_within_days","typeLabel":"integer"},"expires_within_days":{"type":"integer","minimum":1,"maximum":365,"description":"With has_available: only coupons that expire in the next N days.","uniqueKey":"conditions.items.[INDEX].oneOf.3.expires_within_days","typeLabel":"integer"}},"additionalProperties":false,"uniqueKey":"conditions.items.[INDEX].oneOf.3","typeLabel":"object"}],"uniqueKey":"conditions.items.[INDEX]","typeLabel":"object"},"minItems":1,"maxItems":30,"description":"Conditions from the filter catalog (GET /v1/segment-builder/catalog). Up to 30.","isRequired":true,"uniqueKey":"conditions","typeLabel":"object[]"},"match":{"type":"string","enum":["all","any"],"description":"all: customers who match every condition. any: customers who match at least one.","uniqueKey":"match","typeLabel":"enum\u003cstring>"},"sample_size":{"type":"integer","minimum":0,"maximum":20,"default":5,"description":"Number of customers in the sample.","uniqueKey":"sample_size","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"example":{"match":"all","conditions":[{"kind":"coupon","status":"has_available","source":"cashback","expires_within_days":7},{"kind":"field","field":"totalSpentInCents","operator":"gte","value":50000}]},"examples":{"Example":{"title":"Example","value":{"match":"all","conditions":[{"kind":"coupon","status":"has_available","source":"cashback","expires_within_days":7},{"kind":"field","field":"totalSpentInCents","operator":"gte","value":50000}]}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"eb735bc6-ce44-4540-a141-f138ce78d574":{"description":"Segment preview. Nothing was saved.","content":{"application/json":{"schema":{"type":"object","required":["object","customer_count","whatsapp_reachable_count","email_reachable_count","match","conditions","sample","evaluated_at"],"properties":{"object":{"type":"string","const":"segment_preview","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"customer_count":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"customer_count","typeLabel":"integer"},"whatsapp_reachable_count":{"type":"integer","minimum":0,"description":"Matching customers with a phone who did not opt out.","isRequired":true,"uniqueKey":"whatsapp_reachable_count","typeLabel":"integer"},"email_reachable_count":{"type":"integer","minimum":0,"description":"Matching customers with an email who are subscribed to emails.","isRequired":true,"uniqueKey":"email_reachable_count","typeLabel":"integer"},"match":{"type":"string","enum":["all","any"],"description":"all: customers who match every condition. any: customers who match at least one.","isRequired":true,"uniqueKey":"match","typeLabel":"enum\u003cstring>"},"conditions":{"type":"array","items":{"oneOf":[{"type":"object","description":"One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.","required":["kind","field","operator"],"properties":{"kind":{"type":"string","const":"field","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.0.kind","typeLabel":"string"},"field":{"type":"string","minLength":1,"maxLength":256,"description":"A customer field (such as totalSpentInCents, lastPurchaseDate, or city) or the ID of a custom attribute (atr_...), from the filter catalog.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.0.field","typeLabel":"string"},"operator":{"type":"string","minLength":1,"maxLength":32,"description":"One of the field's operators in the catalog. Text: eq, neq, in, not_in, contains, not_contains, starts_with, is_null, is_not_null. Number: eq, neq, gt, gte, lt, lte. Boolean: eq_true, eq_false, is_null, is_not_null. Date: gt, lt, between.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.0.operator","typeLabel":"string"},"value":{"oneOf":[{"type":"string","description":"Leave it out for is_null, is_not_null, eq_true, and eq_false. A list for in and not_in. Money in cents. Dates in ISO 8601 with a timezone.","maxLength":512,"uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.0","typeLabel":"string"},{"type":"number","description":"Leave it out for is_null, is_not_null, eq_true, and eq_false. A list for in and not_in. Money in cents. Dates in ISO 8601 with a timezone.","uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"Leave it out for is_null, is_not_null, eq_true, and eq_false. A list for in and not_in. Money in cents. Dates in ISO 8601 with a timezone.","uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","minLength":1,"maxLength":256,"uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"Leave it out for is_null, is_not_null, eq_true, and eq_false. A list for in and not_in. Money in cents. Dates in ISO 8601 with a timezone.","maxItems":500,"minItems":1,"uniqueKey":"conditions.items.[INDEX].oneOf.0.value.oneOf.3","typeLabel":"string[]"}],"uniqueKey":"conditions.items.[INDEX].oneOf.0.value","typeLabel":"string | number | boolean | string[]"},"value_to":{"oneOf":[{"type":"string","description":"End of a between range.","maxLength":64,"uniqueKey":"conditions.items.[INDEX].oneOf.0.value_to.oneOf.0","typeLabel":"string"},{"type":"number","description":"End of a between range.","uniqueKey":"conditions.items.[INDEX].oneOf.0.value_to.oneOf.1","typeLabel":"number"}],"uniqueKey":"conditions.items.[INDEX].oneOf.0.value_to","typeLabel":"string | number"}},"additionalProperties":false,"uniqueKey":"conditions.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.","required":["kind","operator","tag_ids"],"properties":{"kind":{"type":"string","const":"tags","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.1.kind","typeLabel":"string"},"operator":{"type":"string","enum":["has_any","has_all","has_none"],"description":"has_any: has any of the tags. has_all: has all of them. has_none: has none of them, including customers without any tag.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.1.operator","typeLabel":"enum\u003cstring>"},"tag_ids":{"type":"array","items":{"type":"string","pattern":"^tag_[A-Za-z0-9_-]+$","uniqueKey":"conditions.items.[INDEX].oneOf.1.tag_ids.items.[INDEX]","typeLabel":"string"},"minItems":1,"maxItems":50,"description":"Tag IDs (tag_...), from GET /v1/tags.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.1.tag_ids","typeLabel":"string[]"}},"additionalProperties":false,"uniqueKey":"conditions.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","description":"One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.","required":["kind","operator"],"properties":{"kind":{"type":"string","const":"product","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.2.kind","typeLabel":"string"},"operator":{"type":"string","enum":["has_purchased","has_not_purchased","purchased_in_category"],"isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.2.operator","typeLabel":"enum\u003cstring>"},"product_id":{"type":"string","minLength":1,"maxLength":256,"description":"The store's product ID, as in purchase items. For has_purchased and has_not_purchased.","uniqueKey":"conditions.items.[INDEX].oneOf.2.product_id","typeLabel":"string"},"category":{"type":"string","minLength":1,"maxLength":256,"description":"Product category name. For purchased_in_category.","uniqueKey":"conditions.items.[INDEX].oneOf.2.category","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"conditions.items.[INDEX].oneOf.2","typeLabel":"object"},{"type":"object","description":"One condition of a filter segment. The same format goes into create, update, and preview and comes back in GET /v1/segments/{segment_id}.","required":["kind","status"],"properties":{"kind":{"type":"string","const":"coupon","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.3.kind","typeLabel":"string"},"status":{"type":"string","enum":["has_available","has_unused","has_expired_unused","has_used","has_received","has_not_received"],"description":"has_available: has an unused, unexpired coupon, with credit to spend now. has_unused: has a coupon they never used, expired or not. has_expired_unused: let a coupon expire without using it. has_used: used a coupon in a purchase. has_received: received a coupon. has_not_received: never received a coupon.","isRequired":true,"uniqueKey":"conditions.items.[INDEX].oneOf.3.status","typeLabel":"enum\u003cstring>"},"source":{"type":"string","enum":["cashback","any","flows"],"default":"cashback","description":"cashback: coupons generated by a purchase (cashback or giftback, online or in store). any: every coupon Bevits issued to the customer. flows: only the coupons of the automations in flow_ids.","uniqueKey":"conditions.items.[INDEX].oneOf.3.source","typeLabel":"enum\u003cstring>"},"flow_ids":{"type":"array","items":{"type":"string","pattern":"^flw_[A-Za-z0-9_-]+$","uniqueKey":"conditions.items.[INDEX].oneOf.3.flow_ids.items.[INDEX]","typeLabel":"string"},"minItems":1,"maxItems":50,"description":"With source flows: automations that issue coupons, listed in the catalog.","uniqueKey":"conditions.items.[INDEX].oneOf.3.flow_ids","typeLabel":"string[]"},"received_within_days":{"type":"integer","minimum":1,"maximum":3650,"description":"Only coupons issued in the last N days.","uniqueKey":"conditions.items.[INDEX].oneOf.3.received_within_days","typeLabel":"integer"},"expires_within_days":{"type":"integer","minimum":1,"maximum":365,"description":"With has_available: only coupons that expire in the next N days.","uniqueKey":"conditions.items.[INDEX].oneOf.3.expires_within_days","typeLabel":"integer"}},"additionalProperties":false,"uniqueKey":"conditions.items.[INDEX].oneOf.3","typeLabel":"object"}],"uniqueKey":"conditions.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"conditions","typeLabel":"object[]"},"sample":{"type":"array","items":{"type":"object","required":["object","id"],"properties":{"object":{"type":"string","const":"customer","isRequired":true,"uniqueKey":"sample.items.[INDEX].object","typeLabel":"string"},"id":{"type":"string","pattern":"^cus_[A-Za-z0-9_-]+$","isRequired":true,"uniqueKey":"sample.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","uniqueKey":"sample.items.[INDEX].name","typeLabel":"string"},"email":{"type":"string","uniqueKey":"sample.items.[INDEX].email","typeLabel":"string"},"phone":{"type":"string","uniqueKey":"sample.items.[INDEX].phone","typeLabel":"string"}},"uniqueKey":"sample.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"sample","typeLabel":"object[]"},"evaluated_at":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"evaluated_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"object":"segment_preview","customer_count":1,"whatsapp_reachable_count":1,"email_reachable_count":1,"match":"all","conditions":[{"kind":"field","field":"\u003cstring>","operator":"\u003cstring>","value":"\u003cstring>","value_to":"\u003cstring>"}],"sample":[{"object":"customer","id":"\u003cstring>","name":"\u003cstring>","email":"\u003cstring>","phone":"\u003cstring>"}],"evaluated_at":"2023-11-07T05:31:56Z"}}},"exampleType":"generated"}},"exampleType":"generated"},"e85a42a2-ac11-4908-8f6b-5628c512ea1e":{"description":"Missing request body, a body that is not a JSON object, or an invalid route parameter.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","request_id"],"properties":{"type":{"type":"string","enum":["authentication_error","conflict","internal_error","invalid_request","not_found","permission_denied","rate_limited","validation_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","pattern":"^req_[a-f0-9]{24}$","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"code":{"type":"string","description":"Stable, machine-readable reason within type, such as invalid_event_name. Present when the error has a named reason.","uniqueKey":"error.code","typeLabel":"string"},"param":{"type":"string","description":"Full path of the offending field, such as customer.email or events[3].name.","uniqueKey":"error.param","typeLabel":"string"},"suggestion":{"type":"string","description":"A value that would be accepted, when there is an obvious one.","uniqueKey":"error.suggestion","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","message":"\u003cstring>","request_id":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>","suggestion":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"aa0097d4-a8cf-43b6-a6b3-883d03521c16":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","request_id"],"properties":{"type":{"type":"string","enum":["authentication_error","conflict","internal_error","invalid_request","not_found","permission_denied","rate_limited","validation_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","pattern":"^req_[a-f0-9]{24}$","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"code":{"type":"string","description":"Stable, machine-readable reason within type, such as invalid_event_name. Present when the error has a named reason.","uniqueKey":"error.code","typeLabel":"string"},"param":{"type":"string","description":"Full path of the offending field, such as customer.email or events[3].name.","uniqueKey":"error.param","typeLabel":"string"},"suggestion":{"type":"string","description":"A value that would be accepted, when there is an obvious one.","uniqueKey":"error.suggestion","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"type":"authentication_error","message":"Invalid API key.","request_id":"req_07f6cdc3c20249d6afcd90b4"}},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","message":"Invalid API key.","request_id":"req_07f6cdc3c20249d6afcd90b4"}}}},"exampleType":"examples"}},"exampleType":"examples"},"c9aa6cbe-b4dc-44d3-81e3-348166a7f41d":{"description":"The API key does not have the read scope. This is the case of a send-only key, created with events:write alone.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","request_id"],"properties":{"type":{"type":"string","enum":["authentication_error","conflict","internal_error","invalid_request","not_found","permission_denied","rate_limited","validation_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","pattern":"^req_[a-f0-9]{24}$","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"code":{"type":"string","description":"Stable, machine-readable reason within type, such as invalid_event_name. Present when the error has a named reason.","uniqueKey":"error.code","typeLabel":"string"},"param":{"type":"string","description":"Full path of the offending field, such as customer.email or events[3].name.","uniqueKey":"error.param","typeLabel":"string"},"suggestion":{"type":"string","description":"A value that would be accepted, when there is an obvious one.","uniqueKey":"error.suggestion","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"type":"permission_denied","code":"missing_scope","message":"This API key does not have the required \"read\" scope.","param":"scope","request_id":"req_07f6cdc3c20249d6afcd90b4"}},"examples":{"Example":{"title":"Example","value":{"error":{"type":"permission_denied","code":"missing_scope","message":"This API key does not have the required \"read\" scope.","param":"scope","request_id":"req_07f6cdc3c20249d6afcd90b4"}}}},"exampleType":"examples"}},"exampleType":"examples"},"6c90766d-62ec-4ffb-a2fd-8332d2e79996":{"description":"A condition or field was rejected, for example an operator that doesn't apply to the field or an RFM segment. The message says what to fix and the valid options, and error.param points to the field.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","request_id"],"properties":{"type":{"type":"string","enum":["authentication_error","conflict","internal_error","invalid_request","not_found","permission_denied","rate_limited","validation_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","pattern":"^req_[a-f0-9]{24}$","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"code":{"type":"string","description":"Stable, machine-readable reason within type, such as invalid_event_name. Present when the error has a named reason.","uniqueKey":"error.code","typeLabel":"string"},"param":{"type":"string","description":"Full path of the offending field, such as customer.email or events[3].name.","uniqueKey":"error.param","typeLabel":"string"},"suggestion":{"type":"string","description":"A value that would be accepted, when there is an obvious one.","uniqueKey":"error.suggestion","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","message":"\u003cstring>","request_id":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>","suggestion":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"aa908534-de6a-4ec8-a267-ca58120b0856":{"description":"Request limit exceeded.","headers":{"Retry-After":{"description":"Seconds before retrying.","schema":{"type":"integer","minimum":1}},"X-RateLimit-Limit":{"description":"Total limit for the current window.","schema":{"type":"integer","example":600}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","example":599}},"X-RateLimit-Reset":{"description":"UTC instant when the current window ends.","schema":{"type":"string","format":"date-time"}}},"content":{"application/json":{"schema":{"type":"object","required":["retry_after","error"],"properties":{"error":{"type":"object","required":["type","message","request_id"],"properties":{"type":{"type":"string","enum":["authentication_error","conflict","internal_error","invalid_request","not_found","permission_denied","rate_limited","validation_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","pattern":"^req_[a-f0-9]{24}$","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"code":{"type":"string","description":"Stable, machine-readable reason within type, such as invalid_event_name. Present when the error has a named reason.","uniqueKey":"error.code","typeLabel":"string"},"param":{"type":"string","description":"Full path of the offending field, such as customer.email or events[3].name.","uniqueKey":"error.param","typeLabel":"string"},"suggestion":{"type":"string","description":"A value that would be accepted, when there is an obvious one.","uniqueKey":"error.suggestion","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"retry_after":{"type":"integer","minimum":1,"description":"Seconds before retrying.","isRequired":true,"uniqueKey":"retry_after","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","message":"\u003cstring>","request_id":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>","suggestion":"\u003cstring>"},"retry_after":2}}},"exampleType":"generated"}},"exampleType":"generated"},"a4e1bec8-eb94-416f-b00e-9a1f3354ee32":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","request_id"],"properties":{"type":{"type":"string","enum":["authentication_error","conflict","internal_error","invalid_request","not_found","permission_denied","rate_limited","validation_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","pattern":"^req_[a-f0-9]{24}$","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"code":{"type":"string","description":"Stable, machine-readable reason within type, such as invalid_event_name. Present when the error has a named reason.","uniqueKey":"error.code","typeLabel":"string"},"param":{"type":"string","description":"Full path of the offending field, such as customer.email or events[3].name.","uniqueKey":"error.param","typeLabel":"string"},"suggestion":{"type":"string","description":"A value that would be accepted, when there is an obvious one.","uniqueKey":"error.suggestion","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","message":"\u003cstring>","request_id":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>","suggestion":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"a2b5bdb9-1855-4cd3-a9bc-9478e454e8e4":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"bvt_live_...","description":"API key created in the organization settings.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"7069ccf3-9562-4ac9-9667-21d8c3988907":{"url":"https://api.bevits.com","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"bvt_live_...","description":"API key created in the organization settings.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API key created in the organization settings.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi.en.json"},"subdomain":"bevits","siteName":"Bevits","title":"Preview segment - Bevits","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"pt-BR":{"href":"/pt-BR/overview","matchLevel":4},"en":{"href":"/en/api-reference/segments/preview-segment","matchLevel":0},"es":{"href":"/es/overview","matchLevel":4}}},"lastModified":"2026-11-21T00:32:10.825Z","originalFileLocation":"en/api-reference/segments/preview-segment.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bevits\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Preview segment - Bevits\">\u003cmeta data-mint-head property=\"og:description\" content=\"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bevits\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.bevits.com/en/api-reference/segments/preview-segment\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bevits.mintlify.site/_mintlify/api/og/v2?division=Reference\u0026amp;title=Preview+segment\u0026amp;description=Counts+and+samples+the+customers+who+match+the+conditions+right+now%2C+without+saving+anything%2C+and+reports+how+many+can+be+reached+on+WhatsApp+and+by+email.+Erro\u0026amp;theme=7595054ec12c591f1d286750\u0026amp;signature=c7d6713f80e1c281b529d3f3bd29a87aec1ded8dd4f48b4c0dfc44334cd922bf\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Preview segment - Bevits\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bevits.mintlify.site/_mintlify/api/og/v2?division=Reference\u0026amp;title=Preview+segment\u0026amp;description=Counts+and+samples+the+customers+who+match+the+conditions+right+now%2C+without+saving+anything%2C+and+reports+how+many+can+be+reached+on+WhatsApp+and+by+email.+Erro\u0026amp;theme=7595054ec12c591f1d286750\u0026amp;signature=c7d6713f80e1c281b529d3f3bd29a87aec1ded8dd4f48b4c0dfc44334cd922bf\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/bevits/rUFhj4NY5eY9LDUb/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bevits\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#F97316\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.bevits.com/en/api-reference/segments/preview-segment\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/api-reference/segments/preview-segment.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.bevits.com/#organization\",\"name\":\"Bevits\",\"url\":\"https://docs.bevits.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bevits/1nYG20dqbMUuey8F/logo/light.svg?fit=max\u0026auto=format\u0026n=1nYG20dqbMUuey8F\u0026q=85\u0026s=e3888ae21616d4de0a83364106aade8c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.bevits.com#website\",\"name\":\"Bevits\",\"url\":\"https://docs.bevits.com\",\"publisher\":{\"@id\":\"https://docs.bevits.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.bevits.com/en/api-reference/segments/preview-segment#webpage\",\"url\":\"https://docs.bevits.com/en/api-reference/segments/preview-segment\",\"name\":\"Preview segment\",\"description\":\"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.\",\"dateModified\":\"2026-11-21T00:32:10.825Z\",\"isPartOf\":{\"@id\":\"https://docs.bevits.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.bevits.com/en/api-reference/segments/preview-segment#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.bevits.com/en/api-reference/segments/preview-segment#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Reference\",\"item\":\"https://docs.bevits.com/en/api-reference/system/check-availability\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Preview segment\",\"item\":\"https://docs.bevits.com/en/api-reference/segments/preview-segment\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.bevits.com/en/api-reference/segments/preview-segment#apireference\",\"headline\":\"Preview segment\",\"name\":\"Preview segment\",\"description\":\"Counts and samples the customers who match the conditions right now, without saving anything, and reports how many can be reached on WhatsApp and by email. Errors name each invalid condition with the valid options. Requires an API key with the read scope.\",\"url\":\"https://docs.bevits.com/en/api-reference/segments/preview-segment\",\"mainEntityOfPage\":{\"@id\":\"https://docs.bevits.com/en/api-reference/segments/preview-segment#webpage\"},\"dateModified\":\"2026-11-21T00:32:10.825Z\",\"publisher\":{\"@id\":\"https://docs.bevits.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.bevits.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bevits\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Bevits\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/en/api-reference/segments/preview-segment.md","siteName":"Bevits","nav":{"global":null,"languages":[{"language":"pt-BR","default":true,"navbar":{"links":[{"href":"mailto:hey@bevits.com","label":"Suporte"}],"primary":{"type":"button","label":"Painel","href":"https://app.bevits.com"}},"pages":[{"title":"pt-BR","href":"/pt-BR/overview"}]},{"language":"en","navbar":{"links":[{"href":"mailto:hey@bevits.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.bevits.com"}},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/en/overview"}]},{"tab":"API","groups":[{"group":"Getting started","pages":[{"title":"API overview","icon":"brackets-curly","href":"/en/api-reference/overview"},{"title":"Authentication","icon":"key","href":"/en/api-reference/authentication"},{"title":"MCP server","icon":"plug","href":"/en/api-reference/mcp"},{"title":"AI agents","icon":"sparkles","href":"/en/api-reference/ai-agents"}]},{"group":"Fundamentals","pages":[{"title":"Fundamentals","icon":"code","href":"/en/api-reference/fundamentals"}]},{"group":"Custom events","pages":[{"title":"Custom events","icon":"bolt","href":"/en/api-reference/custom-events"},{"title":"Recommended events","icon":"list-check","href":"/en/api-reference/recommended-events"}]},{"group":"Reference","pages":[{"title":"Check availability","deprecated":null,"version":null,"openapi":"/openapi.en.json get /health","href":"/en/api-reference/system/check-availability"},{"title":"Get identity","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/me","href":"/en/api-reference/identity/get-identity"},{"title":"List customers","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/customers","href":"/en/api-reference/customers/list-customers"},{"title":"Get customer","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/customers/{customer_id}","href":"/en/api-reference/customers/get-customer"},{"title":"List customer purchases","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/customers/{customer_id}/purchases","href":"/en/api-reference/customers/list-customer-purchases"},{"title":"List segments","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/segments","href":"/en/api-reference/segments/list-segments"},{"title":"Get segment","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/segments/{segment_id}","href":"/en/api-reference/segments/get-segment"},{"title":"List segment customers","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/segments/{segment_id}/customers","href":"/en/api-reference/segments/list-segment-customers"},{"title":"Get segment filter catalog","description":"Lists every condition a filter segment can use in this store, the same ones as the Customers filter screen: customer fields and custom attributes with their operators, tags, purchased products, and coupons and cashback (giftback), with the automations that issue coupons. Includes a complete example. Use it with POST /v1/segment-builder/preview and POST /v1/segments.","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/segment-builder/catalog","href":"/en/api-reference/segments/get-segment-filter-catalog"},{"title":"Preview segment","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/segment-builder/preview","href":"/en/api-reference/segments/preview-segment"},{"title":"Create filter segment","description":"Saves conditions as a filter segment, like creating a segment from the filters on the Customers screen. The segment is always up to date: it is evaluated again whenever it is read or used in a send, so customers who spend their cashback (giftback) leave and those who get a new one join. Nothing is sent: the segment only becomes an audience when a person picks it in a campaign. If the name is already taken, Bevits adds a number at the end. Check the count first with POST /v1/segment-builder/preview. Requires an API key with the write scope.","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/segments","href":"/en/api-reference/segments/create-filter-segment"},{"title":"Update segment","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/segments/{segment_id}","href":"/en/api-reference/segments/update-segment"},{"title":"Add customers to a segment","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/segments/{segment_id}/customers/add","href":"/en/api-reference/segments/add-customers-to-a-segment"},{"title":"Remove customers from a segment","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/segments/{segment_id}/customers/remove","href":"/en/api-reference/segments/remove-customers-from-a-segment"},{"title":"Preview campaign engagement segment","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/segments/campaign-engagement/preview","href":"/en/api-reference/segments/preview-campaign-engagement-segment"},{"title":"Create campaign engagement segment","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/segments/campaign-engagement","href":"/en/api-reference/segments/create-campaign-engagement-segment"},{"title":"List purchases","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/purchases","href":"/en/api-reference/purchases/list-purchases"},{"title":"Aggregate purchases","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/purchases/stats","href":"/en/api-reference/purchases/aggregate-purchases"},{"title":"Get purchase","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/purchases/{purchase_id}","href":"/en/api-reference/purchases/get-purchase"},{"title":"List tags","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/tags","href":"/en/api-reference/crm-data/list-tags"},{"title":"Get tag","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/tags/{tag_id}","href":"/en/api-reference/crm-data/get-tag"},{"title":"Create tag","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/tags","href":"/en/api-reference/crm-data/create-tag"},{"title":"Add or remove customer tags","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/customers/tags","href":"/en/api-reference/customers/add-or-remove-customer-tags"},{"title":"List attributes","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/attributes","href":"/en/api-reference/crm-data/list-attributes"},{"title":"List flows","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/flows","href":"/en/api-reference/automations/list-flows"},{"title":"Get flow","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/flows/{flow_id}","href":"/en/api-reference/automations/get-flow"},{"title":"Get flow metrics","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/flows/{flow_id}/metrics","href":"/en/api-reference/automations/get-flow-metrics"},{"title":"Get flow builder catalog","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/flow-builder/catalog","href":"/en/api-reference/automations/get-flow-builder-catalog"},{"title":"List message templates","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/message-templates","href":"/en/api-reference/automations/list-message-templates"},{"title":"Create flow as a draft","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/flows","href":"/en/api-reference/automations/create-flow-as-a-draft"},{"title":"Activate flow","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/flows/{flow_id}/activate","href":"/en/api-reference/automations/activate-flow"},{"title":"Get account context","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/account-context","href":"/en/api-reference/account-and-brand/get-account-context"},{"title":"Get brand identity","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/brand-kit","href":"/en/api-reference/account-and-brand/get-brand-identity"},{"title":"Upload brand image","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/brand-assets","href":"/en/api-reference/account-and-brand/upload-brand-image"},{"title":"List recipe deployments","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/recipe-deployments","href":"/en/api-reference/recipes/list-recipe-deployments"},{"title":"Create automations from recipes","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/recipe-deployments","href":"/en/api-reference/recipes/create-automations-from-recipes"},{"title":"Get recipe deployment","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/recipe-deployments/{deployment_id}","href":"/en/api-reference/recipes/get-recipe-deployment"},{"title":"Undo recipe deployment","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/recipe-deployments/{deployment_id}/rollback","href":"/en/api-reference/recipes/undo-recipe-deployment"},{"title":"Create email template","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/email-templates","href":"/en/api-reference/email-templates/create-email-template"},{"title":"Import HTML email","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/email-imports","href":"/en/api-reference/email-templates/import-html-email"},{"title":"Get email import","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/email-imports/{email_import_id}","href":"/en/api-reference/email-templates/get-email-import"},{"title":"Apply email import","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/email-imports/{email_import_id}/apply","href":"/en/api-reference/email-templates/apply-email-import"},{"title":"List email campaigns","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/email-campaigns","href":"/en/api-reference/campaigns/list-email-campaigns"},{"title":"Get email campaign","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/email-campaigns/{email_campaign_id}","href":"/en/api-reference/campaigns/get-email-campaign"},{"title":"Create draft email campaign","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/email-campaigns","href":"/en/api-reference/campaigns/create-draft-email-campaign"},{"title":"List WhatsApp and SMS campaigns","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/template-campaigns","href":"/en/api-reference/campaigns/list-whatsapp-and-sms-campaigns"},{"title":"Get WhatsApp or SMS campaign","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/template-campaigns/{template_campaign_id}","href":"/en/api-reference/campaigns/get-whatsapp-or-sms-campaign"},{"title":"Create a WhatsApp Official campaign as a draft","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/whatsapp-campaigns","href":"/en/api-reference/campaigns/create-a-whatsapp-official-campaign-as-a-draft"},{"title":"Send event","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/events","href":"/en/api-reference/events/send-event"},{"title":"Validate event without storing it","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/events/validate","href":"/en/api-reference/events/validate-event-without-storing-it"},{"title":"Send events in bulk","deprecated":null,"version":null,"openapi":"/openapi.en.json post /v1/events/bulk","href":"/en/api-reference/events/send-events-in-bulk"},{"title":"Get event","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/events/{event_id}","href":"/en/api-reference/events/get-event"},{"title":"List event types","deprecated":null,"version":null,"openapi":"/openapi.en.json get /v1/event-types","href":"/en/api-reference/events/list-event-types"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/en/changelog"}]}]},{"language":"es","navbar":{"links":[{"href":"mailto:hey@bevits.com","label":"Soporte"}],"primary":{"type":"button","label":"Panel","href":"https://app.bevits.com"}},"pages":[{"title":"es","href":"/es/overview"}]}]},"basePath":"","title":"Preview segment - Bevits","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","CodeSnippet-D_HwgQO_.js","getApiPlaygroundDisplay-CmCoerhe.js","Page-CVJ-f_k1.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js","Markdown-CX2QY19L.js","AssistantPageLink-CY3bFglh.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}