{"openapi":"3.1.0","jsonSchemaDialect":"https://spec.openapis.org/oas/3.1/dialect/base","info":{"title":"Poštárna API","version":"1.0.0","description":"Poštárna is a multi-tenant e-mail marketing platform with statistics for companies and e-shops (Czech and Slovak). This document describes every\nroute an integration can call. Guides in Czech and Slovak: https://www.postarna.cz/docs/api (index for AI agents:\nhttps://www.postarna.cz/llms.txt, everything in one Markdown file: https://www.postarna.cz/llms-full.txt).\n\n## Three APIs\n* **API v1** (`/api/v1/tenants/{tenant}/...`): the full API, the same one the Poštárna web app uses. JSON in UTF-8.\n* **SmartEmailing compatible API v3** (`/api/v3/...`) and its CSV statistics (`/api/csv/...`): the same paths,\n  envelopes and errors as SmartEmailing's REST API v3, so an existing SE integration only changes the address, the\n  user name and the key. Read operations plus account webhooks.\n* **MCP server** (`POST /mcp`): Model Context Protocol for AI assistants (ChatGPT, Claude, Cursor ...), OAuth 2.1 or an\n  API key.\n\n## Authentication\nCreate an API key in the app: Nastavení › Datové zdroje › API klíče (Settings › Data sources › API keys). The key\n(`pst_` + 43 characters) is shown once. Send it as `Authorization: Bearer pst_...`, or as HTTP Basic with the e-mail\nof an active member of the company as the user name and the key as the password (both work on v1 and v3). A key\nworks only in its own company (tenant), with the roles it was given (never more than its creator has), and with\nscope `full` (read and write) or `read` (only routes whose permission level is read). Keys never reach the members,\ninvitations, API keys and connected apps (those need a signed-in person: 403 `forbidden` / `api_key`).\n\n`{tenant}` in v1 paths is the company's public id (a UUID). Find it with `GET /api/v3/account-info` (`data.guid`) or\nin the app on the API keys page.\n\n## Conventions (API v1)\n* IDs are strings. Times are ISO 8601 in UTC with milliseconds (`2026-09-30T08:00:00.000Z`); local calendar days of\n  the company are `YYYY-MM-DD`; automation settings use local `YYYY-MM-DDTHH:MM` and `HH:MM`.\n* Money is a decimal string next to its `currency` (`\"1290.00\"`, `\"CZK\"`). CZK and EUR are never added up or\n  converted: every sum is per currency.\n* Lists are paged: `page` from 1, `pageSize` 1 to 100 (default 25); the answer is `{items, total, page, pageSize}`.\n  Some grids take `sort` (`name,-createdAt`, at most 3 fields, `-` = descending).\n* Request bodies of POST, PUT and PATCH are `application/json` (415 `validation` / `contentType` otherwise); CSV\n  import and file upload also take `multipart/form-data`. Unknown body fields are ignored.\n* Errors: `{\"error\": {\"code\": \"...\", \"message\": \"<field or detail>\", \"params\": {...}}}`. `code` is stable and\n  machine readable, `message` names the field or the reason, `params` carries details (for example the issues of an\n  automation graph). The API never sends texts for people.\n* No idempotency keys: retry only requests that are safe to repeat (GET, PUT of a whole object, DELETE). For POST,\n  read the state first (for example list the contacts by e-mail) before you retry after a timeout. Concurrent\n  edits of content and automation graphs are guarded by versions (`baseVersion`, 409 `conflict` / `version`).\n\n## Limits\nPer company (all keys together): a bucket of 2 500 requests refilled with 4 requests a second, and 100 000 requests a\nday (refilled continuously). Every answer to a key carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and\n`X-RateLimit-Reset` (unix time when the bucket is full again) of the bucket nearest to running out. Over the limit:\n429 `rate_limited` with `Retry-After` (seconds). Some actions have their own limits (test e-mails 10 per day per\ncampaign or template, contact events 60 per contact in 10 minutes, MCP 300 messages a minute).\n\n## Consent and sending\nPoštárna never e-mails a contact who unsubscribed, bounced, complained or is suppressed, and campaigns only reach\ncontacts with a valid marketing consent. Sending to real recipients (approving a campaign, activating an automation)\nis irreversible: check the audience first (`POST .../campaigns/audience`, `POST .../automations/{id}/test`). Test\ne-mails go only to the company's test addresses (`GET .../test-recipients`).\n","contact":{"name":"deriverge s.r.o.","url":"https://www.postarna.cz/docs/api"},"x-guides":{"cs":"https://www.postarna.cz/docs/api","sk":"https://www.postarna.sk/docs/api","llms":"https://www.postarna.cz/llms.txt","llmsFull":"https://www.postarna.cz/llms-full.txt"}},"servers":[{"url":"https://www.postarna.cz","description":"Production (the same API answers on www.postarna.sk)"}],"security":[{"bearerAuth":[]},{"basicAuth":[]}],"tags":[{"name":"Automations","x-displayName":"Automations","description":"Automation scenarios: a graph of triggers, conditions, waits and actions; validation, versions, activation, test and trace, run history, statistics, and the contact events API that feeds event triggers (custom events, carts, page visits)."}],"x-error-codes":{"conflict":{"meaning":"The change would break the state of the object. `message`: `name` (name taken), `locked` (a list bound to an e-shop), `status` (wrong state, e.g. editing a sent campaign), `recipients` (the audience changed more than 5 % since you counted it, `params.expected` and `params.actual`), `version` (stale `baseVersion`, `params.current`), `confirm` (saving a running automation needs `confirmRunning: true`), `waiting` (contacts wait in a node you remove, `params.nodes`), `runs` (deleting an automation that ran), `trigger` (no manual trigger), `limit` (too many objects).","fix":"Read the object again, then repeat with current data; for `recipients` count the audience again and send the new `expectedRecipients`."},"count_mismatch":{"meaning":"`expectedRecipients` does not match the audience.","fix":"Count again with `POST /campaigns/audience` and send the new number."},"csrf":{"meaning":"Browser session request without the CSRF header (never with an API key).","fix":"Send the API key in `Authorization` instead of cookies."},"empty_segment":{"meaning":"The campaign audience has no recipient.","fix":"Change the audience."},"expired":{"meaning":"The object is no longer available (an export file older than its retention).","fix":"Create it again (POST /exports)."},"forbidden":{"meaning":"The credentials are valid but not allowed here. `message`: `tenant` (another company in the path), `scope` (a read-only key on a write route), `api_key` (members, invitations and keys need a signed-in person), a module name (`contacts`, `campaigns`, `content`, `settings`, `billing`: the key's roles lack the level), `read_only` (support view).","fix":"Use the tenant id of the key (`GET /api/v3/account-info`), a key with scope `full`, or a key whose roles include the module (for example marketing_manager)."},"method_not_allowed":{"meaning":"The path exists but not with this HTTP method.","fix":"Check the method in this document."},"not_found":{"meaning":"The object does not exist in this company (objects of other companies answer the same).","fix":"Check the id; list the objects first."},"not_implemented":{"meaning":"The feature is not available yet.","fix":"Do not rely on it."},"rate_limited":{"meaning":"Too many requests: the company's API limit, or the limit of one action (test e-mails, contact events, sign-in attempts). `Retry-After` says after how many seconds to retry.","fix":"Wait `Retry-After` seconds; spread requests (4 a second sustained)."},"recently_sent":{"meaning":"HTTP 423: the contact cannot be deleted yet, a campaign e-mail to it is queued or went out in the last 24 hours (SmartEmailing answers the same).","fix":"Delete it after 24 hours. A request to be forgotten (GDPR) uses POST /contacts/{id}/erase, which is never refused."},"server":{"meaning":"Unexpected server error.","fix":"Retry later; the request may be repeated if it is safe to repeat."},"suppression_locked":{"meaning":"The address is suppressed for another reason (bounce, complaint, unsubscribe), so the blacklist cannot be added or removed; `params.reason` names it.","fix":"Leave it: such suppressions protect the sender and are removed only one by one (DELETE /suppressions/{email}) when the reason is gone."},"unauthorized":{"meaning":"No valid credentials: the API key is unknown, revoked, expired, idle for 180 days, its creator left the company, or the HTTP Basic user name is not an active member.","fix":"Check the key and the header (`Authorization: Bearer pst_...`). Create a new key in Nastavení › Datové zdroje › API klíče."},"unavailable":{"meaning":"A service the action needs is not available (`mail`: the mail backend refused a test e-mail, `data_key`: encryption key for webhook passwords missing).","fix":"Retry later; tell support when it persists."},"upstream":{"meaning":"An outside service failed (downloading a file by URL, the stock photo service); `params.reason` says why.","fix":"Check the URL or retry later."},"validation":{"meaning":"A parameter or body field is missing, has the wrong type or an invalid value. `message` names it (`email`, `definition.1.0.listId`, `graph` ...), `params` may carry details such as `params.issues` of an automation graph or `params.reason`.","fix":"Fix the named field. For 415 `contentType` send `Content-Type: application/json`; for `body` send a JSON object."}},"x-automation-nodes":{"trigger_now":{"group":"trigger","available":true,"needs":"","smartemailing":"run","branches":["next"],"description":"Starts once, right at the activation, with the contacts of the shop matching the filter (SmartEmailing \"Hned teď\").","example":{"reentry":"once"}},"trigger_scheduled":{"group":"trigger","available":true,"needs":"","smartemailing":"scheduled-time","branches":["next"],"description":"Starts once at a local date and time (SmartEmailing \"V plánovaný čas\").","example":{"at":"2026-12-01T09:00","reentry":"once"}},"trigger_repeat":{"group":"trigger","available":true,"needs":"","smartemailing":"repeat","branches":["next"],"description":"Starts repeatedly every `every` from startAt (default the activation) until stopAt, with the contacts matching the filter (SmartEmailing \"Opakovat\").","example":{"every":{"value":1,"unit":"days"},"startAt":"2026-11-01T08:00","reentry":"parallel","filter":{"type":"group","match":"all","rules":[{"type":"contact_anniversary","field":"nameDay","relation":"now"}]}}},"trigger_event":{"group":"trigger","available":true,"needs":"","smartemailing":"on-event","branches":["next"],"description":"Starts when an event happens to a contact (SmartEmailing \"Při události\"). Only events after the activation count. Event specific settings: `cart_updated`: The contact's cart changed (POST /contact-events type cart). shopId narrows the shop. `contact_created`: A new contact of the automation's shop. `order_created`: A new order (shopId: shop of the order, default the automation's shop). `order_changed`: An order changed state (state narrows to one state). `list_added`: The contact was added to listId. `contact_updated`: A profile field changed (fieldFilter narrows to one field and its values before / after). `action_failed`: An action of an automation failed (failureType, failureNode narrow it). `list_status_changed`: The contact's state in listId changed to status. `email_sent`: An e-mail of emailNode (a send_email node of ANOTHER automation) was sent. `page_visit`: A web tracking visit (POST /contact-events type visit): url, urlOperator, visitType. `link_clicked`: The contact clicked a link (link, compareParams) in an e-mail of emailNode (another automation). `engagement_changed`: The contact's engagement level changed. `custom`: A custom event named customEvent (POST /contact-events type custom, or a fire_event node of another automation). `form_submitted`: A form was submitted and confirmed (formId narrows to one form). `blacklisted`: The contact was blacklisted. `order_completed`: An order was completed (paid, shipped or delivered). `subscribed`: The contact subscribed (sources narrows the source; imports only when listed). `manual`: Contacts added by hand: POST /automations/{id}/contacts.","example":{"event":"cart_updated","shopId":"1","reentry":"restart"}},"trigger_date":{"group":"trigger","available":true,"needs":"","smartemailing":null,"branches":["next"],"description":"Starts once a day at `at` for contacts whose date is today: name day, birthday, a date custom field (shifted by offsetDays), fixed holidays (every contact of the shop), or the first completed order exactly `days` ago.","example":{"kind":"name_day","at":"08:00","reentry":"parallel"}},"trigger_reorder":{"group":"trigger","available":true,"needs":"","smartemailing":null,"branches":["next"],"description":"Starts once a day at `at` for customers whose last completed order is older than their usual interval between orders (\"buy again\"): the average gap of their order days, defaultDays with one order day, clamped to minDays..maxDays, plus graceDays.","example":{"at":"10:00","defaultDays":30,"minDays":14,"maxDays":120,"graceDays":3,"reentry":"parallel"}},"condition":{"group":"operator","available":true,"needs":"","smartemailing":"condition","branches":["yes","no"],"description":"Splits the run: output yes when the definition holds, else no. With waitUntilMet the contact waits until it holds (then yes) or the time runs out (then no); checked every 20 minutes to once a day.","example":{"definition":{"type":"group","match":"all","rules":[{"type":"email_activity","operator":"opened","nodeId":null}]}}},"wait":{"group":"operator","available":true,"needs":"","smartemailing":"wait","branches":["next"],"description":"Waits. mode time: until the time spec (relative to the arrival at the node, or to the entry with countFrom scenario); preferred: until the contact's usual reading time (most frequent quarter hour of opens, else no wait); spread: releases the contacts evenly over the period; duration: value units; time_of_day: the next HH:MM; weekday: the next listed weekday at time; date: a local date and time. At most 10 years.","example":{"mode":"duration","value":2,"unit":"days"}},"ab_test":{"group":"operator","available":true,"needs":"","smartemailing":"ab","branches":["v1","...","v10"],"description":"Splits contacts randomly (stable per run) into 2 to 10 variants; outputs v1..vN.","example":{"variants":[{"key":"v1","share":50},{"key":"v2","share":50}]}},"holding":{"group":"operator","available":true,"needs":"","smartemailing":"storage","branches":["next"],"description":"Storage (Odkladiště): contacts wait here until an edge out of the node is added (then they continue) or 90 days pass.","example":{}},"goal":{"group":"operator","available":true,"needs":"","smartemailing":null,"branches":[],"description":"Goal of the scenario: before every step the goals are checked; a contact who meets one leaves the scenario wherever it is. No edges in or out.","example":{"definition":{"type":"group","match":"all","rules":[{"type":"ordered_since_entry","operator":"yes","shopId":null}]}}},"send_email":{"group":"action","available":true,"needs":"","smartemailing":"send-email","branches":["next"],"description":"Sends an e-mail from a template (once per node and contact within the company's window). Only to mailable contacts, rechecked right before sending.","example":{"templateId":"301","subject":"Zapomněli jste něco v košíku","trackOpens":true,"trackClicks":true}},"send_sms":{"group":"action","available":false,"needs":"sms","branches":["next"],"smartemailing":"send-sms","description":"Not available yet: needs sms. Shown in the palette, saving reports \"unavailable\".","example":null},"list_change":{"group":"action","available":true,"needs":"","smartemailing":"add-to-list","branches":["next"],"description":"Sets the contact's state in manual lists (confirmed adds, unsubscribed and removed take out). Lists bound to an e-shop cannot be changed.","example":{"status":"confirmed","listIds":["101"]}},"send_viber":{"group":"action","available":false,"needs":"viber","branches":["next"],"smartemailing":"send-viber-message","description":"Not available yet: needs viber. Shown in the palette, saving reports \"unavailable\".","example":null},"webhook":{"group":"action","available":true,"needs":"","smartemailing":"send-webhook","branches":["next"],"description":"Calls a URL (queued, retried 5 times 5 minutes apart on a non-2xx answer, then an action failure \"other\"). Merge tags work in url (percent-encoded), body (JSON-escaped when the Content-Type is JSON; POST defaults to application/json) and header values. Only public addresses, no redirects.","example":{"url":"https://crm.example.cz/hooks/postarna","method":"POST","body":"{\"email\": \"{{df_emailaddress}}\", \"event\": \"cart\"}","headers":[{"name":"X-Source","value":"postarna"}]}},"set_field":{"group":"action","available":true,"needs":"","smartemailing":"set-field","branches":["next"],"description":"Sets or clears a contact field. valueKind fixed (a value of the field's type), relative (dates: a time spec from now) or template (text fields: merge tags).","example":{"field":"cf:62","action":"set","valueKind":"fixed","value":"VIP"}},"reset":{"group":"action","available":true,"needs":"","smartemailing":"reset","branches":["next"],"description":"Ends the contact's other active runs of this scenario that wait in nodes after this one (SmartEmailing Reset).","example":{}},"fb_audience":{"group":"action","available":false,"needs":"meta","branches":["next"],"smartemailing":"facebook-audience","description":"Not available yet: needs meta. Shown in the palette, saving reports \"unavailable\".","example":null},"sklik_retargeting":{"group":"action","available":false,"needs":"sklik","branches":["next"],"smartemailing":"sklik-retargeting-emails","description":"Not available yet: needs sklik. Shown in the palette, saving reports \"unavailable\".","example":null},"motionlab_adina":{"group":"action","available":false,"needs":"motionlab","branches":["next"],"smartemailing":"motionlab-adina","description":"Not available yet: needs motionlab. Shown in the palette, saving reports \"unavailable\".","example":null},"whatsapp":{"group":"action","available":false,"needs":"whatsapp","branches":["next"],"smartemailing":"whatsapp","description":"Not available yet: needs whatsapp. Shown in the palette, saving reports \"unavailable\".","example":null},"fire_event":{"group":"action","available":true,"needs":"","smartemailing":"fire-event","branches":["next"],"description":"Fires a custom event of the contact that event triggers (custom) of OTHER automations listen to.","example":{"name":"vip-reached","data":{"level":"gold"}}},"notify":{"group":"action","available":true,"needs":"","smartemailing":null,"branches":["next"],"description":"Notifies the team in the app (notification centre).","example":{"message":"Zákazník dosáhl VIP úrovně","important":false}},"goto":{"group":"action","available":true,"needs":"","smartemailing":null,"branches":[],"description":"Jumps to another node of this graph (not a trigger or goal; the jump counts as an edge for cycles, so only forward).","example":null},"end":{"group":"action","available":true,"needs":"","smartemailing":null,"branches":[],"description":"Ends the run (the contact leaves).","example":{}}},"paths":{"/api/v1/tenants/{tenant}/automations":{"get":{"operationId":"automations_index","summary":"List automations","tags":["Automations"],"description":"Automations (draft, active, paused) with entered, active and sent counts.\n\nContract notes (cs):\n\nParametry `q` (název, bez ohledu na diakritiku), `status`, `shop`, `page`, `pageSize`; nejnovější první. Položka `Automation`: `{ \"id\", \"name\", \"shopId\", \"status\", \"version\", \"activeSince\", \"firstActivatedAt\", \"pausedReason\", \"transactional\", \"tags\", \"createdAt\", \"updatedAt\", \"stats\": { \"entered\", \"active\", \"sent\" } }`. `activeSince` jen ve stavu `active`, `pausedReason` = kód pauzy, `transactional` = transakční režim (migrace 0351: smluvní e-maily jen z vlastní události, i kontaktům bez souhlasu, bez odkazu na odhlášení; přepíná `PATCH` s `transactional`, jen mimo běh, 409 `status` za běhu, 400 `transactional` s `params.issues` pro graf, který režimu neodpovídá).","parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Search text."},{"name":"shop","in":"query","required":false,"schema":{"type":"string"},"description":"Shop id filter."},{"$ref":"#/components/parameters/sort"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","active","paused"]},"description":"Status."},{"name":"tag","in":"query","required":false,"schema":{"type":"string"},"description":"Label filter; repeat for more labels."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_automations","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: q, sort, status, tag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"automations_create","summary":"Create an automation (draft)","tags":["Automations"],"description":"Creates an automation as a draft (it sends nothing until activate_automation). graph = {nodes, edges} (get_api_reference Automatizace).\n\nContract notes (cs):\n\nZaložení `{ \"name\", \"shopId\", \"description\"?, \"tags\"?, \"graph\"? }` → 201 `AutomationDetail` ve stavu `draft`, verze 1. Úprava `{ \"name\"?, \"description\"?, \"tags\"? }` v kterémkoli stavu; e-shop se nemění (400 `shopId`). Název do 100 znaků, v tenantu jedinečný bez ohledu na velikost písmen (409 `name`), popis do 1 000 znaků, nejvýš 20 štítků do 40 znaků.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationInput"},"examples":{"abandoned-cart-create":{"summary":"docs/api-examples/abandoned-cart.json create","value":{"name":"Opuštěný košík","shopId":"1","description":"Připomenutí košíku po 2 hodinách","tags":["e-shop"],"graph":{"nodes":[{"id":"kosik","type":"trigger_event","name":"Změna košíku","position":{"x":0,"y":0},"config":{"event":"cart_updated","shopId":"1","reentry":"restart"}},{"id":"pockat","type":"wait","name":"Počkat 2 hodiny","position":{"x":0,"y":150},"config":{"mode":"duration","value":2,"unit":"hours"}},{"id":"stale-v-kosiku","type":"condition","name":"Košík stále plný a bez objednávky","position":{"x":0,"y":300},"config":{"definition":{"type":"group","match":"all","rules":[{"type":"cart_items_count","operator":"gt","value":0,"shopId":"1"},{"type":"ordered_since_entry","operator":"no","shopId":"1"}]}}},{"id":"email","type":"send_email","name":"Připomenutí","position":{"x":0,"y":450},"config":{"templateId":"301","trackOpens":true,"trackClicks":true}}],"edges":[{"source":"kosik","target":"pockat","branch":"next"},{"source":"pockat","target":"stale-v-kosiku","branch":"next"},{"source":"stale-v-kosiku","target":"email","branch":"yes"}]}}}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-tool":"create_automation","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationDetail"},"examples":{"abandoned-cart-create":{"summary":"docs/api-examples/abandoned-cart.json create","value":{"id":"81","name":"Opuštěný košík","shopId":"1","status":"draft","version":1,"activeSince":null,"firstActivatedAt":null,"pausedReason":null,"tags":["e-shop"],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","stats":{"entered":0,"active":0,"sent":0},"description":"Připomenutí košíku po 2 hodinách","graph":{"nodes":[{"id":"kosik","type":"trigger_event","name":"Změna košíku","note":"","position":{"x":0.0,"y":0.0},"config":{"event":"cart_updated","shopId":"1","reentry":"restart"}},{"id":"pockat","type":"wait","name":"Počkat 2 hodiny","note":"","position":{"x":0.0,"y":150.0},"config":{"mode":"duration","unit":"hours","value":2}},{"id":"stale-v-kosiku","type":"condition","name":"Košík stále plný a bez objednávky","note":"","position":{"x":0.0,"y":300.0},"config":{"definition":{"type":"group","match":"all","rules":[{"type":"cart_items_count","value":0,"shopId":"1","operator":"gt"},{"type":"ordered_since_entry","shopId":"1","operator":"no"}]}}},{"id":"email","type":"send_email","name":"Připomenutí","note":"","position":{"x":0.0,"y":450.0},"config":{"templateId":"301","trackOpens":true,"trackClicks":true}}],"edges":[{"source":"kosik","target":"pockat","branch":"next"},{"source":"pockat","target":"stale-v-kosiku","branch":"next"},{"source":"stale-v-kosiku","target":"email","branch":"yes"}]},"issues":[],"triggers":{}}}}}}},"400":{"description":"`validation` (message: description, graph, node, shopId, tags, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/resolve-time":{"post":{"operationId":"automations_resolve_time","summary":"Resolve a time spec to a moment (preview)","tags":["Automations"],"description":"Previews a time spec of a wait or a condition (calendar, interval or event variant): the moment it means now, in UTC and in the account's local time.\n\nThe preview of the shared time choice (core/timespec.py): {spec, place?, base?} -> {at (UTC), local (YYYY-MM-DDTHH:MM of the tenant)}. 400 validation spec with params.issues for an invalid spec.\n\nContract notes (cs):\n\nTělo `{ \"spec\", \"place\"? (wait \\| condition, výchozí condition), \"base\"? (ISO) }` → `{ \"at\" (UTC ISO), \"local\" (\"YYYY-MM-DDTHH:MM\" tenanta) }`; chybná spec 400 `validation` / `spec` s `params.issues`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/TimeSpec"},"place":{"type":"string","enum":["condition","wait"]}},"required":["spec","place"]}}},"description":"Required by the server: spec."},"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"resolve_automation_time","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"at":{"type":"string"},"local":{"type":"string"}},"required":["at","local"]}}}},"400":{"description":"`validation` (message: base, place, spec)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/tags":{"post":{"operationId":"automations_tags","summary":"Change labels of automations","tags":["Automations"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GridTagsInput"}}},"description":"Required by the server: ids."},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"]}}}},"400":{"description":"`validation` (message: ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/validate":{"post":{"operationId":"automations_validate","summary":"Validate a graph without saving","tags":["Automations"],"description":"Checks a graph without saving: errors and incomplete settings.\n\n{errors, incomplete} of a graph for a shop without saving it (the canvas checks before saving).\n\nContract notes (cs):\n\nTělo `{ \"shopId\", \"graph\" }` → `{ \"errors\": [AutomationIssue], \"incomplete\": [AutomationIssue] }`, nic neukládá (plátno kontroluje před uložením).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shopId":{"type":"string"},"graph":{"$ref":"#/components/schemas/AutomationGraph"}},"required":["shopId","graph"]},"examples":{"abandoned-cart-validate":{"summary":"docs/api-examples/abandoned-cart.json validate","value":{"shopId":"1","graph":{"nodes":[{"id":"kosik","type":"trigger_event","config":{"event":"cart_updated","shopId":"1","reentry":"restart"}},{"id":"pockat","type":"wait","config":{"mode":"duration","value":2,"unit":"hours"}},{"id":"email","type":"send_email","config":{}}],"edges":[{"source":"kosik","target":"pockat"},{"source":"pockat","target":"email"}]}}}}}},"description":"Required by the server: graph, shopId."},"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"validate_automation_graph","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationValidation"},"examples":{"abandoned-cart-validate":{"summary":"docs/api-examples/abandoned-cart.json validate","value":{"errors":[],"incomplete":[{"node":"email","field":"templateId","code":"required"}]}}}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}":{"delete":{"operationId":"automations_delete","summary":"Delete an automation that never ran","tags":["Automations"],"description":"Deletes an automation nobody entered.\n\nContract notes (cs):\n\n204; jen automatizace, do které nikdo nevstoupil a která neběží (jinak 409 `runs` nebo `status`).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"delete_automation","responses":{"204":{"description":"No content"},"400":{"description":"`validation` (message: graph, node, shopId, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"automations_show","summary":"Get an automation with its graph and issues","tags":["Automations"],"description":"One automation with its graph (nodes, edges, version) and the issues that block activation.\n\nContract notes (cs):\n\n`AutomationDetail` = položka a navíc `description`, `graph`, `issues` (vše, co brání zapnutí).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_automation","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationDetail"},"examples":{"win-back-detail":{"summary":"docs/api-examples/win-back.json detail","value":{"id":"85","name":"Win-back po 120 dnech","shopId":"21","status":"draft","version":1,"activeSince":null,"firstActivatedAt":null,"pausedReason":null,"tags":[],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","stats":{"entered":0,"active":0,"sent":0},"description":"","graph":{"nodes":[{"id":"kazdy-den","type":"trigger_repeat","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"every":{"unit":"days","value":1},"filter":{"type":"group","match":"all","rules":[{"type":"last_order","value":"120","shopId":"21","operator":"older_than_days"},{"type":"order_count","value":"1","shopId":"21","operator":"gte"}]},"reentry":"once","startAt":"2026-10-02T10:00"}},{"id":"email-1","type":"send_email","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"templateId":"306"}},{"id":"tyden","type":"wait","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"mode":"duration","unit":"days","value":7}},{"id":"nakoupil","type":"condition","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"definition":{"type":"group","match":"all","rules":[{"type":"ordered_since_entry","shopId":"21","operator":"yes"}]}}},{"id":"email-2","type":"send_email","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"templateId":"307"}},{"id":"cil","type":"goal","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"definition":{"type":"group","match":"all","rules":[{"type":"ordered_since_entry","shopId":"21","operator":"yes"}]}}}],"edges":[{"source":"kazdy-den","target":"email-1","branch":"next"},{"source":"email-1","target":"tyden","branch":"next"},{"source":"tyden","target":"nakoupil","branch":"next"},{"source":"nakoupil","target":"email-2","branch":"no"}]},"issues":[],"triggers":{}}}}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"automations_update","summary":"Update name, description or labels of an automation","tags":["Automations"],"description":"Changes name, description or tags.\n\nContract notes (cs):\n\nZaložení `{ \"name\", \"shopId\", \"description\"?, \"tags\"?, \"graph\"? }` → 201 `AutomationDetail` ve stavu `draft`, verze 1. Úprava `{ \"name\"?, \"description\"?, \"tags\"? }` v kterémkoli stavu; e-shop se nemění (400 `shopId`). Název do 100 znaků, v tenantu jedinečný bez ohledu na velikost písmen (409 `name`), popis do 1 000 znaků, nejvýš 20 štítků do 40 znaků.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"transactional":{"type":"boolean","description":"Transactional mode; switched only while the automation does not run and only for a graph that fits it."}}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-tool":"update_automation","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationDetail"}}}},"400":{"description":"`validation` (message: description, graph, node, shopId, tags, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/activate":{"post":{"operationId":"automations_activate","summary":"Activate (start) an automation","tags":["Automations"],"description":"Activates (starts) an automation: from now on it sends its e-mails to contacts who enter.\n\nContract notes (cs):\n\nBez těla, vrací `AutomationDetail`. Zapnutí s problémy = 400 `validation` / `graph` s `params.issues`; jiný stav = 409 `status`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"send","x-mcp-tool":"activate_automation","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationDetail"},"examples":{"abandoned-cart-activate":{"summary":"docs/api-examples/abandoned-cart.json activate","value":{"id":"81","name":"Opuštěný košík","shopId":"1","status":"active","version":1,"activeSince":"2026-10-01T08:00:00.000Z","firstActivatedAt":"2026-10-01T08:00:00.000Z","pausedReason":null,"tags":["e-shop"],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","stats":{"entered":0,"active":0,"sent":0},"description":"Připomenutí košíku po 2 hodinách","graph":{"nodes":[{"id":"kosik","type":"trigger_event","name":"Změna košíku","note":"","position":{"x":0.0,"y":0.0},"config":{"event":"cart_updated","shopId":"1","reentry":"restart"}},{"id":"pockat","type":"wait","name":"Počkat 2 hodiny","note":"","position":{"x":0.0,"y":150.0},"config":{"mode":"duration","unit":"hours","value":2}},{"id":"stale-v-kosiku","type":"condition","name":"Košík stále plný a bez objednávky","note":"","position":{"x":0.0,"y":300.0},"config":{"definition":{"type":"group","match":"all","rules":[{"type":"cart_items_count","value":0,"shopId":"1","operator":"gt"},{"type":"ordered_since_entry","shopId":"1","operator":"no"}]}}},{"id":"email","type":"send_email","name":"Připomenutí","note":"","position":{"x":0.0,"y":450.0},"config":{"templateId":"301","trackOpens":true,"trackClicks":true}}],"edges":[{"source":"kosik","target":"pockat","branch":"next"},{"source":"pockat","target":"stale-v-kosiku","branch":"next"},{"source":"stale-v-kosiku","target":"email","branch":"yes"}]},"issues":[],"triggers":{}}}}}}},"400":{"description":"`validation` (message: graph, node, shopId, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, test_only, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/contacts":{"post":{"operationId":"automations_add_contacts","summary":"Add contacts by hand to a running automation","tags":["Automations"],"description":"Adds contacts by hand to a running automation whose trigger is manual (Ručně přidané kontakty); those that can be mailed enter at the next tick and get its e-mails. The preview shows how many can enter.\n\nAdds contacts by hand ({contactIds}) to a running scenario whose trigger is \"Ručně přidané kontakty\" (event manual); they enter at the next tick when they may (mailable, customer exception). {added: n}.\n\nContract notes (cs):\n\nRučně přidané kontakty `{ \"contactIds\": [...] }` (1 až 1 000) do běžícího scénáře se spouštěčem `manual` → `{ \"added\": n }`; vstoupí při dalším ticku jen ty, kterým lze psát, z e-shopu scénáře. Scénář mimo `active` 409 `status`, bez spouštěče `manual` 409 `trigger`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactIds":{"type":"array","items":{"type":"string"}}},"required":["contactIds"]}}},"description":"Required by the server: contactIds."},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"send","x-mcp-tool":"add_automation_contacts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"number"}},"required":["added"]}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: status, trigger)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/copy":{"post":{"operationId":"automations_copy","summary":"Copy an automation as a new draft","tags":["Automations"],"description":"Creates a draft copy of an automation (\"<name> - kopie\", the same graph; webhook passwords are not copied).\n\nA draft copy \"<name> - kopie\" (SmartEmailing's Vytvořit kopii); webhook passwords are not copied.\n\nContract notes (cs):\n\n201 `AutomationDetail`: koncept „<název> - kopie“ se stejným grafem, bez hesel webhooků.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-tool":"copy_automation","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationDetail"}}}},"400":{"description":"`validation` (message: graph, node, shopId, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/counts":{"get":{"operationId":"automations_counts","summary":"Live counts per node and output","tags":["Automations"],"description":"Live numbers per node: passed, yes / no, outputs per branch, skipped, failed, left, waiting (contacts waiting there now), holding, queued, sent, opened, clicked; runs per state.\n\nLive numbers per node key: passed, yes, no, skipped, failed, left, outputs per branch, waiting (holding in a storage), queued, sent, opened, clicked; runs per state. Optional from / to (ISO) limit steps and e-mails to a period; waiting is always now.\n\nContract notes (cs):\n\nParametry `from`, `to` (ISO, volitelné) omezí kroky a e-maily na období. `AutomationCounts`: `{ \"nodes\": { \"<klíč>\": { \"passed\", \"yes\", \"no\", \"skipped\", \"waiting\", \"queued\", \"sent\", \"opened\", \"clicked\" } }, \"runs\": { \"active\", \"completed\", \"exited\" } }`. `waiting` = kontakty, které v uzlu čekají teď (bez ohledu na období); uzel bez čísel v odpovědi chybí.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"ISO start of the period."},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"ISO end of the period."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_automation_counts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationCounts"},"examples":{"abandoned-cart-counts":{"summary":"docs/api-examples/abandoned-cart.json counts","value":{"nodes":{},"runs":{"active":0,"completed":0,"exited":0}}}}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/editing":{"post":{"operationId":"automations_editing","summary":"Report that the editor has a scenario open and see who else has it","tags":["Automations"],"description":"The editor reports itself every 30 s (AU-16); {\"others\": [names]} of the other people who have the scenario open. Body {\"leave\": true} when the editor closes. An API key or an app has no presence (empty list).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"leave":{"type":"boolean"}},"required":["leave"]},{"type":"object"}]}}}},"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"others":{"type":"array","items":{"type":"string"}}},"required":["others"]}}}},"400":{"description":"`validation` (message: leave)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/editor":{"get":{"operationId":"automations_editor","summary":"Everything the editor needs in one answer","tags":["Automations"],"description":"Everything the editor opens with in one answer: the detail (as GET .../automations/<id>) and the option catalogs (core/automation_editor.py). A catalog of a module the caller cannot read is empty, as its list endpoint would answer 403.\n\nContract notes (cs):\n\nVše, s čím se otevírá editor, jedním požadavkem (dřív detail a jedenáct seznamů souběžně a pak detail každé další automatizace). Práva jako detail (čtení modulu `campaigns`), cizí nebo neexistující automatizace 404. `AutomationEditorData`: `{ \"automation\": AutomationDetail, \"lists\", \"templates\", \"senders\", \"purposes\", \"campaigns\", \"customFields\", \"segments\", \"automations\", \"emailNodes\", \"couponStacks\", \"feeds\", \"forms\", \"unsubscribePages\" }`. Šablona nese navíc `subject` (uzel ho ukáže, dokud nemá vlastní, AA-01) a `linkParams` (UTM parametry šablony, uzel je ukáže v Trackingu, AA-03); `unsubscribePages` = aktivní odhlašovací stránky `{ \"id\", \"name\" }` (modul `content`, AA-04).\n• Číselníky jsou úsporné, bez počtů: `templates`, `purposes`, `campaigns`, `segments`, `automations`, `couponStacks`, `feeds`, `forms` = `{ \"id\", \"name\" }`; `lists` = `{ \"id\", \"name\", \"shopId\", \"manualMembers\", \"tags\" }`; `customFields` = `{ \"id\", \"name\", \"type\", \"options\" }`; `senders` = `Sender` jako `GET /senders`.\n• Filtry a pořadí jako příslušné seznamy, ale bez stránkování: šablony aktivní (nejnověji změněné první) a za nimi archivované šablony, které používá některý e-mailový uzel této automatizace, s `\"archived\": true` (editor je u uzlu ukáže s poznámkou „archivováno“ a nikdy je nehlásí jako chybějící; nový výběr nabízí jen aktivní), odesílatelé bez odebraných, `segments` jen e-shopu automatizace, `automations` všechny včetně této.\n• `emailNodes` = e-mailové uzly ostatních automatizací tenanta `{ \"automationId\", \"automationName\", \"nodeKey\", \"nodeName\" }` (nejnovější automatizace první), jedním dotazem.\n• Číselník modulu, který uživatel nesmí číst (jeho seznam by vrátil 403), je prázdný: `lists`, `purposes`, `customFields`, `segments` potřebují `contacts`, `templates` a `forms` modul `content`, `couponStacks` a `feeds` modul `settings`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationEditorData"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/graph":{"put":{"operationId":"automations_save_graph","summary":"Save the graph of an automation (new version)","tags":["Automations"],"description":"Saves the graph of an automation (several triggers allowed). baseVersion = the version you read. A running (active) automation is saved only after the confirm step (its contacts go on by the new graph); a node where contacts wait cannot be removed. Every save keeps a version (list_automation_versions).\n\nContract notes (cs):\n\nTělo `{ \"baseVersion\", \"graph\" }` → `AutomationDetail` s verzí + 1. Ve stavu `active` jen s `confirmRunning: true` (jinak 409 `confirm`), 409 `version` s `params.current`, když mezitím uložil někdo jiný, 409 `waiting` s `params.nodes`, když by zmizel (nebo změnil typ) uzel, ve kterém kontakty čekají. Změna spouštěče začne jeho plán znovu.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmRunning":{"type":"boolean"},"baseVersion":{"type":"number"},"graph":{"$ref":"#/components/schemas/AutomationGraph"}},"required":["baseVersion","graph"]},"examples":{"abandoned-cart-save-running":{"summary":"docs/api-examples/abandoned-cart.json save-running","value":{"baseVersion":1,"graph":{"nodes":[],"edges":[]}}}}}},"description":"Required by the server: baseVersion, graph."},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"trigger","x-mcp-tool":"save_automation_graph","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationDetail"}}}},"400":{"description":"`validation` (message: baseVersion, confirmRunning, graph, node, shopId, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"abandoned-cart-save-running":{"summary":"docs/api-examples/abandoned-cart.json save-running","value":{"error":{"code":"conflict","message":"confirm"}}}}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/nodes/{key}/passes":{"get":{"operationId":"automations_node_passes","summary":"Contacts that went through a node","tags":["Automations"],"description":"Contacts that went through a node, newest first, with the outcome and branch.\n\nContacts that went through a node (SmartEmailing's \"Kontakty, které prošly uzlem\"): ?branch, ?q (e-mail), ?from, ?to; newest first.\n\nContract notes (cs):\n\nKontakty, které prošly uzlem: `branch`, `q`, `from`, `to`, `page`, `pageSize` → stránka `{ \"at\", \"contact\": { \"id\", \"email\" }, \"outcome\", \"branch\", \"nextNode\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"Node key (id of the node in the graph).","schema":{"type":"string"}},{"name":"branch","in":"query","required":false,"schema":{"type":"string"},"description":"Output (next, yes, no, v1 to v10)."},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"ISO start."},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Search text."},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"ISO end."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_node_passes","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AutomationPass"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: branch, q)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/nodes/{key}/release":{"post":{"operationId":"automations_release","summary":"Release the contacts waiting in a node","tags":["Automations"],"description":"Lets every contact waiting in a wait (or a condition waiting for its rules) go on now; they get the next e-mails of the scenario. The preview shows how many wait there.\n\nSmartEmailing's \"Uvolnit všechny čekající kontakty\" of a wait or a waiting condition: {released: n}.\n\nContract notes (cs):\n\nČekající kontakty uzlu `wait` (release i podmínky čekající na splnění): `release` je pustí hned dál (`{ \"released\": n }`), `reschedule` jim spočítá konec čekání znovu podle současného nastavení uzlu (`{ \"rescheduled\": n }`). Jiný uzel 400 `validation`. Modul `campaigns` plný.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"Node key (id of the node in the graph).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"send","x-mcp-tool":"release_waiting_contacts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"released":{"type":"number"}},"required":["released"]}}}},"400":{"description":"`validation` (message: graph, node, shopId, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/nodes/{key}/reschedule":{"post":{"operationId":"automations_reschedule","summary":"Recompute the end of waiting in a node","tags":["Automations"],"description":"The contacts waiting in a wait get their end computed again from the node's current settings (after the wait was changed). The preview shows how many wait there.\n\nSmartEmailing's \"Aktualizovat dobu čekání\": the waiting contacts get the node's current wait: {rescheduled}.\n\nContract notes (cs):\n\nČekající kontakty uzlu `wait` (release i podmínky čekající na splnění): `release` je pustí hned dál (`{ \"released\": n }`), `reschedule` jim spočítá konec čekání znovu podle současného nastavení uzlu (`{ \"rescheduled\": n }`). Jiný uzel 400 `validation`. Modul `campaigns` plný.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"Node key (id of the node in the graph).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"send","x-mcp-tool":"reschedule_waiting_contacts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rescheduled":{"type":"number"}},"required":["rescheduled"]}}}},"400":{"description":"`validation` (message: graph, node, shopId, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/pause":{"post":{"operationId":"automations_pause","summary":"Pause an automation","tags":["Automations"],"description":"Pauses an active automation.\n\nContract notes (cs):\n\nBez těla, vrací `AutomationDetail`. Zapnutí s problémy = 400 `validation` / `graph` s `params.issues`; jiný stav = 409 `status`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-tool":"pause_automation","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationDetail"},"examples":{"win-back-pause":{"summary":"docs/api-examples/win-back.json pause","value":{"id":"85","name":"Win-back po 120 dnech","shopId":"21","status":"paused","version":1,"activeSince":null,"firstActivatedAt":"2026-10-01T08:00:00.000Z","pausedReason":"manual","tags":[],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","stats":{"entered":0,"active":0,"sent":0},"description":"","graph":{"nodes":[{"id":"kazdy-den","type":"trigger_repeat","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"every":{"unit":"days","value":1},"filter":{"type":"group","match":"all","rules":[{"type":"last_order","value":"120","shopId":"21","operator":"older_than_days"},{"type":"order_count","value":"1","shopId":"21","operator":"gte"}]},"reentry":"once","startAt":"2026-10-02T10:00"}},{"id":"email-1","type":"send_email","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"templateId":"306"}},{"id":"tyden","type":"wait","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"mode":"duration","unit":"days","value":7}},{"id":"nakoupil","type":"condition","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"definition":{"type":"group","match":"all","rules":[{"type":"ordered_since_entry","shopId":"21","operator":"yes"}]}}},{"id":"email-2","type":"send_email","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"templateId":"307"}},{"id":"cil","type":"goal","name":"","note":"","position":{"x":0.0,"y":0.0},"config":{"definition":{"type":"group","match":"all","rules":[{"type":"ordered_since_entry","shopId":"21","operator":"yes"}]}}}],"edges":[{"source":"kazdy-den","target":"email-1","branch":"next"},{"source":"email-1","target":"tyden","branch":"next"},{"source":"tyden","target":"nakoupil","branch":"next"},{"source":"nakoupil","target":"email-2","branch":"no"}]},"issues":[],"triggers":{}}}}}}},"400":{"description":"`validation` (message: graph, node, shopId, transactional)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: confirm, name, runs, status, version, waiting)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: data_key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/report":{"get":{"operationId":"automations_report","summary":"Statistics of the e-mail nodes (JSON or CSV)","tags":["Automations"],"description":"Statistics of the scenario for a period: per e-mail node (sent, opens, clicks, conversions), the chosen nodes summed, webhook calls.\n\nStatistics of the scenario: ?from, ?to (local days YYYY-MM-DD, both included), ?nodes=a,b (selected nodes summed), ?format=csv for the table as a file.\n\nContract notes (cs):\n\nStatistiky scénáře za období: `from`, `to` (místní dny YYYY-MM-DD), `nodes` (klíče oddělené čárkou, sečtou se do `selected`), `format=csv` (soubor, UTF-8 s BOM, středník) → `{ \"nodes\": [ { \"nodeKey\", \"name\", \"metrics\", \"conversions\", \"conversionRate\" } ], \"selected\", \"webhooks\": [ { \"nodeKey\", \"name\", \"calls\", \"ok\", \"failed\" } ] }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","csv"]},"description":"csv = a CSV file (UTF-8 with BOM, semicolons)."},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"First local day YYYY-MM-DD."},{"name":"nodes","in":"query","required":false,"schema":{"type":"string"},"description":"Node keys to sum, comma separated."},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"Last local day YYYY-MM-DD."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_automation_report","responses":{"200":{"description":"JSON, or CSV with format=csv","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationReport"}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/runs":{"get":{"operationId":"automations_runs","summary":"Run history per contact","tags":["Automations"],"description":"Runs of contacts through the automation with their steps (active = still in it, with the node it waits in and until when).\n\nRun history, newest first, each with its steps; contactId narrows it to one contact of the tenant.\n\nContract notes (cs):\n\nParametry `contactId` (kontakt tenanta, jinak 400), `status` (`active`, `completed`, `exited`), `page`, `pageSize`; nejnovější první. `AutomationRun`: `{ \"id\", \"contact\": { \"id\", \"email\" }, \"status\", \"node\", \"entryKey\", \"enteredAt\", \"dueAt\", \"finishedAt\", \"exitReason\", \"steps\": [ { \"node\", \"outcome\", \"at\" } ] }`. `outcome`: `entered`, `passed`, `yes`, `no`, `queued`, `skipped`, `end`; `exitReason`: `completed`, `end`, `restarted`, `node_removed`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"contactId","in":"query","required":false,"schema":{"type":"string"},"description":"Contact id."},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","completed","exited"]},"description":"Status."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_automation_runs","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AutomationRun"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: contactId, status)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/test":{"post":{"operationId":"automations_test","summary":"Test the scenario on today's data (nothing is sent)","tags":["Automations"],"description":"Dry run of the scenario over today's data: how many contacts would reach, wait in and leave each node. Nothing is saved or sent.\n\nTest of the scenario (AU-05): expected contacts per node of one pass over the current data, nothing written or sent. Body (optional): graph = the editor's graph (default the stored one), days = the replayed window of event triggers (0 to 90, default 0: a Při události trigger lets nobody in, as SmartEmailing's test). A graph with errors or incomplete settings is 400 validation graph with params.issues (as SmartEmailing: \"Scénář není možné ... testovat, dokud neopravíte chyby v nastavení\").\n\nContract notes (cs):\n\nTest scénáře (AU-05, jako tlačítko Test v SE): jeden zkušební průchod grafu nad dnešními daty, nic se neuloží ani neodešle (žádné běhy, historie, e-maily, změny seznamů a polí). Tělo je nepovinné: `{ \"graph\"?, \"days\"? }`. `graph` = graf z editoru (výchozí uložený), `days` = okno přehrání událostí 1 až 90 (výchozí 90). Graf s chybou nebo s uzlem „Vyžaduje nastavení“ = 400 `validation` / `graph` s `params.issues` („Scénář není možné spustit ani testovat, dokud neopravíte chyby v nastavení.“), špatné `days` = 400 `validation` / `days`. Stačí čtení modulu `campaigns`.\n`AutomationTest`: `{ \"scope\", \"days\", \"since\", \"testedAt\", \"entered\", \"waiting\", \"left\", \"nodes\": { \"<klíč>\": { \"reached\", \"waiting\", \"left\", \"outputs\": { \"<větev>\": počet } } } }`.\n• `scope`: `contacts` (Hned teď, V plánovaný čas, Opakovat: kontakty e-shopu, které by spouštěč vzal teď, včetně filtru), `today` (Datum a Kupte si znovu: kontakty, které spouštěč vezme dnes), `events` (Při události: SE ukazuje 0, Poštárna přehraje události za posledních `days` dní od `since`; každý kontakt jednou, s nejnovější událostí, vstupuje v čase události).\n• Vstupují jen kontakty, kterým lze psát. Dosavadní běhy automatizace se nepočítají (test odpovídá na to, co by udělal jeden průchod, kdyby jím zatím nikdo neprošel).\n• Podmínka se vyhodnotí na dnešních datech; s `waitUpTo`, jejíž lhůta od příchodu ještě neuplynula, nesplňující kontakty v uzlu čekají. Aktivita e-mailů testovaného běhu neexistuje: otevřel a klikl = ne. Čekání: kdo by dočkal do teď (staré události, datum v minulosti), pokračuje, ostatní v uzlu čekají. Akce se neprovedou.\n• `reached` = kolik kontaktů do uzlu došlo, `waiting` = kolik v něm zůstalo čekat, `left` = kolik v něm scénář opustilo (uzel Konec, výstup bez hrany), `outputs` = počty po výstupech typu uzlu (`next`, nebo `yes` a `no`). V `nodes` je každý uzel grafu. Platí `entered` = `waiting` + `left`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationTestInput"},"examples":{"name-days-test":{"summary":"docs/api-examples/name-days.json test","value":{}}}}}},"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"test_automation","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationTest"},"examples":{"name-days-test":{"summary":"docs/api-examples/name-days.json test","value":{"scope":"today","days":null,"since":null,"entered":0,"waiting":0,"left":0,"nodes":{"svatek":{"reached":0,"waiting":0,"left":0,"outputs":{"next":0}},"prani":{"reached":0,"waiting":0,"left":0,"outputs":{"next":0}}},"testedAt":"2026-10-01T08:00:00.000Z"}}}}}},"400":{"description":"`validation` (message: days, graph)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/trace":{"post":{"operationId":"automations_trace","summary":"Trace one contact through the scenario (nothing is sent)","tags":["Automations"],"description":"Simulation of one contact: the way it would take through the scenario step by step (conditions, waits, e-mails) with the reasons. Nothing is saved or sent.\n\nThe way of one contact through the scenario (core/automation_sim.py trace): body contactId or email, graph (default the stored one), triggerKey (default the first trigger), days (replayed window of an event trigger).\n\nContract notes (cs):\n\nPrůchod jednoho kontaktu bez zápisu a odeslání. Tělo `{ \"contactId\" | \"email\", \"graph\"?, \"triggerKey\"?, \"days\"? }` → `{ \"contactId\", \"email\", \"mayEnter\", \"reasons\", \"trigger\", \"offered\", \"eventAt\", \"steps\": [ { \"node\", \"type\", \"outcome\", \"branch\", \"at\", \"note\" } ], \"result\" }`, `result` `left` \\| `end` \\| `goal` \\| `holding` \\| `waiting` \\| `limit`. Stačí čtení modulu `campaigns`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationTraceInput"}}}},"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"trace_automation","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationTrace"}}}},"400":{"description":"`validation` (message: contact, days, graph, triggerKey)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/versions":{"get":{"operationId":"automations_versions","summary":"List saved versions of the graph","tags":["Automations"],"description":"Saved versions of the graph, newest first (version, status, saved at and by, node count).\n\nContract notes (cs):\n\n`{ \"items\": [ { \"version\", \"status\", \"savedAt\", \"savedBy\", \"nodes\", \"current\" } ] }`, nejnovější první; jedna verze `{ \"version\", \"graph\" }` (404, když není).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_automation_versions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AutomationVersion"}}},"required":["items"]},"examples":{"win-back-versions":{"summary":"docs/api-examples/win-back.json versions","value":{"items":[{"version":1,"status":"draft","savedAt":"2026-10-01T08:00:00.000Z","savedBy":"api_key:11","nodes":6,"current":true}]}}}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/automations/{automation_id}/versions/{version}":{"get":{"operationId":"automations_version","summary":"Get one saved version of the graph","tags":["Automations"],"description":"The graph of one saved version (to compare or to save it again with save_automation_graph).\n\nContract notes (cs):\n\n`{ \"items\": [ { \"version\", \"status\", \"savedAt\", \"savedBy\", \"nodes\", \"current\" } ] }`, nejnovější první; jedna verze `{ \"version\", \"graph\" }` (404, když není).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"version","in":"path","required":true,"description":"Version number.","schema":{"type":"integer"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_automation_version","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"graph":{"$ref":"#/components/schemas/AutomationGraph"}},"required":["graph"]}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/contact-events":{"post":{"operationId":"contact_events_create","summary":"Record an event of a contact (custom event, cart, page visit)","tags":["Automations"],"description":"Records an event of an existing contact (never creates one) for the event triggers of automations: type custom {name, data}, cart {shopId, items, currency, total} or visit {shopId, url, visitType, attributes}. At most 60 events of one contact in 10 minutes.\n\nAn event of an existing contact (contactId or email) for the event triggers: type custom {name, data}, cart {shopId, items, currency, total} or visit {shopId, url, visitType, attributes}. Never creates a contact. 201 {id}; 429 rate_limited after contact_events.API_PER_CONTACT events of one contact in API_WINDOW_S.\n\nContract notes (cs):\n\nUdálost existujícího kontaktu (`contactId` nebo `email`, nikdy nezaloží kontakt) pro spouštěče: `{ \"type\": \"custom\", \"name\", \"data\"?, \"shopId\"? }`, `{ \"type\": \"cart\", \"shopId\", \"items\", \"currency\"?, \"total\"? }`, `{ \"type\": \"visit\", \"shopId\"?, \"url\", \"visitType\"?, \"attributes\"? }` → 201 `{ \"id\" }`. Neznámý kontakt 404, nejvýš 60 událostí kontaktu za 10 minut (429 `rate_limited`, `Retry-After`). Modul `campaigns` plný.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Event type.","enum":["custom","cart","visit"]},"contactId":{"type":"string","description":"Contact id (or email)."},"email":{"type":"string","description":"Contact address."},"shopId":{"type":"string","description":"Shop id (required for cart)."},"name":{"type":"string","description":"Custom event name: a-z, 0-9 and -, up to 50."},"data":{"type":"object","description":"Custom event data."},"items":{"type":"array","description":"Cart items.","items":{"type":"object"}},"currency":{"type":"string","description":"Cart currency."},"total":{"type":"string","description":"Cart total."},"url":{"type":"string","description":"Visited URL."},"visitType":{"type":"string","description":"Visit type.","enum":["home","article","cart","product","category","search","order_done","other"]},"attributes":{"type":"object","description":"Visit attributes."}},"required":["type"]},"examples":{"abandoned-cart-cart":{"summary":"docs/api-examples/abandoned-cart.json cart","value":{"type":"cart","email":"lucie.mala@example.cz","shopId":"1","currency":"CZK","total":"589.00","items":[{"code":"KAVA-250","name":"Káva Brazílie 250 g","quantity":2,"price":"249.00","url":"https://www.example.cz/kava-brazilie"},{"code":"FILTR-02","name":"Papírové filtry","quantity":1,"price":"91.00"}]}}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"trigger","x-mcp-tool":"record_contact_event","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"examples":{"abandoned-cart-cart":{"summary":"docs/api-examples/abandoned-cart.json cart","value":{"id":"9004"}}}}}},"400":{"description":"`validation` (message: type)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` (message: contact)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` (message: contact)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"pst_ API key","description":"An API key of the company: Authorization: Bearer pst_... (Nastavení › Datové zdroje › API klíče). Scope read or full, roles of the key."},"basicAuth":{"type":"http","scheme":"basic","description":"HTTP Basic as SmartEmailing: user name = e-mail of an active member of the company, password = the API key."},"oauth2":{"type":"oauth2","description":"OAuth 2.1 for MCP clients (AI assistants) only: authorization code with PKCE S256, dynamic registration.","flows":{"authorizationCode":{"authorizationUrl":"https://www.postarna.cz/oauth/authorize","tokenUrl":"https://www.postarna.cz/oauth/token","refreshUrl":"https://www.postarna.cz/oauth/token","scopes":{"read":"Read only (routes whose permission level is read).","full":"Everything the member's roles allow."}}}}},"parameters":{"tenant":{"name":"tenant","in":"path","required":true,"description":"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.","schema":{"type":"string","format":"uuid"}},"page":{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Page number, from 1."},"pageSize":{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Items per page, 1 to 100."},"sort":{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort fields separated by commas, \"-\" = descending, at most 3 (e.g. name,-id)."}},"headers":{"X-RateLimit-Limit":{"description":"Size of the bucket nearest to running out (2 500 per second bucket or 100 000 daily).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in that bucket.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time when that bucket is full again.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"responses":{"Unauthorized":{"description":"401 unauthorized: missing, unknown, revoked, expired or idle API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"api_key"}}}}},"Forbidden":{"description":"403 forbidden: message tenant (another company), scope (read-only key), api_key (person only), or the module the key's roles lack.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"scope"}}}}},"RateLimited":{"description":"429 rate_limited: wait Retry-After seconds.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"per-second"}}}}}},"schemas":{"Automation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"status":{"$ref":"#/components/schemas/AutomationStatus"},"version":{"type":"number"},"activeSince":{"type":["string","null"],"description":"Since when it runs without a pause; null unless active."},"firstActivatedAt":{"type":["string","null"]},"pausedReason":{"type":["string","null"],"enum":["manual","bounce_rate","complaint_rate","unsubscribe_rate","template_error",null]},"transactional":{"type":"boolean","description":"Transactional mode (contract communication such as invoice reminders, migration 0351): started only by custom\nevents, e-mails also to contacts without newsletter consent, never to a blocked address, no unsubscribe link."},"tags":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"stats":{"$ref":"#/components/schemas/AutomationStats"}},"required":["id","name","shopId","status","version","activeSince","firstActivatedAt","pausedReason","transactional","tags","createdAt","updatedAt","stats"]},"AutomationCounts":{"type":"object","properties":{"nodes":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AutomationNodeCounts"}},"runs":{"type":"object","properties":{"active":{"type":"number"},"completed":{"type":"number"},"exited":{"type":"number"}},"required":["active","completed","exited"]}},"required":["nodes","runs"]},"AutomationDetail":{"type":"object","properties":{"description":{"type":"string"},"graph":{"$ref":"#/components/schemas/AutomationGraph"},"issues":{"type":"array","items":{"$ref":"#/components/schemas/AutomationIssue"},"description":"Everything that keeps it from running (incomplete settings, lint, unverified sender)."},"triggers":{"type":"object","additionalProperties":{"type":"object","properties":{"done":{"type":"boolean"},"next":{"type":["string","null"]}},"required":["done","next"]},"description":"Per trigger node key: a one-off trigger that already took its contacts (done) and the next scheduled pass."},"nodeMeta":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AutomationNodeMeta"},"description":"Per node key (AU-11): SE's Poslední editace and Poznámka aktualizována / Aktualizováno uživatelem."},"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"status":{"$ref":"#/components/schemas/AutomationStatus"},"version":{"type":"number"},"activeSince":{"type":["string","null"],"description":"Since when it runs without a pause; null unless active."},"firstActivatedAt":{"type":["string","null"]},"pausedReason":{"type":["string","null"],"enum":["manual","bounce_rate","complaint_rate","unsubscribe_rate","template_error",null]},"transactional":{"type":"boolean","description":"Transactional mode (contract communication such as invoice reminders, migration 0351): started only by custom\nevents, e-mails also to contacts without newsletter consent, never to a blocked address, no unsubscribe link."},"tags":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"stats":{"$ref":"#/components/schemas/AutomationStats"}},"required":["description","graph","issues","id","name","shopId","status","version","activeSince","firstActivatedAt","pausedReason","transactional","tags","createdAt","updatedAt","stats"]},"AutomationEdge":{"type":"object","description":"A connection from an output (branch) of source to target. Every output has at most one edge; no edge into a trigger or goal; no cycles.","properties":{"source":{"type":"string","description":"Node key."},"target":{"type":"string","description":"Node key."},"branch":{"type":"string","description":"next (one output), yes / no (condition), v1..v10 (ab_test). Default next."},"id":{"type":"string","description":"Ignored (canvas only)."}},"additionalProperties":false,"required":["source","target"]},"AutomationEditorData":{"type":"object","properties":{"automation":{"$ref":"#/components/schemas/AutomationDetail"},"lists":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorList"}},"templates":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"},"description":"Active templates, newest change first, then archived ones this automation's e-mail nodes use (archived)."},"senders":{"type":"array","items":{"$ref":"#/components/schemas/Sender"}},"purposes":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"}},"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"}},"customFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"id":{"type":"string"},"type":{"type":"string","enum":["number","text","date","checkbox","textarea","select","multi_checkbox","radio"],"description":"Fixed once created."}},"required":["name","options","id","type"]}},"segments":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"},"description":"Segments of the automation's shop only."},"automations":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"},"description":"Every automation of the tenant, this one included."},"emailNodes":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEmailNode"},"description":"E-mail nodes of the other automations."},"couponStacks":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"}},"feeds":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"}},"forms":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"}},"unsubscribePages":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEditorOption"},"description":"Active unsubscribe pages (Pokročilé of an e-mail node, AA-04)."}},"required":["automation","lists","templates","senders","purposes","campaigns","customFields","segments","automations","emailNodes","couponStacks","feeds","forms"],"description":"GET /tenants/{t}/automations/{id}/editor: everything the editor opens with, in one answer. A catalog of a module\nthe user cannot read (its list endpoint would answer 403) is empty."},"AutomationEditorList":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":["string","null"],"description":"null = list of the whole tenant, not bound to one e-shop."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (štítky), at most 20."},"id":{"type":"string"},"manualMembers":{"type":"boolean","description":"False for lists filled by an e-shop connection: members are not added or removed by hand (409)."}},"required":["name","shopId","tags","id","manualMembers"],"description":"A list as the editor's pickers and checks need it (no member counts)."},"AutomationEditorOption":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"archived":{"type":"boolean","description":"Templates only: an archived template an e-mail node of this automation still uses (kept so the editor never\nreports it missing; pickers offer it only to the node that has it)."},"subject":{"type":"string","description":"Templates only: the subject the e-mail node shows until it has its own (AA-01)."},"linkParams":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"description":"Templates only: the e-mail's own UTM parameters, shown read-only in the node's Tracking (AA-03)."}},"required":["id","name"],"description":"An option of an editor picker: id and name only."},"AutomationEmailNode":{"type":"object","properties":{"automationId":{"type":"string"},"automationName":{"type":"string"},"nodeKey":{"type":"string"},"nodeName":{"type":"string"}},"required":["automationId","automationName","nodeKey","nodeName"],"description":"An e-mail node of another automation (events and conditions may name it: \"e-mailový uzel / název scénáře\")."},"AutomationGraph":{"type":"object","description":"The graph: at most 300 nodes and 600 edges, one or more triggers, acyclic. An output without an edge = the contact leaves.","properties":{"nodes":{"type":"array","items":{"$ref":"#/components/schemas/AutomationNode"},"description":"Nodes.","maxItems":300},"edges":{"type":"array","items":{"$ref":"#/components/schemas/AutomationEdge"},"description":"Edges.","maxItems":600}},"additionalProperties":false,"required":["nodes"]},"AutomationInput":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"graph":{"$ref":"#/components/schemas/AutomationGraph"},"transactional":{"type":"boolean","description":"Transactional mode; switched only while the automation does not run and only for a graph that fits it."}},"required":["name","shopId"]},"AutomationIssue":{"type":"object","description":"A problem of a graph. Errors refuse the save (400 validation graph, params.issues); incomplete settings are saved but block activation and tests (detail.issues).","properties":{"node":{"type":["string","null"],"description":"Node key, null for the whole graph."},"field":{"type":"string","description":"Config field path (e.g. definition.0.listId), \"\" for the node."},"code":{"type":"string","enum":["required","invalid","unavailable","not_found","locked","empty","lint","unverified","unreachable","too_short","too_long","duplicate","node","cycle","self_trigger","not_whitelisted","reserved","calendar","transactional_node","transactional_trigger","transactional_content"],"description":"required, invalid, unavailable, not_found, locked, empty, lint, unverified, unreachable, too_short, too_long, duplicate, node, cycle, self_trigger, not_whitelisted, reserved, calendar; transactional automations also transactional_node (a node type the mode does not allow), transactional_trigger (a trigger other than a custom event) and transactional_content (a template with an unsubscribe link, the newsletter footer or a coupon)."}},"additionalProperties":false,"required":["node","field","code"]},"AutomationNode":{"description":"One node of an automation graph; `type` selects the settings in `config`. Unknown config keys are dropped when saving.","oneOf":[{"$ref":"#/components/schemas/AutomationNode_trigger_now"},{"$ref":"#/components/schemas/AutomationNode_trigger_scheduled"},{"$ref":"#/components/schemas/AutomationNode_trigger_repeat"},{"$ref":"#/components/schemas/AutomationNode_trigger_event"},{"$ref":"#/components/schemas/AutomationNode_trigger_date"},{"$ref":"#/components/schemas/AutomationNode_trigger_reorder"},{"$ref":"#/components/schemas/AutomationNode_condition"},{"$ref":"#/components/schemas/AutomationNode_wait"},{"$ref":"#/components/schemas/AutomationNode_ab_test"},{"$ref":"#/components/schemas/AutomationNode_holding"},{"$ref":"#/components/schemas/AutomationNode_goal"},{"$ref":"#/components/schemas/AutomationNode_send_email"},{"$ref":"#/components/schemas/AutomationNode_send_sms"},{"$ref":"#/components/schemas/AutomationNode_list_change"},{"$ref":"#/components/schemas/AutomationNode_send_viber"},{"$ref":"#/components/schemas/AutomationNode_webhook"},{"$ref":"#/components/schemas/AutomationNode_set_field"},{"$ref":"#/components/schemas/AutomationNode_reset"},{"$ref":"#/components/schemas/AutomationNode_fb_audience"},{"$ref":"#/components/schemas/AutomationNode_sklik_retargeting"},{"$ref":"#/components/schemas/AutomationNode_motionlab_adina"},{"$ref":"#/components/schemas/AutomationNode_whatsapp"},{"$ref":"#/components/schemas/AutomationNode_fire_event"},{"$ref":"#/components/schemas/AutomationNode_notify"},{"$ref":"#/components/schemas/AutomationNode_goto"},{"$ref":"#/components/schemas/AutomationNode_end"}],"discriminator":{"propertyName":"type","mapping":{"trigger_now":"#/components/schemas/AutomationNode_trigger_now","trigger_scheduled":"#/components/schemas/AutomationNode_trigger_scheduled","trigger_repeat":"#/components/schemas/AutomationNode_trigger_repeat","trigger_event":"#/components/schemas/AutomationNode_trigger_event","trigger_date":"#/components/schemas/AutomationNode_trigger_date","trigger_reorder":"#/components/schemas/AutomationNode_trigger_reorder","condition":"#/components/schemas/AutomationNode_condition","wait":"#/components/schemas/AutomationNode_wait","ab_test":"#/components/schemas/AutomationNode_ab_test","holding":"#/components/schemas/AutomationNode_holding","goal":"#/components/schemas/AutomationNode_goal","send_email":"#/components/schemas/AutomationNode_send_email","send_sms":"#/components/schemas/AutomationNode_send_sms","list_change":"#/components/schemas/AutomationNode_list_change","send_viber":"#/components/schemas/AutomationNode_send_viber","webhook":"#/components/schemas/AutomationNode_webhook","set_field":"#/components/schemas/AutomationNode_set_field","reset":"#/components/schemas/AutomationNode_reset","fb_audience":"#/components/schemas/AutomationNode_fb_audience","sklik_retargeting":"#/components/schemas/AutomationNode_sklik_retargeting","motionlab_adina":"#/components/schemas/AutomationNode_motionlab_adina","whatsapp":"#/components/schemas/AutomationNode_whatsapp","fire_event":"#/components/schemas/AutomationNode_fire_event","notify":"#/components/schemas/AutomationNode_notify","goto":"#/components/schemas/AutomationNode_goto","end":"#/components/schemas/AutomationNode_end"}}},"AutomationNodeCounts":{"type":"object","properties":{"passed":{"type":"number"},"yes":{"type":"number"},"no":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number","description":"Actions that could not be carried out (Monitoring chybových akcí)."},"waiting":{"type":"number"},"holding":{"type":"number","description":"Contacts in a storage node now (Odkladiště)."},"left":{"type":"number","description":"Contacts that left the scenario at this node."},"outputs":{"type":"object","properties":{"next":{"type":"number"},"yes":{"type":"number"},"no":{"type":"number"},"v1":{"type":"number"},"v2":{"type":"number"},"v3":{"type":"number"},"v4":{"type":"number"},"v5":{"type":"number"},"v6":{"type":"number"},"v7":{"type":"number"},"v8":{"type":"number"},"v9":{"type":"number"},"v10":{"type":"number"}},"description":"Contacts per output."},"queued":{"type":"number"},"sent":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"}},"required":["passed","yes","no","skipped","waiting","queued","sent","opened","clicked"]},"AutomationNodeMeta":{"type":"object","properties":{"updatedAt":{"type":["string","null"]},"updatedBy":{"type":"string"},"noteUpdatedAt":{"type":["string","null"]},"noteUpdatedBy":{"type":"string"}},"required":["updatedAt","updatedBy","noteUpdatedAt","noteUpdatedBy"]},"AutomationNodeTest":{"type":"object","properties":{"reached":{"type":"number","description":"Contacts that came to the node."},"waiting":{"type":"number","description":"Contacts that stay waiting in it (a wait not over yet, a condition still waiting for its rules)."},"left":{"type":"number","description":"Contacts that leave the scenario here (the end node, an output without an edge)."},"outputs":{"type":"object","properties":{"next":{"type":"number"},"yes":{"type":"number"},"no":{"type":"number"},"v1":{"type":"number"},"v2":{"type":"number"},"v3":{"type":"number"},"v4":{"type":"number"},"v5":{"type":"number"},"v6":{"type":"number"},"v7":{"type":"number"},"v8":{"type":"number"},"v9":{"type":"number"},"v10":{"type":"number"}},"description":"Contacts per output of the node type: next, or yes and no."}},"required":["reached","waiting","left","outputs"]},"AutomationNodeType":{"type":"string","enum":["notify","trigger_now","trigger_scheduled","trigger_repeat","trigger_event","trigger_date","trigger_reorder","condition","wait","ab_test","holding","goal","send_email","send_sms","list_change","send_viber","webhook","set_field","reset","fb_audience","sklik_retargeting","motionlab_adina","whatsapp","fire_event","goto","end"]},"AutomationNode_ab_test":{"type":"object","description":"Splits contacts randomly (stable per run) into 2 to 10 variants; outputs v1..vN.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"ab_test"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Splits contacts randomly (stable per run) into 2 to 10 variants; outputs v1..vN.","properties":{"variants":{"type":"array","items":{"type":"object","description":"Variant.","properties":{"key":{"type":"string","description":"v1, v2, ... in order."},"share":{"type":"integer","description":"Percent, 1 to 99.","minimum":1,"maximum":99}},"additionalProperties":false,"required":["key","share"]},"description":"2 to 10 variants {key: \"v1\"..\"vN\" in order, share 1..99}, shares sum to 100.","minItems":2,"maxItems":10}},"additionalProperties":true,"x-required-for-activation":["variants"]}},"required":["id","type"],"x-group":"operator","x-branches":["v1","...","v10"],"x-available":true,"x-smartemailing":"ab","examples":[{"id":"ab-test-1","type":"ab_test","config":{"variants":[{"key":"v1","share":50},{"key":"v2","share":50}]}}]},"AutomationNode_condition":{"type":"object","description":"Splits the run: output yes when the definition holds, else no. With waitUntilMet the contact waits until it holds (then yes) or the time runs out (then no); checked every 20 minutes to once a day.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"condition"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Splits the run: output yes when the definition holds, else no. With waitUntilMet the contact waits until it holds (then yes) or the time runs out (then no); checked every 20 minutes to once a day.","properties":{"definition":{"$ref":"#/components/schemas/ConditionGroup"},"waitUntilMet":{"type":"object","description":"Wait for the definition up to this long (15 minutes to 10 years).","properties":{"value":{"type":"integer","description":"How many units, 1 to 100 000.","minimum":1,"maximum":100000},"unit":{"type":"string","enum":["minutes","hours","days","weeks","months","years"],"description":"Unit."}},"additionalProperties":false,"required":["value","unit"]},"waitUpTo":{"type":"object","description":"Older form of waitUntilMet (hours or days, at most 30 days).","properties":{"value":{"type":"integer","description":"How many units, 1 to 100 000.","minimum":1,"maximum":100000},"unit":{"type":"string","enum":["hours","days"],"description":"Unit."}},"additionalProperties":false,"required":["value","unit"]}},"additionalProperties":true,"x-required-for-activation":["definition"]}},"required":["id","type"],"x-group":"operator","x-branches":["yes","no"],"x-available":true,"x-smartemailing":"condition","examples":[{"id":"condition-1","type":"condition","config":{"definition":{"type":"group","match":"all","rules":[{"type":"email_activity","operator":"opened","nodeId":null}]}}}]},"AutomationNode_end":{"type":"object","description":"Ends the run (the contact leaves).","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"end"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Ends the run (the contact leaves).","properties":{},"additionalProperties":true,"x-required-for-activation":[]}},"required":["id","type"],"x-group":"action","x-branches":[],"x-available":true,"examples":[{"id":"end-1","type":"end","config":{}}]},"AutomationNode_fb_audience":{"type":"object","description":"Not available yet: needs meta. Shown in the palette, saving reports \"unavailable\".","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"fb_audience"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Not available yet: needs meta. Shown in the palette, saving reports \"unavailable\"."}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":false,"x-needs":"meta","x-smartemailing":"facebook-audience"},"AutomationNode_fire_event":{"type":"object","description":"Fires a custom event of the contact that event triggers (custom) of OTHER automations listen to.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"fire_event"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Fires a custom event of the contact that event triggers (custom) of OTHER automations listen to.","properties":{"name":{"type":"string","description":"a-z, 0-9 and - (1 to 50), not starting with se-.","pattern":"^[a-z0-9-]{1,50}$"},"data":{"type":"object","description":"Event data, at most 2 000 characters as JSON."}},"additionalProperties":true,"x-required-for-activation":["name"]}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":true,"x-smartemailing":"fire-event","examples":[{"id":"fire-event-1","type":"fire_event","config":{"name":"vip-reached","data":{"level":"gold"}}}]},"AutomationNode_goal":{"type":"object","description":"Goal of the scenario: before every step the goals are checked; a contact who meets one leaves the scenario wherever it is. No edges in or out.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"goal"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Goal of the scenario: before every step the goals are checked; a contact who meets one leaves the scenario wherever it is. No edges in or out.","properties":{"definition":{"$ref":"#/components/schemas/ConditionGroup"}},"additionalProperties":true,"x-required-for-activation":["definition"]}},"required":["id","type"],"x-group":"operator","x-branches":[],"x-available":true,"examples":[{"id":"goal-1","type":"goal","config":{"definition":{"type":"group","match":"all","rules":[{"type":"ordered_since_entry","operator":"yes","shopId":null}]}}}]},"AutomationNode_goto":{"type":"object","description":"Jumps to another node of this graph (not a trigger or goal; the jump counts as an edge for cycles, so only forward).","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"goto"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Jumps to another node of this graph (not a trigger or goal; the jump counts as an edge for cycles, so only forward).","properties":{"target":{"type":"string","description":"Key of the target node."}},"additionalProperties":true,"x-required-for-activation":["target"]}},"required":["id","type"],"x-group":"action","x-branches":[],"x-available":true},"AutomationNode_holding":{"type":"object","description":"Storage (Odkladiště): contacts wait here until an edge out of the node is added (then they continue) or 90 days pass.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"holding"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Storage (Odkladiště): contacts wait here until an edge out of the node is added (then they continue) or 90 days pass.","properties":{},"additionalProperties":true,"x-required-for-activation":[]}},"required":["id","type"],"x-group":"operator","x-branches":["next"],"x-available":true,"x-smartemailing":"storage","examples":[{"id":"holding-1","type":"holding","config":{}}]},"AutomationNode_list_change":{"type":"object","description":"Sets the contact's state in manual lists (confirmed adds, unsubscribed and removed take out). Lists bound to an e-shop cannot be changed.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"list_change"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Sets the contact's state in manual lists (confirmed adds, unsubscribed and removed take out). Lists bound to an e-shop cannot be changed.","properties":{"status":{"type":"string","enum":["confirmed","unsubscribed","removed"],"description":"New state."},"action":{"type":"string","enum":["add","remove"],"description":"Older form: add = confirmed, remove = removed."},"listIds":{"type":"array","items":{"type":"string"},"description":"1 to 20 manual or form list ids, unique.","minItems":1,"maxItems":20},"listRefs":{"type":"array","items":{"type":"string"},"description":"Information only."}},"additionalProperties":true,"x-required-for-activation":["status","listIds"]}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":true,"x-smartemailing":"add-to-list","examples":[{"id":"list-change-1","type":"list_change","config":{"status":"confirmed","listIds":["101"]}}]},"AutomationNode_motionlab_adina":{"type":"object","description":"Not available yet: needs motionlab. Shown in the palette, saving reports \"unavailable\".","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"motionlab_adina"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Not available yet: needs motionlab. Shown in the palette, saving reports \"unavailable\"."}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":false,"x-needs":"motionlab","x-smartemailing":"motionlab-adina"},"AutomationNode_notify":{"type":"object","description":"Notifies the team in the app (notification centre).","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"notify"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Notifies the team in the app (notification centre).","properties":{"message":{"type":"string","description":"1 to 500 characters."},"important":{"type":"boolean","description":"Mark as important, default false."}},"additionalProperties":true,"x-required-for-activation":["message"]}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":true,"examples":[{"id":"notify-1","type":"notify","config":{"message":"Zákazník dosáhl VIP úrovně","important":false}}]},"AutomationNode_reset":{"type":"object","description":"Ends the contact's other active runs of this scenario that wait in nodes after this one (SmartEmailing Reset).","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"reset"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Ends the contact's other active runs of this scenario that wait in nodes after this one (SmartEmailing Reset).","properties":{},"additionalProperties":true,"x-required-for-activation":[]}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":true,"x-smartemailing":"reset","examples":[{"id":"reset-1","type":"reset","config":{}}]},"AutomationNode_send_email":{"type":"object","description":"Sends an e-mail from a template (once per node and contact within the company's window). Only to mailable contacts, rechecked right before sending.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"send_email"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Sends an e-mail from a template (once per node and contact within the company's window). Only to mailable contacts, rechecked right before sending.","properties":{"templateId":{"type":"string","description":"Template with content (GET /templates). Required."},"templateRef":{"type":"string","description":"Information only (definition files)."},"subject":{"type":"string","description":"Subject, at most 200 characters; default the template's."},"preheader":{"type":"string","description":"Preheader, at most 300; default the template's."},"senderId":{"type":"string","description":"Sender of the automation's shop (GET /senders); default the shop's default sender. Must be verified to activate."},"senderName":{"type":"string","description":"Sender name, at most 100."},"replyTo":{"type":"string","description":"Reply-To e-mail address."},"trackOpens":{"type":"boolean","description":"Default true."},"trackClicks":{"type":"boolean","description":"Default true."},"trackingParams":{"type":"object","description":"UTM parameters added to links.","properties":{"enabled":{"type":"boolean","description":"On / off."},"params":{"type":"array","items":{"type":"object","description":"Parameter.","properties":{"name":{"type":"string","description":"Letters, digits, _ . - (1 to 40)."},"value":{"type":"string","description":"At most 500."}},"additionalProperties":false,"required":["name"]},"description":"At most 10 {name, value}."}},"additionalProperties":false},"headers":{"type":"object","description":"Own e-mail headers.","properties":{"enabled":{"type":"boolean","description":"On / off."},"items":{"type":"array","items":{"type":"object","description":"Header.","properties":{"name":{"type":"string","description":"Letters, digits and - (1 to 60)."},"value":{"type":"string","description":"At most 500."}},"additionalProperties":false,"required":["name"]},"description":"At most 10 {name, value}; reserved headers (From, To, Subject, List-Unsubscribe ...) are refused."}},"additionalProperties":false},"unsubscribePageId":{"type":"string","description":"Own unsubscribe page of this node (GET /unsubscribe-pages)."},"controlAddress":{"type":"string","description":"Send every e-mail of this node only to this test address of the company (GET /test-recipients) instead of the contact; for checking a live scenario."}},"additionalProperties":true,"x-required-for-activation":["templateId"]}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":true,"x-smartemailing":"send-email","examples":[{"id":"send-email-1","type":"send_email","config":{"templateId":"301","subject":"Zapomněli jste něco v košíku","trackOpens":true,"trackClicks":true}}]},"AutomationNode_send_sms":{"type":"object","description":"Not available yet: needs sms. Shown in the palette, saving reports \"unavailable\".","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"send_sms"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Not available yet: needs sms. Shown in the palette, saving reports \"unavailable\"."}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":false,"x-needs":"sms","x-smartemailing":"send-sms"},"AutomationNode_send_viber":{"type":"object","description":"Not available yet: needs viber. Shown in the palette, saving reports \"unavailable\".","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"send_viber"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Not available yet: needs viber. Shown in the palette, saving reports \"unavailable\"."}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":false,"x-needs":"viber","x-smartemailing":"send-viber-message"},"AutomationNode_set_field":{"type":"object","description":"Sets or clears a contact field. valueKind fixed (a value of the field's type), relative (dates: a time spec from now) or template (text fields: merge tags).","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"set_field"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Sets or clears a contact field. valueKind fixed (a value of the field's type), relative (dates: a time spec from now) or template (text fields: merge tags).","properties":{"field":{"type":"string","description":"System field (firstName, lastName, titleBefore, titleAfter, company, companyId, phone, mobile, street, city, postalCode, note, affiliateId, salutation, salutationFormal, vocativeFirstName, vocativeLastName, gender, language, country, birthday, nameDay) or cf:<id>."},"action":{"type":"string","enum":["set","clear"],"description":"Action."},"valueKind":{"type":"string","enum":["fixed","relative","template"],"description":"Default fixed.","default":"fixed"},"value":{"description":"set only: by field kind: text (at most 200), textarea (1 000), gender f / m, language xx, country XX, date YYYY-MM-DD, name day MM-DD, number as string, checkbox true / false, select / radio an option, multi_checkbox a list of options."}},"additionalProperties":true,"x-required-for-activation":["field","action"]}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":true,"x-smartemailing":"set-field","examples":[{"id":"set-field-1","type":"set_field","config":{"field":"cf:62","action":"set","valueKind":"fixed","value":"VIP"}}]},"AutomationNode_sklik_retargeting":{"type":"object","description":"Not available yet: needs sklik. Shown in the palette, saving reports \"unavailable\".","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"sklik_retargeting"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Not available yet: needs sklik. Shown in the palette, saving reports \"unavailable\"."}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":false,"x-needs":"sklik","x-smartemailing":"sklik-retargeting-emails"},"AutomationNode_trigger_date":{"type":"object","description":"Starts once a day at `at` for contacts whose date is today: name day, birthday, a date custom field (shifted by offsetDays), fixed holidays (every contact of the shop), or the first completed order exactly `days` ago.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"trigger_date"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Starts once a day at `at` for contacts whose date is today: name day, birthday, a date custom field (shifted by offsetDays), fixed holidays (every contact of the shop), or the first completed order exactly `days` ago.","properties":{"kind":{"type":"string","enum":["name_day","birthday","first_order","custom_date","holiday"],"description":"Kind of date."},"days":{"type":"integer","description":"first_order: days after the first order, 1 to 3 650.","minimum":1,"maximum":3650},"field":{"type":"string","description":"custom_date: cf:<id> of a date custom field."},"dates":{"type":"array","items":{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"},"description":"holiday: days of the year MM-DD (at most 366, unique).","minItems":1,"maxItems":366},"offsetDays":{"type":"integer","description":"name_day, birthday, custom_date: shift -365 to 365 (e.g. -3 = three days before).","minimum":-365,"maximum":365},"at":{"type":"string","description":"HH:MM local time of the daily pass.","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"reentry":{"type":"string","enum":["parallel","restart","skip","once"],"description":"What happens when a contact meets the trigger again: parallel (one more run, at most the company's limit of parallel runs; default for new triggers), restart (the new entry ends the running one), skip (nobody enters while their run is active; default of triggers saved without the setting), once (one run per contact for ever)."}},"additionalProperties":true,"x-required-for-activation":["kind","at"]}},"required":["id","type"],"x-group":"trigger","x-branches":["next"],"x-available":true,"examples":[{"id":"trigger-date-1","type":"trigger_date","config":{"kind":"name_day","at":"08:00","reentry":"parallel"}}]},"AutomationNode_trigger_event":{"type":"object","description":"Starts when an event happens to a contact (SmartEmailing \"Při události\"). Only events after the activation count. Event specific settings: `cart_updated`: The contact's cart changed (POST /contact-events type cart). shopId narrows the shop. `contact_created`: A new contact of the automation's shop. `order_created`: A new order (shopId: shop of the order, default the automation's shop). `order_changed`: An order changed state (state narrows to one state). `list_added`: The contact was added to listId. `contact_updated`: A profile field changed (fieldFilter narrows to one field and its values before / after). `action_failed`: An action of an automation failed (failureType, failureNode narrow it). `list_status_changed`: The contact's state in listId changed to status. `email_sent`: An e-mail of emailNode (a send_email node of ANOTHER automation) was sent. `page_visit`: A web tracking visit (POST /contact-events type visit): url, urlOperator, visitType. `link_clicked`: The contact clicked a link (link, compareParams) in an e-mail of emailNode (another automation). `engagement_changed`: The contact's engagement level changed. `custom`: A custom event named customEvent (POST /contact-events type custom, or a fire_event node of another automation). `form_submitted`: A form was submitted and confirmed (formId narrows to one form). `blacklisted`: The contact was blacklisted. `order_completed`: An order was completed (paid, shipped or delivered). `subscribed`: The contact subscribed (sources narrows the source; imports only when listed). `manual`: Contacts added by hand: POST /automations/{id}/contacts.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"trigger_event"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Starts when an event happens to a contact (SmartEmailing \"Při události\"). Only events after the activation count. Event specific settings: `cart_updated`: The contact's cart changed (POST /contact-events type cart). shopId narrows the shop. `contact_created`: A new contact of the automation's shop. `order_created`: A new order (shopId: shop of the order, default the automation's shop). `order_changed`: An order changed state (state narrows to one state). `list_added`: The contact was added to listId. `contact_updated`: A profile field changed (fieldFilter narrows to one field and its values before / after). `action_failed`: An action of an automation failed (failureType, failureNode narrow it). `list_status_changed`: The contact's state in listId changed to status. `email_sent`: An e-mail of emailNode (a send_email node of ANOTHER automation) was sent. `page_visit`: A web tracking visit (POST /contact-events type visit): url, urlOperator, visitType. `link_clicked`: The contact clicked a link (link, compareParams) in an e-mail of emailNode (another automation). `engagement_changed`: The contact's engagement level changed. `custom`: A custom event named customEvent (POST /contact-events type custom, or a fire_event node of another automation). `form_submitted`: A form was submitted and confirmed (formId narrows to one form). `blacklisted`: The contact was blacklisted. `order_completed`: An order was completed (paid, shipped or delivered). `subscribed`: The contact subscribed (sources narrows the source; imports only when listed). `manual`: Contacts added by hand: POST /automations/{id}/contacts.","properties":{"event":{"type":"string","enum":["cart_updated","contact_created","order_created","order_changed","list_added","contact_updated","score_changed","action_failed","list_status_changed","automation_saved","email_sent","sms_sent","page_visit","motionlab_rendered","link_clicked","engagement_changed","custom","form_submitted","blacklisted","order_completed","subscribed","manual"],"description":"The event. Not available yet: score_changed (scoring), automation_saved (unverified), sms_sent (sms), motionlab_rendered (motionlab)."},"shopId":{"type":"string","description":"Orders, carts, visits: shop (default the automation's)."},"listId":{"type":"string","description":"list_added, list_status_changed: list id."},"sources":{"type":"array","items":{"type":"string","enum":["erp_order","signup_form","import","api","manual","shoptet","smartemailing"],"description":"Source."},"description":"subscribed: sources (default erp_order, signup_form, api, manual).","minItems":1},"state":{"type":"string","enum":["new","unpaid","paid","processing","shipped","pickup","delivered","cancelled","returned","other"],"description":"order_changed: the new order state."},"status":{"type":"string","enum":["confirmed","unsubscribed","removed"],"description":"list_status_changed: the new state."},"fieldFilter":{"type":"object","description":"contact_updated: one field and optionally its values before and after. Operators by field kind: text: any, eq, empty, filled, contains, starts; date: any, on_day, newer, until, older, from, filled, empty; number: any, gt, gte, lt, lte, filled, empty; choice: any, eq_option, filled, empty; multi: any, has_option, filled, empty; checkbox: any, checked, unchecked. Fields: affiliateId, language, firstName, mobile, city, birthday, vocativeFirstName, salutation, salutationFormal, vocativeLastName, gender, note, lastName, postalCode, company, nameDay, phone, titleBefore, titleAfter, street, country or cf:<id>.","properties":{"field":{"type":"string","description":"Field."},"before":{"type":"object","description":"Condition on the old value.","properties":{"operator":{"type":"string","description":"Operator."},"value":{}},"additionalProperties":false},"after":{"type":"object","description":"Condition on the new value.","properties":{"operator":{"type":"string","description":"Operator."},"value":{}},"additionalProperties":false}},"additionalProperties":false,"required":["field"]},"failureType":{"type":"string","enum":["customizationDataboxTerminate","customizationDataboxOutOfPromocodes","customizationSyntaxError","contactSetFieldFail","smsRateLimitReached","sklikError","other"],"description":"action_failed: type."},"failureNode":{"type":"object","description":"action_failed: the node (automationId null = this graph).","properties":{"automationId":{"type":["string","null"]},"nodeKey":{"type":"string","description":"Node key."}},"additionalProperties":false,"required":["nodeKey"]},"emailNode":{"type":"object","description":"An e-mail node: automationId null (or left out) = a send_email node of this graph, else the id of another automation of the company and its node key.","properties":{"automationId":{"type":["string","null"],"description":"Automation id, null = this one."},"nodeKey":{"type":"string","description":"Key (id) of the send_email node."}},"additionalProperties":false,"required":["nodeKey"]},"link":{"type":"string","description":"link_clicked: the URL (at most 2 000); empty = any link."},"compareParams":{"type":"boolean","description":"link_clicked: compare query parameters, default true."},"url":{"type":"string","description":"page_visit: URL (at most 2 000)."},"urlOperator":{"type":"string","enum":["eq","starts"],"description":"page_visit: eq (default) or starts."},"visitType":{"type":"string","enum":["home","article","cart","product","category","search","order_done","other"],"description":"page_visit: type of page."},"customEvent":{"type":"string","description":"custom: event name, a-z, 0-9 and - (1 to 50), not starting with se-.","pattern":"^[a-z0-9-]{1,50}$"},"formId":{"type":"string","description":"form_submitted: form id (empty = any form)."},"reentry":{"type":"string","enum":["parallel","restart","skip","once"],"description":"What happens when a contact meets the trigger again: parallel (one more run, at most the company's limit of parallel runs; default for new triggers), restart (the new entry ends the running one), skip (nobody enters while their run is active; default of triggers saved without the setting), once (one run per contact for ever)."}},"additionalProperties":true,"x-required-for-activation":["event"]}},"required":["id","type"],"x-group":"trigger","x-branches":["next"],"x-available":true,"x-smartemailing":"on-event","examples":[{"id":"trigger-event-1","type":"trigger_event","config":{"event":"cart_updated","shopId":"1","reentry":"restart"}}]},"AutomationNode_trigger_now":{"type":"object","description":"Starts once, right at the activation, with the contacts of the shop matching the filter (SmartEmailing \"Hned teď\").","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"trigger_now"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Starts once, right at the activation, with the contacts of the shop matching the filter (SmartEmailing \"Hned teď\").","properties":{"filter":{"anyOf":[{"$ref":"#/components/schemas/ConditionGroup"},{"type":"null"}],"description":"Who may enter: a condition tree (segment rules and automation conditions except the run only ones). null or left out = every mailable contact of the shop."},"reentry":{"type":"string","enum":["parallel","restart","skip","once"],"description":"What happens when a contact meets the trigger again: parallel (one more run, at most the company's limit of parallel runs; default for new triggers), restart (the new entry ends the running one), skip (nobody enters while their run is active; default of triggers saved without the setting), once (one run per contact for ever)."}},"additionalProperties":true,"x-required-for-activation":[]}},"required":["id","type"],"x-group":"trigger","x-branches":["next"],"x-available":true,"x-smartemailing":"run","examples":[{"id":"trigger-now-1","type":"trigger_now","config":{"reentry":"once"}}]},"AutomationNode_trigger_reorder":{"type":"object","description":"Starts once a day at `at` for customers whose last completed order is older than their usual interval between orders (\"buy again\"): the average gap of their order days, defaultDays with one order day, clamped to minDays..maxDays, plus graceDays.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"trigger_reorder"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Starts once a day at `at` for customers whose last completed order is older than their usual interval between orders (\"buy again\"): the average gap of their order days, defaultDays with one order day, clamped to minDays..maxDays, plus graceDays.","properties":{"at":{"type":"string","description":"HH:MM.","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"defaultDays":{"type":"integer","description":"1 to 365, default 30.","minimum":1,"maximum":365,"default":30},"minDays":{"type":"integer","description":"1 to 365, default 14.","minimum":1,"maximum":365,"default":14},"maxDays":{"type":"integer","description":"1 to 365 and >= minDays, default 120.","minimum":1,"maximum":365,"default":120},"graceDays":{"type":"integer","description":"0 to 365, default 0.","minimum":0,"maximum":365,"default":0},"reentry":{"type":"string","enum":["parallel","restart","skip","once"],"description":"What happens when a contact meets the trigger again: parallel (one more run, at most the company's limit of parallel runs; default for new triggers), restart (the new entry ends the running one), skip (nobody enters while their run is active; default of triggers saved without the setting), once (one run per contact for ever)."}},"additionalProperties":true,"x-required-for-activation":["at"]}},"required":["id","type"],"x-group":"trigger","x-branches":["next"],"x-available":true,"examples":[{"id":"trigger-reorder-1","type":"trigger_reorder","config":{"at":"10:00","defaultDays":30,"minDays":14,"maxDays":120,"graceDays":3,"reentry":"parallel"}}]},"AutomationNode_trigger_repeat":{"type":"object","description":"Starts repeatedly every `every` from startAt (default the activation) until stopAt, with the contacts matching the filter (SmartEmailing \"Opakovat\").","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"trigger_repeat"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Starts repeatedly every `every` from startAt (default the activation) until stopAt, with the contacts matching the filter (SmartEmailing \"Opakovat\").","properties":{"every":{"type":"object","description":"Interval, at least 15 minutes, at most 10 years.","properties":{"value":{"type":"integer","description":"How many units, 1 to 100 000.","minimum":1,"maximum":100000},"unit":{"type":"string","enum":["minutes","hours","days","weeks","months","years"],"description":"Unit."}},"additionalProperties":false,"required":["value","unit"]},"startAt":{"type":"string","description":"YYYY-MM-DDTHH:MM (local).","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"},"stopAt":{"type":"string","description":"YYYY-MM-DDTHH:MM (local), after startAt.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"},"filter":{"anyOf":[{"$ref":"#/components/schemas/ConditionGroup"},{"type":"null"}],"description":"Who may enter: a condition tree (segment rules and automation conditions except the run only ones). null or left out = every mailable contact of the shop."},"reentry":{"type":"string","enum":["parallel","restart","skip","once"],"description":"What happens when a contact meets the trigger again: parallel (one more run, at most the company's limit of parallel runs; default for new triggers), restart (the new entry ends the running one), skip (nobody enters while their run is active; default of triggers saved without the setting), once (one run per contact for ever)."}},"additionalProperties":true,"x-required-for-activation":["every"]}},"required":["id","type"],"x-group":"trigger","x-branches":["next"],"x-available":true,"x-smartemailing":"repeat","examples":[{"id":"trigger-repeat-1","type":"trigger_repeat","config":{"every":{"value":1,"unit":"days"},"startAt":"2026-11-01T08:00","reentry":"parallel","filter":{"type":"group","match":"all","rules":[{"type":"contact_anniversary","field":"nameDay","relation":"now"}]}}}]},"AutomationNode_trigger_scheduled":{"type":"object","description":"Starts once at a local date and time (SmartEmailing \"V plánovaný čas\").","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"trigger_scheduled"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Starts once at a local date and time (SmartEmailing \"V plánovaný čas\").","properties":{"at":{"type":"string","description":"YYYY-MM-DDTHH:MM, local time of the company.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"},"filter":{"anyOf":[{"$ref":"#/components/schemas/ConditionGroup"},{"type":"null"}],"description":"Who may enter: a condition tree (segment rules and automation conditions except the run only ones). null or left out = every mailable contact of the shop."},"reentry":{"type":"string","enum":["parallel","restart","skip","once"],"description":"What happens when a contact meets the trigger again: parallel (one more run, at most the company's limit of parallel runs; default for new triggers), restart (the new entry ends the running one), skip (nobody enters while their run is active; default of triggers saved without the setting), once (one run per contact for ever)."}},"additionalProperties":true,"x-required-for-activation":["at"]}},"required":["id","type"],"x-group":"trigger","x-branches":["next"],"x-available":true,"x-smartemailing":"scheduled-time","examples":[{"id":"trigger-scheduled-1","type":"trigger_scheduled","config":{"at":"2026-12-01T09:00","reentry":"once"}}]},"AutomationNode_wait":{"type":"object","description":"Waits. mode time: until the time spec (relative to the arrival at the node, or to the entry with countFrom scenario); preferred: until the contact's usual reading time (most frequent quarter hour of opens, else no wait); spread: releases the contacts evenly over the period; duration: value units; time_of_day: the next HH:MM; weekday: the next listed weekday at time; date: a local date and time. At most 10 years.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"wait"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Waits. mode time: until the time spec (relative to the arrival at the node, or to the entry with countFrom scenario); preferred: until the contact's usual reading time (most frequent quarter hour of opens, else no wait); spread: releases the contacts evenly over the period; duration: value units; time_of_day: the next HH:MM; weekday: the next listed weekday at time; date: a local date and time. At most 10 years.","properties":{"mode":{"type":"string","enum":["time","preferred","spread","duration","time_of_day","weekday","date"],"description":"Mode."},"spec":{"$ref":"#/components/schemas/TimeSpec"},"countFrom":{"type":"string","enum":["node","scenario"],"description":"time: node (default) or scenario."},"spread":{"type":"object","description":"spread: period over which contacts are released.","properties":{"value":{"type":"integer","description":"How many units, 1 to 100 000.","minimum":1,"maximum":100000},"unit":{"type":"string","enum":["minutes","hours","days","weeks","months","years"],"description":"Unit."}},"additionalProperties":false,"required":["value","unit"]},"value":{"type":"integer","description":"duration: 1 to 100 000.","minimum":1,"maximum":100000},"unit":{"type":"string","enum":["minutes","hours","days","weeks","months","years"],"description":"duration: unit."},"time":{"type":"string","description":"time_of_day, weekday: HH:MM.","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"weekdays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"weekday: 1 (Monday) to 7, unique.","minItems":1},"date":{"type":"string","description":"date: YYYY-MM-DDTHH:MM local.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]$"}},"additionalProperties":true,"x-required-for-activation":["mode"]}},"required":["id","type"],"x-group":"operator","x-branches":["next"],"x-available":true,"x-smartemailing":"wait","examples":[{"id":"wait-1","type":"wait","config":{"mode":"duration","value":2,"unit":"days"}}]},"AutomationNode_webhook":{"type":"object","description":"Calls a URL (queued, retried 5 times 5 minutes apart on a non-2xx answer, then an action failure \"other\"). Merge tags work in url (percent-encoded), body (JSON-escaped when the Content-Type is JSON; POST defaults to application/json) and header values. Only public addresses, no redirects.","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"webhook"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Calls a URL (queued, retried 5 times 5 minutes apart on a non-2xx answer, then an action failure \"other\"). Merge tags work in url (percent-encoded), body (JSON-escaped when the Content-Type is JSON; POST defaults to application/json) and header values. Only public addresses, no redirects.","properties":{"url":{"type":"string","description":"http(s) URL or one starting with a merge tag, at most 2 000."},"method":{"type":"string","enum":["GET","POST"],"description":"Default POST.","default":"POST"},"body":{"type":"string","description":"POST body, at most 10 000 characters (merge tags allowed)."},"headers":{"type":"array","items":{"type":"object","description":"Header.","properties":{"name":{"type":"string","description":"Letters, digits and - (1 to 60)."},"value":{"type":"string","description":"At most 500."}},"additionalProperties":false,"required":["name"]},"description":"At most 20 {name, value}.","maxItems":20},"basicAuth":{"type":"object","description":"HTTP Basic of the call. password is write only: answers show passwordSet.","properties":{"enabled":{"type":"boolean","description":"On / off."},"username":{"type":"string","description":"At most 100."},"password":{"type":"string","description":"At most 200; leave out to keep the stored one."},"passwordSet":{"type":"boolean","description":"Read only: a password is stored."},"passwordEnc":{"type":"boolean","description":"Internal, never sent."}},"additionalProperties":false}},"additionalProperties":true,"x-required-for-activation":["url"]}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":true,"x-smartemailing":"send-webhook","examples":[{"id":"webhook-1","type":"webhook","config":{"url":"https://crm.example.cz/hooks/postarna","method":"POST","body":"{\"email\": \"{{df_emailaddress}}\", \"event\": \"cart\"}","headers":[{"name":"X-Source","value":"postarna"}]}}]},"AutomationNode_whatsapp":{"type":"object","description":"Not available yet: needs whatsapp. Shown in the palette, saving reports \"unavailable\".","properties":{"id":{"type":"string","description":"Node key: letters, digits, - and _ (1 to 40), stable across saves.","pattern":"^[A-Za-z0-9_-]{1,40}$"},"type":{"const":"whatsapp"},"name":{"type":"string","description":"Label on the canvas, at most 100."},"note":{"type":"string","description":"Note, at most 1 000."},"position":{"type":"object","description":"Canvas position.","properties":{"x":{"type":"number"},"y":{"type":"number"}},"additionalProperties":false},"config":{"type":"object","description":"Not available yet: needs whatsapp. Shown in the palette, saving reports \"unavailable\"."}},"required":["id","type"],"x-group":"action","x-branches":["next"],"x-available":false,"x-needs":"whatsapp","x-smartemailing":"whatsapp"},"AutomationPass":{"type":"object","properties":{"at":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"]},"outcome":{"type":"string"},"branch":{"type":["string","null"],"enum":["next","yes","no","v1","v2","v3","v4","v5","v6","v7","v8","v9","v10",null]},"nextNode":{"type":["string","null"]}},"required":["at","contact","outcome","branch","nextNode"],"description":"A contact that went through a node (SmartEmailing's \"Kontakty, které prošly uzlem\")."},"AutomationReport":{"type":"object","properties":{"nodes":{"type":"array","items":{"$ref":"#/components/schemas/AutomationReportRow"}},"selected":{"$ref":"#/components/schemas/EmailMetrics"},"selectedKeys":{"type":"array","items":{"type":"string"}},"webhooks":{"type":"array","items":{"type":"object","properties":{"nodeKey":{"type":"string"},"name":{"type":"string"},"calls":{"type":"number"},"ok":{"type":"number"},"failed":{"type":"number"}},"required":["nodeKey","name","calls","ok","failed"]}}},"required":["nodes","selected","selectedKeys","webhooks"]},"AutomationReportRow":{"type":"object","properties":{"nodeKey":{"type":"string"},"name":{"type":"string"},"metrics":{"$ref":"#/components/schemas/EmailMetrics"},"conversions":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"direct":{"type":"number"},"assisted":{"type":"number"},"revenue":{"type":"string"}},"required":["currency","direct","assisted","revenue"]}},"conversionRate":{"type":"number"}},"required":["nodeKey","name","metrics","conversions","conversionRate"],"description":"Statistics of a scenario: one row per e-mail node (metrics as the e-mail statistics), conversions per currency."},"AutomationRun":{"type":"object","properties":{"id":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"]},"status":{"$ref":"#/components/schemas/AutomationRunStatus"},"node":{"type":["string","null"]},"entryKey":{"type":"string"},"enteredAt":{"type":"string"},"dueAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]},"exitReason":{"type":["string","null"]},"steps":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"outcome":{"$ref":"#/components/schemas/AutomationStepOutcome"},"at":{"type":"string"},"branch":{"type":["string","null"],"enum":["next","yes","no","v1","v2","v3","v4","v5","v6","v7","v8","v9","v10",null]},"nextNode":{"type":["string","null"]},"reason":{"type":["string","null"],"enum":["not_mailable","exception_expired","suppressed","node_window","customizationSyntaxError","contactSetFieldFail",null]},"messageId":{"type":["string","null"]}},"required":["node","outcome","at"]},"description":"The real steps (automation_steps): reason = why a step was skipped or failed, messageId = the e-mail it queued."},"trigger":{"type":["string","null"],"description":"The trigger node the run came in through."}},"required":["id","contact","status","node","entryKey","enteredAt","dueAt","finishedAt","exitReason","steps"]},"AutomationRunStatus":{"type":"string","enum":["active","completed","exited"]},"AutomationStats":{"type":"object","properties":{"entered":{"type":"number"},"active":{"type":"number"},"sent":{"type":"number"}},"required":["entered","active","sent"]},"AutomationStatus":{"type":"string","enum":["active","draft","paused"]},"AutomationStepOutcome":{"type":"string","enum":["expired","queued","failed","skipped","goal","reset","end","yes","no","entered","passed","variant","released","jumped"]},"AutomationTest":{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AutomationTestScope"},"days":{"type":["number","null"],"description":"Replayed window of an event trigger, null for the other scopes."},"since":{"type":["string","null"],"description":"Start of the replayed window (ISO), null for the other scopes."},"testedAt":{"type":"string"},"entered":{"type":"number"},"waiting":{"type":"number"},"left":{"type":"number"},"nodes":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AutomationNodeTest"},"description":"Every node of the tested graph by its key."}},"required":["scope","days","since","testedAt","entered","waiting","left","nodes"],"description":"POST /automations/{id}/test: one dry pass over the current data; nothing is written or sent."},"AutomationTestInput":{"type":"object","properties":{"graph":{"allOf":[{"$ref":"#/components/schemas/AutomationGraph"}],"description":"The editor's graph; the stored graph when omitted."},"days":{"type":"number","description":"1 to AUTOMATION_TEST_MAX_DAYS, default AUTOMATION_TEST_MAX_DAYS."}}},"AutomationTestScope":{"type":"string","enum":["contacts","events","today","mixed"]},"AutomationTrace":{"type":"object","properties":{"contactId":{"type":"string"},"email":{"type":"string"},"mayEnter":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"},"description":"Why the contact may not enter: status, suppressed, weak_consent, shop, exception_expired."},"trigger":{"type":"string"},"offered":{"type":"boolean"},"eventAt":{"type":["string","null"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/AutomationTraceStep"}},"result":{"type":"string","enum":["waiting","left","holding","goal","end","limit"]}},"required":["contactId","email","mayEnter","reasons","trigger","offered","eventAt","steps","result"]},"AutomationTraceInput":{"type":"object","properties":{"contactId":{"type":"string"},"email":{"type":"string"},"graph":{"$ref":"#/components/schemas/AutomationGraph"},"triggerKey":{"type":"string"},"days":{"type":"number"}}},"AutomationTraceStep":{"type":"object","properties":{"node":{"type":"string"},"type":{"$ref":"#/components/schemas/AutomationNodeType"},"outcome":{"type":"string"},"branch":{"type":["string","null"],"enum":["next","yes","no","v1","v2","v3","v4","v5","v6","v7","v8","v9","v10",null]},"at":{"type":"string"},"note":{"type":["object","null"],"additionalProperties":{}}},"required":["node","type","outcome","branch","at","note"],"description":"POST /automations/{id}/trace: the way of one contact through the scenario, nothing written or sent."},"AutomationValidation":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/AutomationIssue"}},"incomplete":{"type":"array","items":{"$ref":"#/components/schemas/AutomationIssue"}}},"required":["errors","incomplete"]},"AutomationVersion":{"type":"object","properties":{"version":{"type":"number"},"status":{"$ref":"#/components/schemas/AutomationStatus"},"savedAt":{"type":"string"},"savedBy":{"type":"string"},"nodes":{"type":"number"},"current":{"type":"boolean"}},"required":["version","status","savedAt","savedBy","nodes","current"],"description":"A saved version of a graph (every save keeps one)."},"ConditionGroup":{"type":"object","additionalProperties":false,"description":"The definition of a condition, goal or trigger filter: the same tree as a segment, whose rules may also be automation conditions. Every rule may carry negate. Rules with a period take {from, to} time specs.","properties":{"type":{"const":"group"},"match":{"type":"string","enum":["all","any"],"description":"all = AND, any = OR."},"rules":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/ConditionGroup"},{"$ref":"#/components/schemas/SegmentRule_field"},{"$ref":"#/components/schemas/SegmentRule_list"},{"$ref":"#/components/schemas/SegmentRule_order_count"},{"$ref":"#/components/schemas/SegmentRule_order_value"},{"$ref":"#/components/schemas/SegmentRule_last_order"},{"$ref":"#/components/schemas/SegmentRule_engagement"},{"$ref":"#/components/schemas/SegmentRule_purpose"},{"$ref":"#/components/schemas/SegmentRule_custom_field"},{"$ref":"#/components/schemas/SegmentRule_campaign"},{"$ref":"#/components/schemas/SegmentRule_order_attribute"},{"$ref":"#/components/schemas/SegmentRule_segment"},{"$ref":"#/components/schemas/SegmentRule_list_label"},{"$ref":"#/components/schemas/SegmentRule_opens"},{"$ref":"#/components/schemas/SegmentRule_product_bought"},{"$ref":"#/components/schemas/SegmentRule_web_visit"},{"$ref":"#/components/schemas/SegmentRule_web_attribute"},{"$ref":"#/components/schemas/ConditionRule_contact_in_automation"},{"$ref":"#/components/schemas/ConditionRule_contact_in_list"},{"$ref":"#/components/schemas/ConditionRule_contact_in_any_list"},{"$ref":"#/components/schemas/ConditionRule_contact_in_list_label"},{"$ref":"#/components/schemas/ConditionRule_contact_purpose"},{"$ref":"#/components/schemas/ConditionRule_contact_origin"},{"$ref":"#/components/schemas/ConditionRule_contact_field"},{"$ref":"#/components/schemas/ConditionRule_contact_anniversary"},{"$ref":"#/components/schemas/ConditionRule_sent_email"},{"$ref":"#/components/schemas/ConditionRule_sent_emails_count"},{"$ref":"#/components/schemas/ConditionRule_opened_email"},{"$ref":"#/components/schemas/ConditionRule_opened_emails_count"},{"$ref":"#/components/schemas/ConditionRule_cart_items_count"},{"$ref":"#/components/schemas/ConditionRule_day_of_month"},{"$ref":"#/components/schemas/ConditionRule_day_of_week"},{"$ref":"#/components/schemas/ConditionRule_hour_of_day"},{"$ref":"#/components/schemas/ConditionRule_ordered_attribute"},{"$ref":"#/components/schemas/ConditionRule_ordered_product"},{"$ref":"#/components/schemas/ConditionRule_ordered_product_by_attribute"},{"$ref":"#/components/schemas/ConditionRule_orders_total_value"},{"$ref":"#/components/schemas/ConditionRule_orders_count"},{"$ref":"#/components/schemas/ConditionRule_promo_code"},{"$ref":"#/components/schemas/ConditionRule_script"},{"$ref":"#/components/schemas/ConditionRule_tracking_url_clicked"},{"$ref":"#/components/schemas/ConditionRule_tracking_url_clicked_any"},{"$ref":"#/components/schemas/ConditionRule_visited_attribute"},{"$ref":"#/components/schemas/ConditionRule_visited_url"},{"$ref":"#/components/schemas/ConditionRule_feed_item_count"},{"$ref":"#/components/schemas/ConditionRule_ab_test_winner"},{"$ref":"#/components/schemas/ConditionRule_ab_test_significant"},{"$ref":"#/components/schemas/ConditionRule_engagement_score"},{"$ref":"#/components/schemas/ConditionRule_email_activity"},{"$ref":"#/components/schemas/ConditionRule_passed_node"},{"$ref":"#/components/schemas/ConditionRule_ordered_since_entry"},{"$ref":"#/components/schemas/ConditionRule_event_attribute"},{"$ref":"#/components/schemas/ConditionRule_cart_items"},{"$ref":"#/components/schemas/ConditionRule_score"},{"$ref":"#/components/schemas/ConditionRule_seen_viber"},{"$ref":"#/components/schemas/ConditionRule_delivered_viber"},{"$ref":"#/components/schemas/ConditionRule_sent_sms"},{"$ref":"#/components/schemas/ConditionRule_contact_viber_state"},{"$ref":"#/components/schemas/ConditionRule_contact_preference"}]},"description":"Rules and subgroups."}},"required":["type","match","rules"]},"ConditionRule_ab_test_significant":{"type":"object","description":"The difference between nodes A and B is significant (95 %, two-proportion z-test).","properties":{"type":{"const":"ab_test_significant"},"metric":{"type":"string","enum":["open_rate","click_rate"],"description":"Metric."},"nodeA":{"type":"string","description":"send_email node key."},"nodeB":{"type":"string","description":"Another send_email node key."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","metric","nodeA","nodeB"],"x-smartemailing":"ab-test-email-statistic-significant"},"ConditionRule_ab_test_winner":{"type":"object","description":"Node A beats node B (two send_email nodes of this graph) in open or click rate.","properties":{"type":{"const":"ab_test_winner"},"metric":{"type":"string","enum":["open_rate","click_rate"],"description":"Metric."},"nodeA":{"type":"string","description":"send_email node key."},"nodeB":{"type":"string","description":"Another send_email node key."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","metric","nodeA","nodeB"],"x-smartemailing":"ab-test-email-statistic-winner"},"ConditionRule_cart_items":{"type":"object","description":"Old name of cart_items_count (still accepted).","properties":{"type":{"const":"cart_items"},"operator":{"type":"string","enum":["eq","lt","lte","gt","gte"],"description":"Operator."},"value":{"description":"Whole number."},"shopId":{"type":["string","null"]},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","value"],"x-smartemailing":null,"examples":[{"type":"cart_items","operator":"gt","value":0}]},"ConditionRule_cart_items_count":{"type":"object","description":"Items in the contact's cart (a cart not changed since an order counts as empty).","properties":{"type":{"const":"cart_items_count"},"operator":{"type":"string","enum":["eq","lt","lte","gt","gte"],"description":"Operator."},"value":{"description":"Whole number."},"shopId":{"type":["string","null"],"description":"Shop, null = any cart."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","value"],"x-smartemailing":"cart-items-count","examples":[{"type":"cart_items_count","operator":"gt","value":0,"shopId":"1"}]},"ConditionRule_contact_anniversary":{"type":"object","description":"Today is (or is offset from) the contact's birthday, name day or a date custom field. nameDay: the contact's own name day, else the calendar of the first name (calendar auto = Slovak for language sk, else by the shop's language).","properties":{"type":{"const":"contact_anniversary"},"field":{"type":"string","description":"birthday, nameDay or cf:<id> of a date field."},"calendar":{"type":"string","enum":["auto","cz","sk"],"description":"nameDay only."},"relation":{"type":"string","enum":["now","offset"],"description":"now = today; offset = shifted.","default":"now"},"offset":{"type":"object","description":"With relation offset, at least 15 minutes.","properties":{"value":{"type":"integer","description":"How many units, 1 to 100 000.","minimum":1,"maximum":100000},"unit":{"type":"string","enum":["minutes","hours","days","weeks","months","years"],"description":"Unit."}},"additionalProperties":false,"required":["value","unit"]},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","field"],"x-smartemailing":"contact-anniversary","examples":[{"type":"contact_anniversary","field":"nameDay","calendar":"auto","relation":"now"}]},"ConditionRule_contact_field":{"type":"object","description":"A contact field (system field or cf:<id>) compared with a value. Text: eq, filled, empty, gt, gte, lt, lte, starts, contains; dates: date_eq, date_filled, date_empty, date_after, date_from, date_before, date_until with a time spec value; numbers: eq, gt, gte, lt, lte, filled, empty; gender: eq (f / m); checkbox: checked, unchecked; choice: eq_option; multi: has_option.","properties":{"type":{"const":"contact_field"},"field":{"type":"string","description":"System field (affiliateId, domain, email, language, firstName, mobile, city, birthday, vocativeFirstName, salutation, salutationFormal, vocativeLastName, gender, note, lastName, postalCode, company, nameDay, phone, titleBefore, titleAfter, street, createdAt, country, companyId) or cf:<id>."},"operator":{"type":"string","description":"Operator for the field kind."},"value":{"description":"Text, number, f / m, an option, or a time spec for dates."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","field","operator"],"x-smartemailing":"contact-field","examples":[{"type":"contact_field","field":"city","operator":"eq","value":"Brno"}]},"ConditionRule_contact_in_any_list":{"type":"object","description":"Contact is in any list in a state.","properties":{"type":{"const":"contact_in_any_list"},"state":{"type":"string","enum":["confirmed","unsubscribed"],"description":"State, default confirmed.","default":"confirmed"},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false,"required":["type"],"x-smartemailing":"contact-in-any-list","examples":[{"type":"contact_in_any_list"}]},"ConditionRule_contact_in_automation":{"type":"object","description":"Contact is in an automation (another active run of it). automationId null = this automation (not allowed in a trigger filter).","properties":{"type":{"const":"contact_in_automation"},"automationId":{"type":["string","null"]},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type"],"x-smartemailing":"contact-in-automation","examples":[{"type":"contact_in_automation","automationId":"201"}]},"ConditionRule_contact_in_list":{"type":"object","description":"Contact is in a list in a state.","properties":{"type":{"const":"contact_in_list"},"listId":{"type":"string","description":"List id."},"state":{"type":"string","enum":["confirmed","unsubscribed"],"description":"State, default confirmed.","default":"confirmed"},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false,"required":["type","listId"],"x-smartemailing":"contact-in-list","examples":[{"type":"contact_in_list","listId":"101","state":"confirmed"}]},"ConditionRule_contact_in_list_label":{"type":"object","description":"Contact is in a list with this label.","properties":{"type":{"const":"contact_in_list_label"},"label":{"type":"string","description":"Label, at most 40."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false,"required":["type","label"],"x-smartemailing":"contact-in-list-label","examples":[{"type":"contact_in_list_label","label":"newsletter"}]},"ConditionRule_contact_origin":{"type":"object","description":"Contact came from a source.","properties":{"type":{"const":"contact_origin"},"origin":{"type":"string","enum":["erp_order","signup_form","import","api","manual","shoptet","smartemailing"],"description":"Source."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","origin"],"x-smartemailing":"contact-origin","examples":[{"type":"contact_origin","origin":"signup_form"}]},"ConditionRule_contact_preference":{"type":"object","description":"Not available yet: Poštárna has no preferences data. Saving a graph with it reports \"unavailable\".","properties":{"type":{"const":"contact_preference"}},"required":["type"],"x-available":false,"x-needs":"preferences","x-smartemailing":"contact-preference"},"ConditionRule_contact_purpose":{"type":"object","description":"Contact has a valid consent with a purpose.","properties":{"type":{"const":"contact_purpose"},"purposeId":{"type":"string","description":"Purpose id."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false,"required":["type","purposeId"],"x-smartemailing":"contact-purpose","examples":[{"type":"contact_purpose","purposeId":"51"}]},"ConditionRule_contact_viber_state":{"type":"object","description":"Not available yet: Poštárna has no viber data. Saving a graph with it reports \"unavailable\".","properties":{"type":{"const":"contact_viber_state"}},"required":["type"],"x-available":false,"x-needs":"viber","x-smartemailing":"contact-viber-state"},"ConditionRule_day_of_month":{"type":"object","description":"Today is one of these days of the month.","properties":{"type":{"const":"day_of_month"},"days":{"type":"array","items":{"type":"integer","minimum":1,"maximum":31},"description":"Days 1 to 31.","minItems":1},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","days"],"x-smartemailing":"day-of-month","examples":[{"type":"day_of_month","days":[1,15]}]},"ConditionRule_day_of_week":{"type":"object","description":"Today is one of these weekdays (1 = Monday).","properties":{"type":{"const":"day_of_week"},"weekdays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"1 to 7.","minItems":1},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","weekdays"],"x-smartemailing":"day-of-week","examples":[{"type":"day_of_week","weekdays":[6,7]}]},"ConditionRule_delivered_viber":{"type":"object","description":"Not available yet: Poštárna has no viber data. Saving a graph with it reports \"unavailable\".","properties":{"type":{"const":"delivered_viber"}},"required":["type"],"x-available":false,"x-needs":"viber","x-smartemailing":"delivered-viber"},"ConditionRule_email_activity":{"type":"object","description":"The contact opened / clicked an e-mail of this run (nodeId null = any). Run only. (not allowed in trigger filters (needs a run))","properties":{"type":{"const":"email_activity"},"operator":{"type":"string","enum":["opened","not_opened","clicked","not_clicked"],"description":"Operator."},"nodeId":{"type":["string","null"],"description":"send_email node key."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator"],"x-smartemailing":null,"examples":[{"type":"email_activity","operator":"opened","nodeId":null}]},"ConditionRule_engagement_score":{"type":"object","description":"Engagement level of the contact.","properties":{"type":{"const":"engagement_score"},"levels":{"type":"array","items":{"type":"string","enum":["N","A","B","C","D","E"],"description":"Level."},"description":"Levels.","minItems":1,"uniqueItems":true},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","levels"],"x-smartemailing":"engagement-score","examples":[{"type":"engagement_score","levels":["A","B"]}]},"ConditionRule_event_attribute":{"type":"object","description":"A value of the data of the custom event that started the run (data of POST /contact-events type custom, or of a fire_event node of another automation). Other triggers have no such data. Run only. (not allowed in trigger filters (needs a run))","properties":{"type":{"const":"event_attribute"},"attribute":{"type":"string","description":"Name."},"operator":{"type":"string","enum":["eq","contains","starts","gt","gte","lt","lte","filled","empty"],"description":"Operator."},"value":{"type":"string","description":"Text."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","attribute","operator"],"x-smartemailing":null,"examples":[{"type":"event_attribute","attribute":"plan","operator":"eq","value":"gold"}]},"ConditionRule_feed_item_count":{"type":"object","description":"Number of items of a feed.","properties":{"type":{"const":"feed_item_count"},"feedId":{"type":"string","description":"Feed id."},"operator":{"type":"string","enum":["eq","lt","lte","gt","gte"],"description":"Operator."},"value":{"description":"Whole number."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","feedId","operator","value"],"x-smartemailing":"feed-item-count","examples":[{"type":"feed_item_count","feedId":"71","operator":"gt","value":0}]},"ConditionRule_hour_of_day":{"type":"object","description":"The current hour (local) is one of these.","properties":{"type":{"const":"hour_of_day"},"hours":{"type":"array","items":{"type":"integer","minimum":0,"maximum":23},"description":"0 to 23.","minItems":1},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","hours"],"x-smartemailing":"hour-of-day","examples":[{"type":"hour_of_day","hours":[8,9,10]}]},"ConditionRule_opened_email":{"type":"object","description":"The contact opened an e-mail of a node.","properties":{"type":{"const":"opened_email"},"emailNode":{"type":"object","description":"An e-mail node: automationId null (or left out) = a send_email node of this graph, else the id of another automation of the company and its node key.","properties":{"automationId":{"type":["string","null"],"description":"Automation id, null = this one."},"nodeKey":{"type":"string","description":"Key (id) of the send_email node."}},"additionalProperties":false,"required":["nodeKey"]},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","emailNode"],"x-smartemailing":"opened-email","examples":[{"type":"opened_email","emailNode":{"automationId":"201","nodeKey":"email-1"}}]},"ConditionRule_opened_emails_count":{"type":"object","description":"Number of e-mails the contact opened.","properties":{"type":{"const":"opened_emails_count"},"operator":{"type":"string","enum":["eq","lt","lte","gt","gte"],"description":"Operator."},"value":{"description":"Whole number."},"kinds":{"type":"array","items":{"type":"string","enum":["automation","campaign","transactional"],"description":"Kind."},"description":"Kinds."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","value"],"x-smartemailing":"opened-emails-count","examples":[{"type":"opened_emails_count","operator":"eq","value":0}]},"ConditionRule_ordered_attribute":{"type":"object","description":"A value of an order: code, state, status, sourceStatus, currency, companyId, totalWithVat, totalWithoutVat, or any delivery data field.","properties":{"type":{"const":"ordered_attribute"},"attribute":{"type":"string","description":"Attribute name: letters, digits and _ . : - (at most 60)."},"attributeType":{"type":"string","enum":["text","date","number"],"description":"How to compare.","default":"text"},"operator":{"type":"string","enum":["eq","filled","gt","gte","lt","lte","starts"],"description":"Operator."},"value":{"description":"Text, a number, or a time spec for attributeType date."},"limitToTriggerEvent":{"type":"boolean","description":"Only the order of the run's own trigger event (order triggers)."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","attribute","operator"],"x-smartemailing":"ordered-attribute","examples":[{"type":"ordered_attribute","attribute":"currency","operator":"eq","value":"CZK"}]},"ConditionRule_ordered_product":{"type":"object","description":"The contact ordered a product by id (product code) or name.","properties":{"type":{"const":"ordered_product"},"productField":{"type":"string","enum":["id","name"],"description":"Field, default id.","default":"id"},"operator":{"type":"string","enum":["eq","starts","contains"],"description":"Operator."},"value":{"type":"string","description":"Text."},"limitToTriggerEvent":{"type":"boolean","description":"Only the order of the run's own trigger event (order triggers)."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","value"],"x-smartemailing":"ordered-product","examples":[{"type":"ordered_product","productField":"id","operator":"eq","value":"SKU-001"}]},"ConditionRule_ordered_product_by_attribute":{"type":"object","description":"The contact ordered a product with a feed attribute.","properties":{"type":{"const":"ordered_product_by_attribute"},"attribute":{"type":"string","description":"Attribute name: letters, digits and _ . : - (at most 60)."},"attributeType":{"type":"string","enum":["text","date","number"],"description":"How to compare.","default":"text"},"operator":{"type":"string","enum":["eq","filled","gt","gte","lt","lte","starts"],"description":"Operator."},"value":{"description":"Text, a number, or a time spec for attributeType date."},"limitToTriggerEvent":{"type":"boolean","description":"Only the order of the run's own trigger event (order triggers)."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","attribute","operator"],"x-smartemailing":"ordered-product-by-attribute","examples":[{"type":"ordered_product_by_attribute","attribute":"brand","operator":"eq","value":"Example"}]},"ConditionRule_ordered_since_entry":{"type":"object","description":"The contact ordered since the run entered. Run only. (not allowed in trigger filters (needs a run))","properties":{"type":{"const":"ordered_since_entry"},"operator":{"type":"string","enum":["yes","no"],"description":"Operator."},"shopId":{"type":["string","null"]},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator"],"x-smartemailing":null,"examples":[{"type":"ordered_since_entry","operator":"yes","shopId":null}]},"ConditionRule_orders_count":{"type":"object","description":"Number of orders.","properties":{"type":{"const":"orders_count"},"operator":{"type":"string","enum":["eq","lt","lte","gt","gte"],"description":"Operator."},"value":{"description":"Whole number."},"paid":{"type":"string","enum":["any","yes","no"],"description":"Paid filter, default any.","default":"any"},"states":{"type":"array","items":{"type":"string","enum":["received","processing","shipped","cancelled","unknown"],"description":"State."},"description":"Order states (SmartEmailing names)."},"shopId":{"type":["string","null"]},"limitToTriggerEvent":{"type":"boolean","description":"Only the order of the run's own trigger event (order triggers)."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","value"],"x-smartemailing":"orders-count","examples":[{"type":"orders_count","operator":"eq","value":1,"paid":"any"}]},"ConditionRule_orders_total_value":{"type":"object","description":"Sum (or avg, min, max) of the contact's orders with VAT in one currency.","properties":{"type":{"const":"orders_total_value"},"operator":{"type":"string","enum":["eq","lt","lte","gt","gte"],"description":"Operator."},"value":{"description":"Number."},"aggregate":{"type":"string","enum":["sum","avg","min","max"],"description":"Aggregate, default sum.","default":"sum"},"currency":{"type":"string","description":"Currency of a shop of the company (CZK, EUR)."},"shopId":{"type":["string","null"]},"limitToTriggerEvent":{"type":"boolean","description":"Only the order of the run's own trigger event (order triggers)."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","value","currency"],"x-smartemailing":"orders-total-value","examples":[{"type":"orders_total_value","operator":"gte","value":"3000","currency":"CZK"}]},"ConditionRule_passed_node":{"type":"object","description":"This run went (or did not go) through a node. Run only. (not allowed in trigger filters (needs a run))","properties":{"type":{"const":"passed_node"},"operator":{"type":"string","enum":["passed","not_passed"],"description":"Operator."},"nodeId":{"type":"string","description":"Node key."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","nodeId"],"x-smartemailing":null},"ConditionRule_promo_code":{"type":"object","description":"The contact got (assigned) or used a coupon of a stack.","properties":{"type":{"const":"promo_code"},"state":{"type":"string","enum":["assigned","used"],"description":"State."},"stackId":{"type":"string","description":"Coupon stack id."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","state","stackId"],"x-smartemailing":"promo-code","examples":[{"type":"promo_code","state":"used","stackId":"81"}]},"ConditionRule_score":{"type":"object","description":"Not available yet: Poštárna has no scoring data. Saving a graph with it reports \"unavailable\".","properties":{"type":{"const":"score"}},"required":["type"],"x-available":false,"x-needs":"scoring","x-smartemailing":"score"},"ConditionRule_script":{"type":"object","description":"A Twig script; true when it prints {{ result.returnTrue() }}. Not allowed in trigger filters. (not allowed in trigger filters (needs a run))","properties":{"type":{"const":"script"},"script":{"type":"string","description":"Twig source, at most 20 000 characters."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","script"],"x-smartemailing":"script","examples":[{"type":"script","script":"{% if contact.city == 'Brno' %}{{ result.returnTrue() }}{% endif %}"}]},"ConditionRule_seen_viber":{"type":"object","description":"Not available yet: Poštárna has no viber data. Saving a graph with it reports \"unavailable\".","properties":{"type":{"const":"seen_viber"}},"required":["type"],"x-available":false,"x-needs":"viber","x-smartemailing":"seen-viber"},"ConditionRule_sent_email":{"type":"object","description":"An e-mail was sent to the contact: of one node (mode node) or of an automation (mode automation, automationId null = any).","properties":{"type":{"const":"sent_email"},"mode":{"type":"string","enum":["node","automation"],"description":"Mode."},"emailNode":{"type":"object","description":"An e-mail node: automationId null (or left out) = a send_email node of this graph, else the id of another automation of the company and its node key.","properties":{"automationId":{"type":["string","null"],"description":"Automation id, null = this one."},"nodeKey":{"type":"string","description":"Key (id) of the send_email node."}},"additionalProperties":false,"required":["nodeKey"]},"automationId":{"type":["string","null"]},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","mode"],"x-smartemailing":"sent-email","examples":[{"type":"sent_email","mode":"node","emailNode":{"automationId":"201","nodeKey":"email-1"}}]},"ConditionRule_sent_emails_count":{"type":"object","description":"Number of e-mails sent to the contact.","properties":{"type":{"const":"sent_emails_count"},"operator":{"type":"string","enum":["eq","lt","lte","gt","gte"],"description":"Operator."},"value":{"description":"Whole number 0 to 10 000 000."},"kinds":{"type":"array","items":{"type":"string","enum":["automation","campaign","transactional"],"description":"Kind."},"description":"Kinds, default automation and campaign."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","value"],"x-smartemailing":"sent-emails-count","examples":[{"type":"sent_emails_count","operator":"gte","value":3}]},"ConditionRule_sent_sms":{"type":"object","description":"Not available yet: Poštárna has no sms data. Saving a graph with it reports \"unavailable\".","properties":{"type":{"const":"sent_sms"}},"required":["type"],"x-available":false,"x-needs":"sms","x-smartemailing":"sent-sms"},"ConditionRule_tracking_url_clicked":{"type":"object","description":"The contact clicked a link in an e-mail of a node.","properties":{"type":{"const":"tracking_url_clicked"},"emailNode":{"type":"object","description":"An e-mail node: automationId null (or left out) = a send_email node of this graph, else the id of another automation of the company and its node key.","properties":{"automationId":{"type":["string","null"],"description":"Automation id, null = this one."},"nodeKey":{"type":"string","description":"Key (id) of the send_email node."}},"additionalProperties":false,"required":["nodeKey"]},"link":{"type":"string","description":"URL (at most 2 000)."},"compareParams":{"type":"boolean","description":"Compare query parameters too, default true.","default":true},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","emailNode","link"],"x-smartemailing":"tracking-url-clicked","examples":[{"type":"tracking_url_clicked","emailNode":{"automationId":"201","nodeKey":"email-1"},"link":"https://www.example.cz/akce"}]},"ConditionRule_tracking_url_clicked_any":{"type":"object","description":"The contact clicked any link of a node (emailNode null = any e-mail node of this automation).","properties":{"type":{"const":"tracking_url_clicked_any"},"emailNode":{"anyOf":[{"type":"object","description":"An e-mail node: automationId null (or left out) = a send_email node of this graph, else the id of another automation of the company and its node key.","properties":{"automationId":{"type":["string","null"],"description":"Automation id, null = this one."},"nodeKey":{"type":"string","description":"Key (id) of the send_email node."}},"additionalProperties":false,"required":["nodeKey"]},{"type":"null"}]},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type"],"x-smartemailing":"tracking-url-clicked-any","examples":[{"type":"tracking_url_clicked_any","emailNode":null}]},"ConditionRule_visited_attribute":{"type":"object","description":"A web tracking visit with an attribute.","properties":{"type":{"const":"visited_attribute"},"url":{"type":"string","description":"URL."},"urlOperator":{"type":"string","enum":["eq","starts"],"description":"Default eq.","default":"eq"},"visitType":{"type":"string","enum":["home","article","cart","product","category","search","order_done","other"],"description":"Visit type."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"attribute":{"type":"string","description":"Attribute name: letters, digits and _ . : - (at most 60)."},"attributeType":{"type":"string","enum":["text","date","number"],"description":"How to compare.","default":"text"},"value":{"description":"Text, a number, or a time spec for attributeType date."},"operator":{"type":"string","enum":["starts","gt","gte","lt","lte","eq"],"description":"Operator."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","attribute","operator"],"x-smartemailing":"visited-attribute","examples":[{"type":"visited_attribute","attribute":"category","operator":"eq","value":"Káva"}]},"ConditionRule_visited_url":{"type":"object","description":"A web tracking visit of a URL.","properties":{"type":{"const":"visited_url"},"url":{"type":"string","description":"URL."},"urlOperator":{"type":"string","enum":["eq","starts","contains"],"description":"Default eq.","default":"eq"},"visitType":{"type":"string","enum":["home","article","cart","product","category","search","order_done","other"],"description":"Visit type."},"period":{"type":"object","description":"Time window of the rule: from and to are time specs relative to now (null = unbounded).","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/TimeSpec"},{"type":"null"}]}},"additionalProperties":false},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type"],"x-smartemailing":"visited-url","examples":[{"type":"visited_url","url":"https://www.example.cz/kosik","urlOperator":"starts"}]},"EmailMetrics":{"type":"object","properties":{"sent":{"type":"number"},"delivered":{"type":"number","description":"sent - undelivered"},"undelivered":{"type":"number","description":"Hard or soft bounce (SE \"Nedoručeno\")."},"bounced":{"type":"number"},"softBounced":{"type":"number"},"opens":{"type":"number"},"uniqueOpens":{"type":"number"},"repeatedOpens":{"type":"number"},"machineOpens":{"type":"number","description":"E-mails whose pixel only a machine fetched (Apple Mail Privacy Protection, security gateways): whether a person\nread them is unknown, so they are in no open count or rate."},"clicks":{"type":"number"},"uniqueClicks":{"type":"number"},"unsubscribed":{"type":"number"},"complained":{"type":"number"},"queued":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number"},"openRate":{"type":"number"},"ctr":{"type":"number"},"ctor":{"type":"number"},"unsubscribeRate":{"type":"number"},"bounceRate":{"type":"number"},"complaintRate":{"type":"number"},"deliveryRate":{"type":"number","description":"delivered / sent"}},"required":["sent","delivered","undelivered","bounced","softBounced","opens","uniqueOpens","repeatedOpens","machineOpens","clicks","uniqueClicks","unsubscribed","complained","queued","failed","skipped","openRate","ctr","ctor","unsubscribeRate","bounceRate","complaintRate","deliveryRate"],"description":"Counts of e-mails and their events (server core/stats.py). Rates as SmartEmailing: openRate, unsubscribeRate and\ncomplaintRate over the delivered e-mails, ctr and bounceRate over the sent ones; ctor = unique clicks / unique opens.\nTest e-mails never count."},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["conflict","count_mismatch","csrf","empty_segment","expired","forbidden","method_not_allowed","not_found","not_implemented","rate_limited","recently_sent","server","suppression_locked","unauthorized","unavailable","upstream","validation"],"description":"Stable machine readable code (see the error catalog in the guides)."},"message":{"type":"string","description":"The field or the reason (technical, not for people), e.g. \"email\", \"definition.1.0.listId\", \"name\"."},"params":{"type":"object","additionalProperties":true,"description":"Details: issues of a graph, expected and actual counts, retryAfter ..."}}}},"examples":[{"error":{"code":"validation","message":"email"}},{"error":{"code":"conflict","message":"version","params":{"current":4}}}]},"GridTagsInput":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"add":{"type":"array","items":{"type":"string"}},"remove":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}},"required":["ids"],"description":"Bulk label change: add and remove, or tags = the new labels of every row."},"SegmentRule_campaign":{"type":"object","description":"Delivered / opened / clicked a campaign (not_* also matches contacts that never got it); linkUrl narrows clicks to one link.","properties":{"type":{"const":"campaign"},"operator":{"type":"string","enum":["received","not_received","opened","not_opened","clicked","not_clicked"],"description":"Operator."},"campaignId":{"type":["string","null"],"description":"Campaign id; null only with received = an e-mail of any campaign."},"linkUrl":{"type":"string","description":"clicked / not_clicked only."},"days":{"type":["string","null"],"description":"Last N days or null."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","campaignId"],"examples":[{"type":"campaign","operator":"opened","campaignId":"121","days":null}]},"SegmentRule_custom_field":{"type":"object","description":"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.","properties":{"type":{"const":"custom_field"},"fieldId":{"type":"string","description":"Custom field id (without cf:)."},"kind":{"type":"string","enum":["bool","choice","date","multi_choice","number","text"],"description":"Kind of the field type (see above)."},"operator":{"type":"string","description":"Operator for the kind."},"value":{"type":"string","description":"Value (string)."},"values":{"type":"array","items":{"type":"string"},"description":"Options (multi_choice)."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","fieldId","kind","operator"],"examples":[{"type":"custom_field","fieldId":"62","kind":"text","operator":"equals","value":"VIP"}]},"SegmentRule_engagement":{"type":"object","description":"Engagement level A (best) to E, N = new.","properties":{"type":{"const":"engagement"},"operator":{"type":"string","enum":["in","not_in"],"description":"Operator."},"values":{"type":"array","items":{"type":"string","enum":["A","B","C","D","E","N"],"description":"Level."},"description":"Levels.","minItems":1,"uniqueItems":true},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","values"],"examples":[{"type":"engagement","operator":"in","values":["A","B"]}]},"SegmentRule_field":{"type":"object","description":"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.","properties":{"type":{"const":"field"},"field":{"type":"string","enum":["email","firstName","lastName","city","company","companyId","phone","mobile","street","postalCode","note","country","status","gender","language","source","consentBasis","createdAt","lastOpenAt","lastClickAt","lastSentAt","statusAt","consentAt"],"description":"Contact field."},"operator":{"type":"string","enum":["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"],"description":"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":{"type":"string","description":"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":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","field","operator","value"],"examples":[{"type":"field","field":"lastOpenAt","operator":"in_last_days","value":"60"}]},"SegmentRule_last_order":{"type":"object","description":"The last completed order: within / older than N days, or before / after a date.","properties":{"type":{"const":"last_order"},"operator":{"type":"string","enum":["in_last_days","older_than_days","before","after"],"description":"Operator."},"value":{"type":"string","description":"Days \"1\" to \"3650\" or a date YYYY-MM-DD."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"shopId":{"type":["string","null"],"description":"Only orders of this shop (null = any)."},"currency":{"type":["string","null"],"description":"Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set)."}},"additionalProperties":false,"required":["type","operator","value"],"examples":[{"type":"last_order","operator":"older_than_days","value":"180"}]},"SegmentRule_list":{"type":"object","description":"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.","properties":{"type":{"const":"list"},"operator":{"type":"string","enum":["in","not_in","added_before","added_after","status_is","longer_than_days","shorter_than_days"],"description":"Operator."},"listId":{"type":"string","description":"List id."},"value":{"type":"string","description":"status_is: confirmed, unconfirmed, unsubscribed, removed; added_*: YYYY-MM-DD; *_than_days: days \"1\" to \"3650\"."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","listId"],"examples":[{"type":"list","operator":"in","listId":"101"}]},"SegmentRule_list_label":{"type":"object","description":"Confirmed or unconfirmed member of any list with this label.","properties":{"type":{"const":"list_label"},"operator":{"type":"string","enum":["in"],"description":"Operator."},"label":{"type":"string","description":"Label, 1 to 40."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","label"],"examples":[{"type":"list_label","operator":"in","label":"vip"}]},"SegmentRule_opens":{"type":"object","description":"Number of the contact's e-mails (campaigns and automations) with an open.","properties":{"type":{"const":"opens"},"operator":{"type":"string","enum":["eq","gt","lt","gte","lte"],"description":"Operator."},"value":{"type":"string","description":"Count \"0\" to \"100000\"."},"days":{"type":["string","null"],"description":"Only the last N days, \"1\" to \"3650\" (null = any time)."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","value"],"examples":[{"type":"opens","operator":"gte","value":"3","days":"90"}]},"SegmentRule_order_attribute":{"type":"object","description":"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.","properties":{"type":{"const":"order_attribute"},"operator":{"type":"string","enum":["is"],"description":"Operator."},"scope":{"type":"string","enum":["item","order"],"description":"item (default) or order.","default":"item"},"attribute":{"type":"string","description":"item: productCode, category, brand or any attribute name; order: status, companyId, deliveryCity, deliveryCountry, deliveryZip, deliveryCompany."},"value":{"type":"string","description":"Exact value, at most 200 characters."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"shopId":{"type":["string","null"],"description":"Only orders of this shop (null = any)."},"currency":{"type":["string","null"],"description":"Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set)."},"days":{"type":["string","null"],"description":"Only the last N days, \"1\" to \"3650\" (null = any time)."}},"additionalProperties":false,"required":["type","operator","attribute","value"],"examples":[{"type":"order_attribute","operator":"is","attribute":"brand","value":"Example"}]},"SegmentRule_order_count":{"type":"object","description":"Number of completed orders.","properties":{"type":{"const":"order_count"},"operator":{"type":"string","enum":["gte","lte","eq"],"description":"Operator."},"value":{"type":"string","description":"Count \"0\" to \"100000\"."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"shopId":{"type":["string","null"],"description":"Only orders of this shop (null = any)."},"currency":{"type":["string","null"],"description":"Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set)."},"days":{"type":["string","null"],"description":"Only the last N days, \"1\" to \"3650\" (null = any time)."}},"additionalProperties":false,"required":["type","operator","value"],"examples":[{"type":"order_count","operator":"gte","value":"2","shopId":null,"currency":null,"days":"365"}]},"SegmentRule_order_value":{"type":"object","description":"Sum of completed orders with VAT in one currency (CZK and EUR are never added up).","properties":{"type":{"const":"order_value"},"operator":{"type":"string","enum":["gte","lte"],"description":"Operator."},"amount":{"type":"string","description":"Amount, at most 2 decimals, e.g. \"1500.50\"."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"shopId":{"type":["string","null"],"description":"Only orders of this shop (null = any)."},"currency":{"type":["string","null"],"description":"Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set)."},"days":{"type":["string","null"],"description":"Only the last N days, \"1\" to \"3650\" (null = any time)."}},"additionalProperties":false,"required":["type","operator","amount","currency"],"examples":[{"type":"order_value","operator":"gte","amount":"2000","currency":"CZK","shopId":"1","days":"365"}]},"SegmentRule_product_bought":{"type":"object","description":"A completed order has an item whose name contains the text or whose product code equals it (case and diacritics ignored).","properties":{"type":{"const":"product_bought"},"operator":{"type":"string","enum":["is"],"description":"Operator."},"value":{"type":"string","description":"Part of the name or the code, at most 200."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."},"shopId":{"type":["string","null"],"description":"Only orders of this shop (null = any)."},"currency":{"type":["string","null"],"description":"Only orders in this currency (CZK or EUR; it must be the currency of shopId when both are set)."},"days":{"type":["string","null"],"description":"Only the last N days, \"1\" to \"3650\" (null = any time)."}},"additionalProperties":false,"required":["type","operator","value"],"examples":[{"type":"product_bought","operator":"is","value":"Espresso","days":"30"}]},"SegmentRule_purpose":{"type":"object","description":"A valid (not withdrawn, within its validity) consent with a purpose of processing.","properties":{"type":{"const":"purpose"},"operator":{"type":"string","enum":["has","not_has"],"description":"Operator."},"purposeId":{"type":"string","description":"Purpose id."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","purposeId"],"examples":[{"type":"purpose","operator":"has","purposeId":"51"}]},"SegmentRule_segment":{"type":"object","description":"Member of another segment of the same shop (never itself; chains at most 5 deep, no cycles).","properties":{"type":{"const":"segment"},"operator":{"type":"string","enum":["in","not_in","added_before","added_after"],"description":"Operator."},"segmentId":{"type":"string","description":"Segment id."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator","segmentId"],"examples":[{"type":"segment","operator":"not_in","segmentId":"91"}]},"SegmentRule_web_attribute":{"type":"object","description":"A page visit whose attribute matches: visitType = the page type, other names = the visit's own attributes; gt to lte compare numbers.","properties":{"type":{"const":"web_attribute"},"attribute":{"type":"string","description":"Attribute name."},"operator":{"type":"string","enum":["is","starts_with","gt","gte","lt","lte"],"description":"Operator."},"value":{"type":"string","description":"At most 200 (a number for gt to lte)."},"days":{"type":["string","null"],"description":"Only the last N days, \"1\" to \"3650\" (null = any time)."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","attribute","operator","value"],"examples":[{"type":"web_attribute","attribute":"visitType","operator":"is","value":"product"}]},"SegmentRule_web_visit":{"type":"object","description":"A page visit recorded by the shop's script or the API; any = any page.","properties":{"type":{"const":"web_visit"},"operator":{"type":"string","enum":["any","is","starts_with","contains"],"description":"Operator."},"url":{"type":"string","description":"Not with any; at most 2 000."},"days":{"type":["string","null"],"description":"Only the last N days, \"1\" to \"3650\" (null = any time)."},"negate":{"type":"boolean","description":"true = the rule must NOT hold (SmartEmailing \"Neplatí, že\")."}},"additionalProperties":false,"required":["type","operator"],"examples":[{"type":"web_visit","operator":"contains","url":"/kava/","days":"30"}]},"Sender":{"type":"object","properties":{"id":{"type":"string"},"shopId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"replyTo":{"type":"string"},"verified":{"type":"boolean","description":"Domain verified (SPF, DKIM, DMARC); only verified senders can send."},"isDefault":{"type":"boolean"}},"required":["id","shopId","name","email","replyTo","verified","isDefault"]},"TimeSpec":{"description":"A moment relative to a base moment (SmartEmailing's \"Varianta výběru času\"). The base is the moment the contact arrived at the node (or entered the scenario, countFrom scenario), or now in conditions. Days and longer keep the local wall time; months are calendar months. In waits only calendar, interval with sign \"+\" and event without the words yesterday and previous are allowed. Preview any spec with POST /automations/resolve-time.","oneOf":[{"type":"object","description":"A local calendar date and time.","properties":{"variant":{"const":"calendar"},"date":{"type":"string","description":"YYYY-MM-DD (local).","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},"time":{"type":"string","description":"HH:MM (local), default 00:00.","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"additionalProperties":false,"required":["variant","date"]},{"type":"object","description":"Base plus or minus a number of units.","properties":{"variant":{"const":"interval"},"sign":{"type":"string","enum":["+","-"],"description":"\"+\" later, \"-\" earlier (conditions only)."},"value":{"type":"integer","description":"1 to 100 000.","minimum":1,"maximum":100000},"unit":{"type":"string","enum":["minutes","hours","days","weeks","months","years"],"description":"Unit."},"time":{"type":["string","null"],"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Optional HH:MM set after the shift (days and longer)."}},"additionalProperties":false,"required":["variant","sign","value","unit"]},{"type":"object","description":"A named day: today, tomorrow, this/next/previous weekday, working day, week, month or year, or the last day of this or next month.","properties":{"variant":{"const":"event"},"word":{"type":"string","enum":["yesterday","previous","today","this","tomorrow","next","last_day_of"],"description":"Which day."},"unit":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday","workday","day","week","month","year"],"description":"With previous, this and next: a weekday, workday, day, week, month or year; with last_day_of: month."},"scope":{"type":"string","enum":["this","next"],"description":"With last_day_of: this or next month."},"time":{"type":"string","description":"HH:MM (local), required.","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"additionalProperties":false,"required":["variant","word","time"]}],"examples":[{"variant":"interval","sign":"+","value":2,"unit":"days","time":"09:00"},{"variant":"event","word":"next","unit":"monday","time":"08:00"},{"variant":"calendar","date":"2026-12-24","time":"09:00"}]}}}}