POST/v2/segments
Persists a named, filter-based dynamic list. filters is an AND-joined array of leaf conditions (tag / attribute / optIn / lastInteraction / channel); at least one is required.
For nested AND/OR logic, send the recursive filterTree instead — when present it takes precedence over filters.
Request bodyapplication/json
Full body example
JSON
{ "name": "string", "description": "string", "filters": [ { "field": "tag", "operator": "is", "value": "string" } ], "filterTree": { "kind": "leaf", "filter": { "field": "tag", "operator": "is", "value": "string" } }}Responses
200Default Response
Response fields and example
401RFC 7807 problem details for UNAUTHORIZED (401).
403RFC 7807 problem details for FORBIDDEN (403).
409RFC 7807 problem details for CONFLICT (409).
422RFC 7807 problem details for VALIDATION_ERROR (422).
Error responses follow RFC 7807 (application/problem+json), with a stable code in the code field. See the error codes
curl example
cURL
curl -X POST 'https://api.messages.ccxcompany.co/v2/segments' \ -H "Authorization: Bearer $CCX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "filters": [ { "field": "tag", "operator": "is", "value": "string" } ] }' Required fields only. Swap the sample values for your own.GET/v2/segments/{segmentId}
Returns a single segment by id. Cross-tenant ids return 404.
Responses
200Default Response
Response fields and example
401RFC 7807 problem details for UNAUTHORIZED (401).
403RFC 7807 problem details for FORBIDDEN (403).
404RFC 7807 problem details for NOT_FOUND (404).
Error responses follow RFC 7807 (application/problem+json), with a stable code in the code field. See the error codes
curl example
cURL
curl 'https://api.messages.ccxcompany.co/v2/segments/<segmentId>' \ -H "Authorization: Bearer $CCX_API_KEY"
Required fields only. Swap the sample values for your own.PATCH/v2/segments/{segmentId}
Partial update. Any of name, description, filters, filterTree may be sent; omitted fields are unchanged.
Request bodyapplication/json
Full body example
JSON
{ "name": "string", "description": "string", "filters": [ { "field": "tag", "operator": "is", "value": "string" } ], "filterTree": { "kind": "leaf", "filter": { "field": "tag", "operator": "is", "value": "string" } }}Responses
200Default Response
Response fields and example
401RFC 7807 problem details for UNAUTHORIZED (401).
403RFC 7807 problem details for FORBIDDEN (403).
404RFC 7807 problem details for NOT_FOUND (404).
409RFC 7807 problem details for CONFLICT (409).
422RFC 7807 problem details for VALIDATION_ERROR (422).
Error responses follow RFC 7807 (application/problem+json), with a stable code in the code field. See the error codes
curl example
cURL
curl -X PATCH 'https://api.messages.ccxcompany.co/v2/segments/<segmentId>' \ -H "Authorization: Bearer $CCX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' Required fields only. Swap the sample values for your own.POST/v2/segments/preview
Evaluate a tentative filter set and get back the match count + a sample of contact ids, without saving a segment. Same filters / filterTree shape as create.
Request bodyapplication/json
Full body example
JSON
{ "filters": [ { "field": "tag", "operator": "is", "value": "string" } ], "filterTree": { "kind": "leaf", "filter": { "field": "tag", "operator": "is", "value": "string" } }}Responses
200Default Response
Response fields and example
401RFC 7807 problem details for UNAUTHORIZED (401).
403RFC 7807 problem details for FORBIDDEN (403).
422RFC 7807 problem details for VALIDATION_ERROR (422).
Error responses follow RFC 7807 (application/problem+json), with a stable code in the code field. See the error codes
curl example
cURL
curl -X POST 'https://api.messages.ccxcompany.co/v2/segments/preview' \ -H "Authorization: Bearer $CCX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "filters": [ { "field": "tag", "operator": "is", "value": "string" } ] }' Required fields only. Swap the sample values for your own.