Segments
Rule based groups of contacts of one e-shop: an AND / OR tree of conditions, evaluated live (daily) or as a snapshot (static).
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óda | Cesta | Popis |
|---|---|---|
| GET | /api/v1/tenants/{tenant}/segments | List segments |
| POST | /api/v1/tenants/{tenant}/segments | Create a segment |
| POST | /api/v1/tenants/{tenant}/segments/preview | Count the contacts of a segment definition (no save) |
| POST | /api/v1/tenants/{tenant}/segments/tags | Change 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}/members | List the members of a segment |
| POST | /api/v1/tenants/{tenant}/segments/{segment}/recompute | Recompute a segment now |
| POST | /api/v1/tenants/{tenant}/segments/{segment}/to-list | Convert a segment into a manual list of its mailable contacts |
List segments
GET /api/v1/tenants/{tenant}/segments
Oprávnenie: modul 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ázov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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. |
page | query | integer | nie | Page number, from 1. default 1, min 1 |
pageSize | query | integer | nie | Items per page, 1 to 100. default 25, min 1, max 100 |
q | query | string | nie | Search text. max 200 chars |
refresh | query | string | nie | |
shop | query | string | nie | Shop id filter. |
sort | query | string | nie | Sort fields separated by commas, "-" = descending, at most 3 (e.g. name,-id). |
tag | query | string | nie | Label filter; repeat for more labels. |
Odpovede
- 200 OK:
application/jsonobject
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | q, refresh, sort, tag |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Create a segment
POST /api/v1/tenants/{tenant}/segments
Oprávnenie: modul 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ázov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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)
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
name | string | áno | |
publicName | string | nie | |
shopId | string | áno | |
refresh | one of: static, daily | áno | |
definition | SegmentGroup | áno | |
signatureHtml | string | nie | |
tags | array of string | nie | Labels (Štítky). |
Odpovede
- 201 Created:
application/jsonSegmentDetail
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | definition, refresh, signatureHtml, tags |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 404 | not_found | |
| 409 | conflict | name |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Count the contacts of a segment definition (no save)
POST /api/v1/tenants/{tenant}/segments/preview
Oprávnenie: modul 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).
Parametre
| Názov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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)
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
shopId | string | áno | |
definition | SegmentGroup | áno |
Odpovede
- 200 OK:
application/jsonSegmentPreview
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | definition |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Change labels of segments
POST /api/v1/tenants/{tenant}/segments/tags
Oprávnenie: modul contacts, úroveň full; kľúč s prístupom full
Parametre
| Názov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
ids | array of string | áno | |
add | array of string | nie | |
remove | array of string | nie | |
tags | array of string | nie |
Odpovede
- 200 OK:
application/jsonobject
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | ids |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Get a segment
GET /api/v1/tenants/{tenant}/segments/{segment}
Oprávnenie: modul contacts, úroveň read; kľúč s prístupom read alebo full · Nástroj MCP: get_segment
One segment with its definition tree.
Parametre
| Názov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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. |
segment | path | string | áno | Id of the segment (string of digits). |
Odpovede
- 200 OK:
application/jsonSegmentDetail
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 404 | not_found | |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Update a segment
PATCH /api/v1/tenants/{tenant}/segments/{segment}
Oprávnenie: modul contacts, úroveň full; kľúč s prístupom full · Nástroj MCP: update_segment
Changes a segment (the shop never changes).
Parametre
| Názov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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. |
segment | path | string | áno | Id of the segment (string of digits). |
Telo požiadavky (application/json)
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
name | string | nie | |
publicName | string | nie | |
shopId | string | nie | |
refresh | one of: static, daily | nie | |
definition | SegmentGroup | nie | |
signatureHtml | string | nie | |
tags | array of string | nie | Labels (Štítky). |
Odpovede
- 200 OK:
application/jsonSegmentDetail
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | definition, refresh, shop, signatureHtml, tags |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 404 | not_found | |
| 409 | conflict | name |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Delete a segment no campaign, segment or automation names
DELETE /api/v1/tenants/{tenant}/segments/{segment}
Oprávnenie: modul contacts, úroveň full; kľúč s prístupom full
SE's Smazat segment: 204; 409 'conflict' with the message campaign, segment or automation while something names it.
Parametre
| Názov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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. |
segment | path | string | áno | Id of the segment (string of digits). |
Odpovede
- 204 No content
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 404 | not_found | |
| 429 | 429 rate_limited: wait Retry-After seconds. |
List the members of a segment
GET /api/v1/tenants/{tenant}/segments/{segment}/members
Oprávnenie: modul contacts, úroveň read; kľúč s prístupom read alebo full
SE's detail of a segment (SG-07): 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ázov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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. |
segment | path | string | áno | Id of the segment (string of digits). |
engagement | query | string | nie | |
page | query | integer | nie | Page number, from 1. default 1, min 1 |
pageSize | query | integer | nie | Items per page, 1 to 100. default 25, min 1, max 100 |
q | query | string | nie | Search text (case and diacritics insensitive). max 200 chars |
sort | query | string | nie | Sort fields separated by commas, "-" = descending, at most 3 (e.g. name,-id). |
state | query | string | nie |
Odpovede
- 200 OK:
application/jsonobject
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | q |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 404 | not_found | |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Recompute a segment now
POST /api/v1/tenants/{tenant}/segments/{segment}/recompute
Oprávnenie: modul contacts, úroveň full; kľúč s prístupom full
SE's Přepočítat segment: a static segment takes a new snapshot of its members now, a daily one is live anyway (computedAt moves); the detail.
Parametre
| Názov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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. |
segment | path | string | áno | Id of the segment (string of digits). |
Telo požiadavky (application/json)
object
Odpovede
- 200 OK:
application/jsonSegmentDetail
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 404 | not_found | |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Convert a segment into a manual list of its mailable contacts
POST /api/v1/tenants/{tenant}/segments/{segment}/to-list
Oprávnenie: modul contacts, úroveň full; kľúč s prístupom full
SE's Převést na seznam: 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ázov | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | áno | Public 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. |
segment | path | string | áno | Id of the segment (string of digits). |
Telo požiadavky (application/json)
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
name | string | áno |
Odpovede
- 201 Created:
application/jsonSegmentToListResult
Chyby
| Stav | Kód | Hodnoty message |
|---|---|---|
| 400 | validation | |
| 401 | 401 unauthorized: missing, unknown, revoked, expired or idle API key. | |
| 403 | 403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack. | |
| 404 | not_found | |
| 409 | conflict | name |
| 429 | 429 rate_limited: wait Retry-After seconds. |
Schémy
ContactListItem
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
id | string | áno | |
email | string | áno | |
firstName | string | áno | |
lastName | string | áno | |
status | one of: pending, subscribed, unsubscribed, bounced, complained, customer | áno | |
engagement | one of: A, B, C, D, E, N | áno | |
excluded | boolean | áno | SE "Vyloučené": long inactive yet mailed often (recomputed weekly with the engagement). |
shopId | string or null | áno | Main e-shop (contacts.shop_id), null when unknown. |
suppressionReason | one of: invalid, manual, unsubscribed, hard_bounce, complaint, soft_bounce_limit, null | áno | Set when the address is on the tenant suppression list. |
blacklisted | boolean | nie | On 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. |
blacklistedAt | string or null | nie | When the address went on the blacklist (the suppression's time), null when it is not on it ("Přidán na blacklist"). |
state | one of: active, bounced, blacklisted | nie | SmartEmailing's 3-value contact state; older servers leave it out (contactState derives it). |
createdAt | string | áno | |
extra | map of boolean or string or number or null | nie | Values of the extra columns asked for (ContactQuery.fields): dates as YYYY-MM-DD, times as ISO. |
Error
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
error | object | áno |
{
"error": {
"code": "validation",
"message": "email"
}
}GridTagsInput
Bulk label change: add and remove, or tags = the new labels of every row.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
ids | array of string | áno | |
add | array of string | nie | |
remove | array of string | nie | |
tags | array of string | nie |
SegmentDetail
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
definition | SegmentGroup | áno | |
signatureHtml | string | áno | Advanced setting: owner's signature as HTML, sanitized like e-mail content. |
id | string | áno | |
name | string | áno | |
publicName | string | áno | Advanced setting (se-spec 01 §3): name on the unsubscribe page when the segment is used as a sendable list. |
shopId | string | áno | Segments belong to one shop; only contacts whose main shop it is are evaluated. |
refresh | one of: static, daily | áno | |
matched | number | áno | Contacts of the shop that meet the conditions, any status. |
mailable | number | áno | Of those: subscribed, not suppressed, without weak consent. |
computedAt | string | áno | |
ruleCount | number | áno | |
tags | array of string | nie | Labels (Štítky); absent from older servers. |
createdAt | string | áno | |
updatedAt | string | á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).
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | group | áno | |
match | one of: all, any | áno | all = AND, any = OR. |
rules | array of SegmentGroup or SegmentRule_field or SegmentRule_list or SegmentRule_order_count or SegmentRule_order_value or SegmentRule_last_order or SegmentRule_engagement or SegmentRule_purpose or SegmentRule_custom_field or SegmentRule_campaign or SegmentRule_order_attribute or SegmentRule_segment or SegmentRule_list_label or SegmentRule_opens or SegmentRule_product_bought or SegmentRule_web_visit or SegmentRule_web_attribute | áno | Rules and subgroups. |
{
"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
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
name | string | áno | |
publicName | string | nie | |
shopId | string | áno | |
refresh | one of: static, daily | áno | |
definition | SegmentGroup | áno | |
signatureHtml | string | nie | |
tags | array of string | nie | Labels (Štítky). |
SegmentPreview
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
matched | number | áno | |
mailable | number | áno | |
total | number | áno | All 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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | campaign | áno | |
operator | one of: received, not_received, opened, not_opened, clicked, not_clicked | áno | Operator. |
campaignId | string or null | áno | Campaign id; null only with received = an e-mail of any campaign. |
linkUrl | string | nie | clicked / not_clicked only. |
days | string or null | nie | Last N days or null. |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | custom_field | áno | |
fieldId | string | áno | Custom field id (without cf:). |
kind | one of: bool, choice, date, multi_choice, number, text | áno | Kind of the field type (see above). |
operator | string | áno | Operator for the kind. |
value | string | nie | Value (string). |
values | array of string | nie | Options (multi_choice). |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"type": "custom_field",
"fieldId": "62",
"kind": "text",
"operator": "equals",
"value": "VIP"
}SegmentRule_engagement
Engagement level A (best) to E, N = new.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | engagement | áno | |
operator | one of: in, not_in | áno | Operator. |
values | array of one of: A, B, C, D, E, N | áno | Levels. min 1 items |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | field | áno | |
field | one of: email, firstName, lastName, city, company, companyId, phone, mobile, street, postalCode, note, country, status, gender, language, source, consentBasis, createdAt, lastOpenAt, lastClickAt, lastSentAt, statusAt, consentAt | áno | Contact field. |
operator | one 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 | áno | Text: 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. |
value | string | áno | Always 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. |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | last_order | áno | |
operator | one of: in_last_days, older_than_days, before, after | áno | Operator. |
value | string | áno | Days "1" to "3650" or a date YYYY-MM-DD. |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | nie | Only orders of this shop (null = any). |
currency | string or null | nie | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
{
"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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | list | áno | |
operator | one of: in, not_in, added_before, added_after, status_is, longer_than_days, shorter_than_days | áno | Operator. |
listId | string | áno | List id. |
value | string | nie | status_is: confirmed, unconfirmed, unsubscribed, removed; added_: YYYY-MM-DD; _than_days: days "1" to "3650". |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"type": "list",
"operator": "in",
"listId": "101"
}SegmentRule_list_label
Confirmed or unconfirmed member of any list with this label.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | list_label | áno | |
operator | one of: in | áno | Operator. |
label | string | áno | Label, 1 to 40. |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"type": "list_label",
"operator": "in",
"label": "vip"
}SegmentRule_opens
Number of the contact's e-mails (campaigns and automations) with an open.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | opens | áno | |
operator | one of: eq, gt, lt, gte, lte | áno | Operator. |
value | string | áno | Count "0" to "100000". |
days | string or null | nie | Only the last N days, "1" to "3650" (null = any time). |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | order_attribute | áno | |
operator | one of: is | áno | Operator. |
scope | one of: item, order | nie | item (default) or order. default item |
attribute | string | áno | item: productCode, category, brand or any attribute name; order: status, companyId, deliveryCity, deliveryCountry, deliveryZip, deliveryCompany. |
value | string | áno | Exact value, at most 200 characters. |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | nie | Only orders of this shop (null = any). |
currency | string or null | nie | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
days | string or null | nie | Only the last N days, "1" to "3650" (null = any time). |
{
"type": "order_attribute",
"operator": "is",
"attribute": "brand",
"value": "Example"
}SegmentRule_order_count
Number of completed orders.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | order_count | áno | |
operator | one of: gte, lte, eq | áno | Operator. |
value | string | áno | Count "0" to "100000". |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | nie | Only orders of this shop (null = any). |
currency | string or null | nie | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
days | string or null | nie | Only the last N days, "1" to "3650" (null = any time). |
{
"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).
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | order_value | áno | |
operator | one of: gte, lte | áno | Operator. |
amount | string | áno | Amount, at most 2 decimals, e.g. "1500.50". |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | nie | Only orders of this shop (null = any). |
currency | string or null | áno | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
days | string or null | nie | Only the last N days, "1" to "3650" (null = any time). |
{
"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).
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | product_bought | áno | |
operator | one of: is | áno | Operator. |
value | string | áno | Part of the name or the code, at most 200. |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | nie | Only orders of this shop (null = any). |
currency | string or null | nie | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
days | string or null | nie | Only the last N days, "1" to "3650" (null = any time). |
{
"type": "product_bought",
"operator": "is",
"value": "Espresso",
"days": "30"
}SegmentRule_purpose
A valid (not withdrawn, within its validity) consent with a purpose of processing.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | purpose | áno | |
operator | one of: has, not_has | áno | Operator. |
purposeId | string | áno | Purpose id. |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"type": "purpose",
"operator": "has",
"purposeId": "51"
}SegmentRule_segment
Member of another segment of the same shop (never itself; chains at most 5 deep, no cycles).
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | segment | áno | |
operator | one of: in, not_in, added_before, added_after | áno | Operator. |
segmentId | string | áno | Segment id. |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"type": "segment",
"operator": "not_in",
"segmentId": "91"
}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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | web_attribute | áno | |
attribute | string | áno | Attribute name. |
operator | one of: is, starts_with, gt, gte, lt, lte | áno | Operator. |
value | string | áno | At most 200 (a number for gt to lte). |
days | string or null | nie | Only the last N days, "1" to "3650" (null = any time). |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"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.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
type | web_visit | áno | |
operator | one of: any, is, starts_with, contains | áno | Operator. |
url | string | nie | Not with any; at most 2 000. |
days | string or null | nie | Only the last N days, "1" to "3650" (null = any time). |
negate | boolean | nie | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
{
"type": "web_visit",
"operator": "contains",
"url": "/kava/",
"days": "30"
}SegmentSummary
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
id | string | áno | |
name | string | áno | |
publicName | string | áno | Advanced setting (se-spec 01 §3): name on the unsubscribe page when the segment is used as a sendable list. |
shopId | string | áno | Segments belong to one shop; only contacts whose main shop it is are evaluated. |
refresh | one of: static, daily | áno | |
matched | number | áno | Contacts of the shop that meet the conditions, any status. |
mailable | number | áno | Of those: subscribed, not suppressed, without weak consent. |
computedAt | string | áno | |
ruleCount | number | áno | |
tags | array of string | nie | Labels (Štítky); absent from older servers. |
createdAt | string | áno | |
updatedAt | string | áno |
SegmentToListResult
POST /segments/{id}/to-list: the new list and how many contacts it got.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
listId | string | áno | |
name | string | áno | |
members | number | áno |