Preskočiť na obsah
API dokumentácia

Segmenty

Referencia API pre segmenty: skupiny kontaktov jedného e-shopu podľa stromu podmienok A / ALEBO, živé (denne) alebo ako snímka.

Technická referencia je v angličtine (rovnako ako strojovo čitateľný dokument OpenAPI). Celú skupinu pre AI agenta načítate z /api/openapi.json?tag=Segments.

Prihlásenie: Authorization: Bearer pst_... alebo HTTP Basic (e-mail člena firmy a API kľúč).

Operácie

MetódaCestaPopis
GET/api/v1/tenants/{tenant}/segmentsList segments
POST/api/v1/tenants/{tenant}/segmentsCreate a segment
POST/api/v1/tenants/{tenant}/segments/previewCount the contacts of a segment definition (no save)
POST/api/v1/tenants/{tenant}/segments/tagsChange labels of segments
GET/api/v1/tenants/{tenant}/segments/{segment}Get a segment
PATCH/api/v1/tenants/{tenant}/segments/{segment}Update a segment
DELETE/api/v1/tenants/{tenant}/segments/{segment}Delete a segment no campaign, segment or automation names
GET/api/v1/tenants/{tenant}/segments/{segment}/membersList the members of a segment
POST/api/v1/tenants/{tenant}/segments/{segment}/recomputeRecompute a segment now
POST/api/v1/tenants/{tenant}/segments/{segment}/to-listConvert a segment into a manual list of its mailable contacts

List segments

GET /api/v1/tenants/{tenant}/segments

Oprávnenie: oblasť contacts, úroveň read; kľúč s prístupom read alebo full · Nástroj MCP: list_segments

Segments with matched and mailable counts.

Filtry of the grid (routes_grid.py): ?tag= (repeatable), ?idFrom=&idTo=, ?createdFrom=&createdTo=, ?updatedFrom=&updatedTo= (calendar days), ?refresh=static|daily.

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.
pagequeryintegerniePage number, from 1. default 1, min 1
pageSizequeryintegernieItems per page, 1 to 100. default 25, min 1, max 100
qquerystringnieSearch text. max 200 chars
refreshquerystringnie
shopquerystringnieShop id filter.
sortquerystringnieSort fields separated by commas, "-" = descending, at most 3 (e.g. name,-id).
tagquerystringnieLabel filter; repeat for more labels.

Odpovede

  • 200 OK: application/json object

Chyby

StavKódHodnoty message
400validationq, refresh, sort, tag
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Create a segment

POST /api/v1/tenants/{tenant}/segments

Oprávnenie: oblasť contacts, úroveň full; kľúč s prístupom full · Nástroj MCP: create_segment

Creates a segment of one shop from a condition tree {type: group, match: all|any, rules: [...]} (rule types: get_api_reference Segmenty).

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.

Telo požiadavky (application/json)

PoleTypPovinnéPopis
namestringáno
publicNamestringnie
shopIdstringáno
refreshone of: static, dailyáno
definitionSegmentGroupáno
signatureHtmlstringnie
tagsarray of stringnieLabels (Štítky).

Odpovede

Chyby

StavKódHodnoty message
400validationdefinition, refresh, signatureHtml, tags
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
404not_found
409conflictname
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Count the contacts of a segment definition (no save)

POST /api/v1/tenants/{tenant}/segments/preview

Oprávnenie: oblasť contacts, úroveň read; kľúč s prístupom read alebo full · Nástroj MCP: preview_segment

Counts a condition tree without saving: matched, mailable and total contacts of the shop.

Live count for the editor: {matched, mailable, total}; the root may be empty (all contacts of the shop). Past PREVIEW_BUDGET_S the answer is 503 unavailable 'timeout' (the editor shows the count as unavailable).

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.

Telo požiadavky (application/json)

PoleTypPovinnéPopis
shopIdstringáno
definitionSegmentGroupáno

Odpovede

Chyby

StavKódHodnoty message
400validationdefinition
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Change labels of segments

POST /api/v1/tenants/{tenant}/segments/tags

Oprávnenie: oblasť contacts, úroveň full; kľúč s prístupom full

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.

Telo požiadavky (application/json): Required by the server: ids.

PoleTypPovinnéPopis
idsarray of stringáno
addarray of stringnie
removearray of stringnie
tagsarray of stringnie

Odpovede

  • 200 OK: application/json object

Chyby

StavKódHodnoty message
400validationids
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Get a segment

GET /api/v1/tenants/{tenant}/segments/{segment}

Oprávnenie: oblasť contacts, úroveň read; kľúč s prístupom read alebo full · Nástroj MCP: get_segment

One segment with its definition tree.

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.
segmentpathstringánoId of the segment (string of digits).

Odpovede

Chyby

StavKódHodnoty message
400validation
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
404not_found
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Update a segment

PATCH /api/v1/tenants/{tenant}/segments/{segment}

Oprávnenie: oblasť contacts, úroveň full; kľúč s prístupom full · Nástroj MCP: update_segment

Changes a segment (the shop never changes).

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.
segmentpathstringánoId of the segment (string of digits).

Telo požiadavky (application/json)

PoleTypPovinnéPopis
namestringnie
publicNamestringnie
shopIdstringnie
refreshone of: static, dailynie
definitionSegmentGroupnie
signatureHtmlstringnie
tagsarray of stringnieLabels (Štítky).

Odpovede

Chyby

StavKódHodnoty message
400validationdefinition, refresh, shop, signatureHtml, tags
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
404not_found
409conflictname
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Delete a segment no campaign, segment or automation names

DELETE /api/v1/tenants/{tenant}/segments/{segment}

Oprávnenie: oblasť contacts, úroveň full; kľúč s prístupom full

204; 409 'conflict' with the message campaign, segment or automation while something names it.

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.
segmentpathstringánoId of the segment (string of digits).

Odpovede

  • 204 No content

Chyby

StavKódHodnoty message
400validation
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
404not_found
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

List the members of a segment

GET /api/v1/tenants/{tenant}/segments/{segment}/members

Oprávnenie: oblasť contacts, úroveň read; kľúč s prístupom read alebo full

Its members as the contacts grid (?q=, ?state=, ?engagement=, ?sort=, paging; rows as GET /contacts): the stored snapshot of a static segment, the live definition otherwise.

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.
segmentpathstringánoId of the segment (string of digits).
engagementquerystringnie
pagequeryintegerniePage number, from 1. default 1, min 1
pageSizequeryintegernieItems per page, 1 to 100. default 25, min 1, max 100
qquerystringnieSearch text (case and diacritics insensitive). max 200 chars
sortquerystringnieSort fields separated by commas, "-" = descending, at most 3 (e.g. name,-id).
statequerystringnie

Odpovede

  • 200 OK: application/json object

Chyby

StavKódHodnoty message
400validationq
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
404not_found
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Recompute a segment now

POST /api/v1/tenants/{tenant}/segments/{segment}/recompute

Oprávnenie: oblasť contacts, úroveň full; kľúč s prístupom full

A static segment takes a new snapshot of its members now, a daily one is live anyway (computedAt moves); the detail.

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.
segmentpathstringánoId of the segment (string of digits).

Telo požiadavky (application/json)

object

Odpovede

Chyby

StavKódHodnoty message
400validation
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
404not_found
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Convert a segment into a manual list of its mailable contacts

POST /api/v1/tenants/{tenant}/segments/{segment}/to-list

Oprávnenie: oblasť contacts, úroveň full; kľúč s prístupom full

Body {name}; 201 {listId, name, members} with a new manual list of the segment's mailable contacts now (bulk: no automation starts); 409 'conflict' / 'name' for a taken list name.

Parametre

NázovKdeTypPovinnéPopis
tenantpathstring (uuid)ánoPublic id of the company (tenant), a UUID: GET /api/v3/account-info answers it as data.guid; the app shows it on the API keys page.
segmentpathstringánoId of the segment (string of digits).

Telo požiadavky (application/json)

PoleTypPovinnéPopis
namestringáno

Odpovede

Chyby

StavKódHodnoty message
400validation
401401 unauthorized: missing, unknown, revoked, expired or idle API key.
403403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.
404not_found
409conflictname
429429 rate_limited: wait Retry-After seconds.
503unavailablebusy

Schémy

ContactListItem

PoleTypPovinnéPopis
idstringáno
emailstringáno
firstNamestringáno
lastNamestringáno
statusone of: pending, subscribed, unsubscribed, bounced, complained, customeráno
engagementone of: A, B, C, D, E, Náno
excludedbooleanánoLong inactive yet mailed often (recomputed weekly with the engagement).
shopIdstring or nullánoMain e-shop (contacts.shop_id), null when unknown.
suppressionReasonone of: invalid, manual, complaint, unsubscribed, hard_bounce, soft_bounce_limit, nullánoSet when the address is on the tenant suppression list.
blacklistedbooleannieOn the tenant's blacklist ("Na blacklistu"): a manual entry, or an entry of SmartEmailing's blacklist that keeps its own reason (migration 0180). Older servers leave it out: then suppressionReason 'manual' decides.
blacklistedAtstring or nullnieWhen the address went on the blacklist (the suppression's time), null when it is not on it ("Přidán na blacklist").
stateone of: active, bounced, blacklistednieThe contact state in three values; older servers leave it out (contactState derives it).
createdAtstringáno
extramap of boolean or string or number or nullnieValues of the extra columns asked for (ContactQuery.fields): dates as YYYY-MM-DD, times as ISO.

Error

PoleTypPovinnéPopis
errorobjectáno
json
{
  "error": {
    "code": "validation",
    "message": "email"
  }
}

GridTagsInput

Bulk label change: add and remove, or tags = the new labels of every row.

PoleTypPovinnéPopis
idsarray of stringáno
addarray of stringnie
removearray of stringnie
tagsarray of stringnie

SegmentDetail

PoleTypPovinnéPopis
matchednumberánoThe detail counts the segment when it is opened (and stores the result for the grid).
mailablenumberánoOf those: subscribed, not suppressed, without weak consent (null as matched).
definitionSegmentGroupáno
signatureHtmlstringánoAdvanced setting: owner's signature as HTML, sanitized like e-mail content.
idstringáno
namestringáno
publicNamestringánoAdvanced setting (se-spec 01 §3): name on the unsubscribe page when the segment is used as a sendable list.
shopIdstringánoSegments belong to one shop; only contacts whose main shop it is are evaluated.
refreshone of: static, dailyáno
countedAtstring or nullnieWhen the counts were taken (null = never yet).
countsPendingbooleannieThe counts are missing or older than 15 minutes and a background refresh is queued.
countsTimedOutbooleannieThe worker's last count ran out of time; it tries again after 6 hours.
computedAtstringáno
ruleCountnumberáno
tagsarray of stringnieLabels (Štítky); absent from older servers.
createdAtstringáno
updatedAtstringáno

SegmentGroup

A segment definition: AND (all) / OR (any) groups nested at most 8 levels, at most 50 rules. An empty root matches every contact of the shop (a saved segment needs at least one rule); an empty subgroup is an error. Errors: 400 validation "definition.<path>.<field>" (path = indices from the root).

json
{
  "type": "group",
  "match": "any",
  "rules": [
    {
      "type": "order_value",
      "operator": "gte",
      "amount": "2000",
      "currency": "CZK",
      "shopId": "1",
      "days": "365"
    },
    {
      "type": "group",
      "match": "all",
      "rules": [
        {
          "type": "list",
          "operator": "in",
          "listId": "101"
        },
        {
          "type": "field",
          "field": "lastOpenAt",
          "operator": "in_last_days",
          "value": "60"
        }
      ]
    }
  ]
}

SegmentInput

PoleTypPovinnéPopis
namestringáno
publicNamestringnie
shopIdstringáno
refreshone of: static, dailyáno
definitionSegmentGroupáno
signatureHtmlstringnie
tagsarray of stringnieLabels (Štítky).

SegmentPreview

PoleTypPovinnéPopis
matchednumberáno
mailablenumberáno
totalnumberánoAll contacts of the shop.

SegmentRule_campaign

Delivered / opened / clicked a campaign (not_* also matches contacts that never got it); linkUrl narrows clicks to one link.

PoleTypPovinnéPopis
typecampaignáno
operatorone of: received, not_received, opened, not_opened, clicked, not_clickedánoOperator.
campaignIdstring or nullánoCampaign id; null only with received = an e-mail of any campaign.
linkUrlstringnieclicked / not_clicked only.
daysstring or nullnieLast N days or null.
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "campaign",
  "operator": "opened",
  "campaignId": "121",
  "days": null
}

SegmentRule_custom_field

A custom field. kind must match the field type: text and textarea -> text, number -> number, date -> date, checkbox -> bool, select and radio -> choice, multi_checkbox -> multi_choice (400 definition.<path>.kind otherwise). Operators: text like the text fields, number gte/lte/eq/is_empty/is_not_empty, date like the date fields, bool is_true/is_false, choice is/is_not, multi_choice contains_any/contains_all/not_contains_any.

PoleTypPovinnéPopis
typecustom_fieldáno
fieldIdstringánoCustom field id (without cf:).
kindone of: bool, choice, date, multi_choice, number, textánoKind of the field type (see above).
operatorstringánoOperator for the kind.
valuestringnieValue (string).
valuesarray of stringnieOptions (multi_choice).
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "custom_field",
  "fieldId": "62",
  "kind": "text",
  "operator": "equals",
  "value": "VIP"
}

SegmentRule_engagement

Engagement level A (best) to E, N = new.

PoleTypPovinnéPopis
typeengagementáno
operatorone of: in, not_inánoOperator.
valuesarray of one of: A, B, C, D, E, NánoLevels. min 1 items
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "engagement",
  "operator": "in",
  "values": [
    "A",
    "B"
  ]
}

SegmentRule_field

A contact field compared with a value. Text operators ignore case and diacritics; date operators count calendar days of the company. Text fields: email, firstName, lastName, city, company, companyId, phone, mobile, street, postalCode, note, country. Enum fields: status (pending/subscribed/unsubscribed/bounced/complained/customer), gender (f/m), language (cs/sk), source (erp_order/signup_form/import/api/manual/shoptet/smartemailing), consentBasis (soft_opt_in_customer/double_opt_in/imported/none). Date fields: createdAt, lastOpenAt, lastClickAt, lastSentAt, statusAt, consentAt.

PoleTypPovinnéPopis
typefieldáno
fieldone of: email, firstName, lastName, city, company, companyId, phone, mobile, street, postalCode, note, country, status, gender, language, source, consentBasis, createdAt, lastOpenAt, lastClickAt, lastSentAt, statusAt, consentAtánoContact field.
operatorone of: contains, not_contains, equals, not_equals, starts_with, ends_with, is_empty, is_not_empty, is, is_not, in_last_days, not_in_last_days, before, after, until, sinceánoText: contains, not_contains, equals, not_equals, starts_with, ends_with, is_empty, is_not_empty; enum: is, is_not; date: in_last_days, not_in_last_days, before, after, until, since, is_empty, is_not_empty.
valuestringánoAlways a string: the text, the enum value, a number of days ("30") for in_last_days / not_in_last_days, or a date YYYY-MM-DD for before / after; "" for is_empty / is_not_empty.
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "field",
  "field": "lastOpenAt",
  "operator": "in_last_days",
  "value": "60"
}

SegmentRule_last_order

The last completed order: within / older than N days, or before / after a date.

PoleTypPovinnéPopis
typelast_orderáno
operatorone of: in_last_days, older_than_days, before, afteránoOperator.
valuestringánoDays "1" to "3650" or a date YYYY-MM-DD.
negatebooleannietrue = the rule must NOT hold.
shopIdstring or nullnieOnly orders of this shop (null = any).
currencystring or nullnieOnly orders in this currency (CZK or EUR; it must be the currency of shopId when both are set).
json
{
  "type": "last_order",
  "operator": "older_than_days",
  "value": "180"
}

SegmentRule_list

Membership in a list. in / not_in = confirmed or unconfirmed member; status_is compares the exact state; added_before / added_after compare the day the contact was added; longer_than_days / shorter_than_days: in the list longer / shorter than N days.

PoleTypPovinnéPopis
typelistáno
operatorone of: in, not_in, added_before, added_after, status_is, longer_than_days, shorter_than_daysánoOperator.
listIdstringánoList id.
valuestringniestatus_is: confirmed, unconfirmed, unsubscribed, removed; added_: YYYY-MM-DD; _than_days: days "1" to "3650".
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "list",
  "operator": "in",
  "listId": "101"
}

SegmentRule_list_label

Confirmed or unconfirmed member of any list with this label.

PoleTypPovinnéPopis
typelist_labeláno
operatorone of: inánoOperator.
labelstringánoLabel, 1 to 40.
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "list_label",
  "operator": "in",
  "label": "vip"
}

SegmentRule_opens

Number of the contact's e-mails (campaigns and automations) with an open.

PoleTypPovinnéPopis
typeopensáno
operatorone of: eq, gt, lt, gte, lteánoOperator.
valuestringánoCount "0" to "100000".
daysstring or nullnieOnly the last N days, "1" to "3650" (null = any time).
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "opens",
  "operator": "gte",
  "value": "3",
  "days": "90"
}

SegmentRule_order_attribute

A completed order has an item whose product code, category, brand or another item attribute (as stored on the order item) equals the value; with scope order an attribute of the order itself.

PoleTypPovinnéPopis
typeorder_attributeáno
operatorone of: isánoOperator.
scopeone of: item, ordernieitem (default) or order. default item
attributestringánoitem: productCode, category, brand or any attribute name; order: status, companyId, deliveryCity, deliveryCountry, deliveryZip, deliveryCompany, shippingMethod, shippingType.
valuestringánoExact value, at most 200 characters.
negatebooleannietrue = the rule must NOT hold.
shopIdstring or nullnieOnly orders of this shop (null = any).
currencystring or nullnieOnly orders in this currency (CZK or EUR; it must be the currency of shopId when both are set).
daysstring or nullnieOnly the last N days, "1" to "3650" (null = any time).
json
{
  "type": "order_attribute",
  "operator": "is",
  "attribute": "brand",
  "value": "Example"
}

SegmentRule_order_count

Number of completed orders.

PoleTypPovinnéPopis
typeorder_countáno
operatorone of: gte, lte, eqánoOperator.
valuestringánoCount "0" to "100000".
negatebooleannietrue = the rule must NOT hold.
shopIdstring or nullnieOnly orders of this shop (null = any).
currencystring or nullnieOnly orders in this currency (CZK or EUR; it must be the currency of shopId when both are set).
daysstring or nullnieOnly the last N days, "1" to "3650" (null = any time).
json
{
  "type": "order_count",
  "operator": "gte",
  "value": "2",
  "shopId": null,
  "currency": null,
  "days": "365"
}

SegmentRule_order_value

Sum of completed orders with VAT in one currency (CZK and EUR are never added up).

PoleTypPovinnéPopis
typeorder_valueáno
operatorone of: gte, lteánoOperator.
amountstringánoAmount, at most 2 decimals, e.g. "1500.50".
negatebooleannietrue = the rule must NOT hold.
shopIdstring or nullnieOnly orders of this shop (null = any).
currencystring or nullánoOnly orders in this currency (CZK or EUR; it must be the currency of shopId when both are set).
daysstring or nullnieOnly the last N days, "1" to "3650" (null = any time).
json
{
  "type": "order_value",
  "operator": "gte",
  "amount": "2000",
  "currency": "CZK",
  "shopId": "1",
  "days": "365"
}

SegmentRule_product_bought

A completed order has an item whose name contains the text or whose product code equals it (case and diacritics ignored).

PoleTypPovinnéPopis
typeproduct_boughtáno
operatorone of: isánoOperator.
valuestringánoPart of the name or the code, at most 200.
negatebooleannietrue = the rule must NOT hold.
shopIdstring or nullnieOnly orders of this shop (null = any).
currencystring or nullnieOnly orders in this currency (CZK or EUR; it must be the currency of shopId when both are set).
daysstring or nullnieOnly the last N days, "1" to "3650" (null = any time).
json
{
  "type": "product_bought",
  "operator": "is",
  "value": "Espresso",
  "days": "30"
}

SegmentRule_purpose

A valid (not withdrawn, within its validity) consent with a purpose of processing.

PoleTypPovinnéPopis
typepurposeáno
operatorone of: has, not_hasánoOperator.
purposeIdstringánoPurpose id.
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "purpose",
  "operator": "has",
  "purposeId": "51"
}

The answer of the contact's latest order (not deleted, latest placed) to a review box of the checkout, read by the shop's script: program shop = the request to review the shop and products, heureka = Ověřeno zákazníky, zbozi = Zboží.cz; value yes = allowed, no = refused, unknown = no order or no answer on the latest order.

PoleTypPovinnéPopis
typereview_consentáno
programone of: shop, heureka, zboziánoProgram.
valueone of: yes, no, unknownánoAnswer.
shopIdstring or nullnieOnly orders of this shop (null = any).
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "review_consent",
  "program": "shop",
  "value": "no"
}

SegmentRule_segment

Member of another segment of the same shop (never itself; chains at most 5 deep, no cycles).

PoleTypPovinnéPopis
typesegmentáno
operatorone of: in, not_in, added_before, added_afteránoOperator.
segmentIdstringánoSegment id.
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "segment",
  "operator": "not_in",
  "segmentId": "91"
}

SegmentRule_survey

A response of the contact to a survey.

PoleTypPovinnéPopis
typesurveyáno
operatorone of: filled, not_filled, answer_is, answer_contains, rating_gte, rating_lteánofilled / not_filled = answered the survey or not; answer_is / answer_contains = the answer to questionId equals or contains value (case and diacritics ignored, one of the ticked choices); rating_gte / rating_lte = a stars, scale or number answer at least / at most value.
surveyIdstringánoSurvey id.
questionIdstringnieQuestion id (q + digits) of the survey; not for filled / not_filled.
valuestringnieText, at most 200; a number for rating_gte / rating_lte.
daysstring or nullnieOnly the last N days, "1" to "3650" (null = any time).
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "survey",
  "operator": "answer_is",
  "surveyId": "131",
  "questionId": "q1",
  "value": "Espresso"
}

SegmentRule_web_attribute

A page visit whose attribute matches: visitType = the page type, other names = the visit's own attributes; gt to lte compare numbers.

PoleTypPovinnéPopis
typeweb_attributeáno
attributestringánoAttribute name.
operatorone of: is, starts_with, gt, gte, lt, lteánoOperator.
valuestringánoAt most 200 (a number for gt to lte).
daysstring or nullnieOnly the last N days, "1" to "3650" (null = any time).
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "web_attribute",
  "attribute": "visitType",
  "operator": "is",
  "value": "product"
}

SegmentRule_web_visit

A page visit recorded by the shop's script or the API; any = any page.

PoleTypPovinnéPopis
typeweb_visitáno
operatorone of: any, is, starts_with, containsánoOperator.
urlstringnieNot with any; at most 2 000.
daysstring or nullnieOnly the last N days, "1" to "3650" (null = any time).
negatebooleannietrue = the rule must NOT hold.
json
{
  "type": "web_visit",
  "operator": "contains",
  "url": "/kava/",
  "days": "30"
}

SegmentSummary

PoleTypPovinnéPopis
idstringáno
namestringáno
publicNamestringánoAdvanced setting (se-spec 01 §3): name on the unsubscribe page when the segment is used as a sendable list.
shopIdstringánoSegments belong to one shop; only contacts whose main shop it is are evaluated.
refreshone of: static, dailyáno
matchednumber or nullánoContacts of the shop that meet the conditions, any status. The grid shows the stored count (migration 0615): null until the segment was counted for the first time; a light segment's count is at most a minute old (the grid recounts it itself, A-1201-02), a heavy one's up to 15 minutes (countedAt, countsPending).
mailablenumber or nullánoOf those: subscribed, not suppressed, without weak consent (null as matched).
countedAtstring or nullnieWhen the counts were taken (null = never yet).
countsPendingbooleannieThe counts are missing or older than 15 minutes and a background refresh is queued.
countsTimedOutbooleannieThe worker's last count ran out of time; it tries again after 6 hours.
computedAtstringáno
ruleCountnumberáno
tagsarray of stringnieLabels (Štítky); absent from older servers.
createdAtstringáno
updatedAtstringáno

SegmentToListResult

POST /segments/{id}/to-list: the new list and how many contacts it got.

PoleTypPovinnéPopis
listIdstringáno
namestringáno
membersnumberáno