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á reference je anglicky (stejně jako strojově čitelný dokument OpenAPI). Celou skupinu pro AI agenta načtete z /api/openapi.json?tag=Segments.
Přihlášení: Authorization: Bearer pst_... nebo HTTP Basic (e-mail člena firmy a API klíč).
Operace
| Metoda | 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ávnění: modul contacts, úroveň read; klíč s přístupem read nebo 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.
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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 | ne | Page number, from 1. default 1, min 1 |
pageSize | query | integer | ne | Items per page, 1 to 100. default 25, min 1, max 100 |
q | query | string | ne | Search text. max 200 chars |
refresh | query | string | ne | |
shop | query | string | ne | Shop id filter. |
sort | query | string | ne | Sort fields separated by commas, "-" = descending, at most 3 (e.g. name,-id). |
tag | query | string | ne | Label filter; repeat for more labels. |
Odpovědi
- 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ávnění: modul contacts, úroveň full; klíč s přístupem 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).
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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. |
Tělo požadavku (application/json)
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
name | string | ano | |
publicName | string | ne | |
shopId | string | ano | |
refresh | one of: static, daily | ano | |
definition | SegmentGroup | ano | |
signatureHtml | string | ne | |
tags | array of string | ne | Labels (Štítky). |
Odpovědi
- 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ávnění: modul contacts, úroveň read; klíč s přístupem read nebo 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).
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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. |
Tělo požadavku (application/json)
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
shopId | string | ano | |
definition | SegmentGroup | ano |
Odpovědi
- 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ávnění: modul contacts, úroveň full; klíč s přístupem full
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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. |
Tělo požadavku (application/json): Required by the server: ids.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
ids | array of string | ano | |
add | array of string | ne | |
remove | array of string | ne | |
tags | array of string | ne |
Odpovědi
- 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ávnění: modul contacts, úroveň read; klíč s přístupem read nebo full · Nástroj MCP: get_segment
One segment with its definition tree.
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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 | ano | Id of the segment (string of digits). |
Odpovědi
- 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ávnění: modul contacts, úroveň full; klíč s přístupem full · Nástroj MCP: update_segment
Changes a segment (the shop never changes).
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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 | ano | Id of the segment (string of digits). |
Tělo požadavku (application/json)
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
name | string | ne | |
publicName | string | ne | |
shopId | string | ne | |
refresh | one of: static, daily | ne | |
definition | SegmentGroup | ne | |
signatureHtml | string | ne | |
tags | array of string | ne | Labels (Štítky). |
Odpovědi
- 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ávnění: modul contacts, úroveň full; klíč s přístupem full
SE's Smazat segment: 204; 409 'conflict' with the message campaign, segment or automation while something names it.
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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 | ano | Id of the segment (string of digits). |
Odpovědi
- 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ávnění: modul contacts, úroveň read; klíč s přístupem read nebo 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.
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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 | ano | Id of the segment (string of digits). |
engagement | query | string | ne | |
page | query | integer | ne | Page number, from 1. default 1, min 1 |
pageSize | query | integer | ne | Items per page, 1 to 100. default 25, min 1, max 100 |
q | query | string | ne | Search text (case and diacritics insensitive). max 200 chars |
sort | query | string | ne | Sort fields separated by commas, "-" = descending, at most 3 (e.g. name,-id). |
state | query | string | ne |
Odpovědi
- 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ávnění: modul contacts, úroveň full; klíč s přístupem 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.
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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 | ano | Id of the segment (string of digits). |
Tělo požadavku (application/json)
object
Odpovědi
- 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ávnění: modul contacts, úroveň full; klíč s přístupem 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.
Parametry
| Název | Kde | Typ | Povinné | Popis |
|---|---|---|---|---|
tenant | path | string (uuid) | ano | 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 | ano | Id of the segment (string of digits). |
Tělo požadavku (application/json)
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
name | string | ano |
Odpovědi
- 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émata
ContactListItem
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
id | string | ano | |
email | string | ano | |
firstName | string | ano | |
lastName | string | ano | |
status | one of: pending, subscribed, unsubscribed, bounced, complained, customer | ano | |
engagement | one of: A, B, C, D, E, N | ano | |
excluded | boolean | ano | SE "Vyloučené": long inactive yet mailed often (recomputed weekly with the engagement). |
shopId | string or null | ano | Main e-shop (contacts.shop_id), null when unknown. |
suppressionReason | one of: invalid, manual, unsubscribed, hard_bounce, complaint, soft_bounce_limit, null | ano | Set when the address is on the tenant suppression list. |
blacklisted | boolean | ne | 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 | ne | 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 | ne | SmartEmailing's 3-value contact state; older servers leave it out (contactState derives it). |
createdAt | string | ano | |
extra | map of boolean or string or number or null | ne | Values of the extra columns asked for (ContactQuery.fields): dates as YYYY-MM-DD, times as ISO. |
Error
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
error | object | ano |
{
"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 | ano | |
add | array of string | ne | |
remove | array of string | ne | |
tags | array of string | ne |
SegmentDetail
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
definition | SegmentGroup | ano | |
signatureHtml | string | ano | Advanced setting: owner's signature as HTML, sanitized like e-mail content. |
id | string | ano | |
name | string | ano | |
publicName | string | ano | Advanced setting (se-spec 01 §3): name on the unsubscribe page when the segment is used as a sendable list. |
shopId | string | ano | Segments belong to one shop; only contacts whose main shop it is are evaluated. |
refresh | one of: static, daily | ano | |
matched | number | ano | Contacts of the shop that meet the conditions, any status. |
mailable | number | ano | Of those: subscribed, not suppressed, without weak consent. |
computedAt | string | ano | |
ruleCount | number | ano | |
tags | array of string | ne | Labels (Štítky); absent from older servers. |
createdAt | string | ano | |
updatedAt | string | ano |
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 | ano | |
match | one of: all, any | ano | 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 | ano | 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 | ano | |
publicName | string | ne | |
shopId | string | ano | |
refresh | one of: static, daily | ano | |
definition | SegmentGroup | ano | |
signatureHtml | string | ne | |
tags | array of string | ne | Labels (Štítky). |
SegmentPreview
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
matched | number | ano | |
mailable | number | ano | |
total | number | ano | 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 | ano | |
operator | one of: received, not_received, opened, not_opened, clicked, not_clicked | ano | Operator. |
campaignId | string or null | ano | Campaign id; null only with received = an e-mail of any campaign. |
linkUrl | string | ne | clicked / not_clicked only. |
days | string or null | ne | Last N days or null. |
negate | boolean | ne | 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 | ano | |
fieldId | string | ano | Custom field id (without cf:). |
kind | one of: bool, choice, date, multi_choice, number, text | ano | Kind of the field type (see above). |
operator | string | ano | Operator for the kind. |
value | string | ne | Value (string). |
values | array of string | ne | Options (multi_choice). |
negate | boolean | ne | 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 | ano | |
operator | one of: in, not_in | ano | Operator. |
values | array of one of: A, B, C, D, E, N | ano | Levels. min 1 items |
negate | boolean | ne | 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 | ano | |
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 | ano | 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 | ano | 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 | ano | 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 | ne | 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 | ano | |
operator | one of: in_last_days, older_than_days, before, after | ano | Operator. |
value | string | ano | Days "1" to "3650" or a date YYYY-MM-DD. |
negate | boolean | ne | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | ne | Only orders of this shop (null = any). |
currency | string or null | ne | 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 | ano | |
operator | one of: in, not_in, added_before, added_after, status_is, longer_than_days, shorter_than_days | ano | Operator. |
listId | string | ano | List id. |
value | string | ne | status_is: confirmed, unconfirmed, unsubscribed, removed; added_: YYYY-MM-DD; _than_days: days "1" to "3650". |
negate | boolean | ne | 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 | ano | |
operator | one of: in | ano | Operator. |
label | string | ano | Label, 1 to 40. |
negate | boolean | ne | 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 | ano | |
operator | one of: eq, gt, lt, gte, lte | ano | Operator. |
value | string | ano | Count "0" to "100000". |
days | string or null | ne | Only the last N days, "1" to "3650" (null = any time). |
negate | boolean | ne | 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 | ano | |
operator | one of: is | ano | Operator. |
scope | one of: item, order | ne | item (default) or order. default item |
attribute | string | ano | item: productCode, category, brand or any attribute name; order: status, companyId, deliveryCity, deliveryCountry, deliveryZip, deliveryCompany. |
value | string | ano | Exact value, at most 200 characters. |
negate | boolean | ne | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | ne | Only orders of this shop (null = any). |
currency | string or null | ne | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
days | string or null | ne | 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 | ano | |
operator | one of: gte, lte, eq | ano | Operator. |
value | string | ano | Count "0" to "100000". |
negate | boolean | ne | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | ne | Only orders of this shop (null = any). |
currency | string or null | ne | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
days | string or null | ne | 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 | ano | |
operator | one of: gte, lte | ano | Operator. |
amount | string | ano | Amount, at most 2 decimals, e.g. "1500.50". |
negate | boolean | ne | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | ne | Only orders of this shop (null = any). |
currency | string or null | ano | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
days | string or null | ne | 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 | ano | |
operator | one of: is | ano | Operator. |
value | string | ano | Part of the name or the code, at most 200. |
negate | boolean | ne | true = the rule must NOT hold (SmartEmailing "Neplatí, že"). |
shopId | string or null | ne | Only orders of this shop (null = any). |
currency | string or null | ne | Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set). |
days | string or null | ne | 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 | ano | |
operator | one of: has, not_has | ano | Operator. |
purposeId | string | ano | Purpose id. |
negate | boolean | ne | 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 | ano | |
operator | one of: in, not_in, added_before, added_after | ano | Operator. |
segmentId | string | ano | Segment id. |
negate | boolean | ne | 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 | ano | |
attribute | string | ano | Attribute name. |
operator | one of: is, starts_with, gt, gte, lt, lte | ano | Operator. |
value | string | ano | At most 200 (a number for gt to lte). |
days | string or null | ne | Only the last N days, "1" to "3650" (null = any time). |
negate | boolean | ne | 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 | ano | |
operator | one of: any, is, starts_with, contains | ano | Operator. |
url | string | ne | Not with any; at most 2 000. |
days | string or null | ne | Only the last N days, "1" to "3650" (null = any time). |
negate | boolean | ne | 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 | ano | |
name | string | ano | |
publicName | string | ano | Advanced setting (se-spec 01 §3): name on the unsubscribe page when the segment is used as a sendable list. |
shopId | string | ano | Segments belong to one shop; only contacts whose main shop it is are evaluated. |
refresh | one of: static, daily | ano | |
matched | number | ano | Contacts of the shop that meet the conditions, any status. |
mailable | number | ano | Of those: subscribed, not suppressed, without weak consent. |
computedAt | string | ano | |
ruleCount | number | ano | |
tags | array of string | ne | Labels (Štítky); absent from older servers. |
createdAt | string | ano | |
updatedAt | string | ano |
SegmentToListResult
POST /segments/{id}/to-list: the new list and how many contacts it got.
| Pole | Typ | Povinné | Popis |
|---|---|---|---|
listId | string | ano | |
name | string | ano | |
members | number | ano |