{"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":"Contacts","x-displayName":"Contacts","description":"Contacts of the company: profile fields, consent state, suppressions, custom fields, purposes of processing (consents), activities and GDPR export and erasure."},{"name":"Lists","x-displayName":"Lists","description":"Contact lists with explicit membership (manual and form lists) and the lists bound to an e-shop (read only membership)."},{"name":"Segments","x-displayName":"Segments","description":"Rule based groups of contacts of one e-shop: an AND / OR tree of conditions, evaluated live (daily) or as a snapshot (static)."},{"name":"Campaigns","x-displayName":"Campaigns","description":"One-off e-mail campaigns (newsletters): draft, audience, content, test, approve (send now or schedule), pause, resume, cancel, language variants."},{"name":"Templates","x-displayName":"Templates and content","description":"E-mail templates (HTML or the visual MJML editor), content versions, lint and spam check, footers, unsubscribe pages, saved editor elements, script templates (Twig), SMS templates, landing pages, surveys and the file manager."},{"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)."},{"name":"Forms","x-displayName":"Forms","description":"Sign-up forms (double opt-in): builder settings, embed code, history."},{"name":"Imports and exports","x-displayName":"Imports and exports","description":"CSV import of contacts (upload, preview, run) and CSV exports."},{"name":"Orders and feeds","x-displayName":"Orders, feeds and coupons","description":"Orders of the e-shops (they drive purchase triggers and conditions), order states, product and customer feeds, coupon stacks."},{"name":"Statistics","x-displayName":"Statistics","description":"E-mail statistics of campaigns and automations, dashboard, conversions."},{"name":"Sending","x-displayName":"Sending and deliverability","description":"Senders, sending domains (SPF, DKIM, DMARC), DMARC reports, sending mode."},{"name":"Account","x-displayName":"Account and settings","description":"Shops (e-shops) of the company, company data, consent settings, notifications, labels, web tracking, billing (read), SmartEmailing migration state."},{"name":"SmartEmailing v3","x-displayName":"SmartEmailing compatible API v3","description":"The same paths, envelopes and errors as SmartEmailing REST API v3 (read operations and account webhooks). HTTP Basic: member e-mail + API key."},{"name":"SmartEmailing CSV","x-displayName":"SmartEmailing compatible CSV statistics","description":"Semicolon separated CSV as SmartEmailing /api/csv: e-mail statistic ids, per-contact event details, list members."},{"name":"MCP","x-displayName":"MCP server for AI assistants","description":"Model Context Protocol over Streamable HTTP (JSON-RPC 2.0). Tools map to API v1 routes; sending, deleting and other irreversible actions need a preview and a confirm token."},{"name":"OAuth","x-displayName":"OAuth 2.1 for AI assistants","description":"Dynamic client registration, authorization code with PKCE, tokens and revocation, server metadata. Used by MCP clients; integrations use API keys instead."},{"name":"Meta","x-displayName":"This document","description":"The OpenAPI document itself."}],"x-tagGroups":[{"name":"API v1","tags":["Contacts","Lists","Segments","Campaigns","Templates","Automations","Forms","Imports and exports","Orders and feeds","Statistics","Sending","Account"]},{"name":"SmartEmailing compatible","tags":["SmartEmailing v3","SmartEmailing CSV"]},{"name":"AI assistants","tags":["MCP","OAuth"]},{"name":"Meta","tags":["Meta"]}],"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":{"/.well-known/oauth-authorization-server":{"get":{"operationId":"oauth_server_metadata","tags":["OAuth"],"summary":"Authorization server metadata (RFC 8414)","security":[],"responses":{"200":{"description":"issuer and endpoints","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/.well-known/oauth-authorization-server/mcp":{"get":{"operationId":"oauth_server_metadata_mcp","tags":["OAuth"],"summary":"Authorization server metadata (RFC 8414)","security":[],"responses":{"200":{"description":"issuer and endpoints","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"operationId":"oauth_protected_resource","tags":["OAuth"],"summary":"Protected resource metadata (RFC 9728)","security":[],"responses":{"200":{"description":"resource, authorization_servers, scopes_supported read and full","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/.well-known/oauth-protected-resource/mcp":{"get":{"operationId":"oauth_protected_resource_mcp","tags":["OAuth"],"summary":"Protected resource metadata (RFC 9728)","security":[],"responses":{"200":{"description":"resource, authorization_servers, scopes_supported read and full","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/csv/list-contacts":{"get":{"operationId":"se_csv_list_contacts","tags":["SmartEmailing CSV"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Members of a list (CSV)","parameters":[{"name":"listid","in":"query","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string","description":"CSV: id; contact_id; added; status; emailaddress"}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/csv/statistics/email/automation-email-statistic-id":{"get":{"operationId":"se_csv_automation_statistic_ids","tags":["SmartEmailing CSV"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"E-mail statistic ids of automation e-mail nodes","parameters":[],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string","description":"CSV: Automation ID; Node ID; Node label; Email statistic ID; Email id"}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/csv/statistics/email/automation-email-statistic-id/{automation_id}":{"get":{"operationId":"se_csv_automation_statistic_ids_one","tags":["SmartEmailing CSV"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"E-mail statistic ids of automation e-mail nodes of one automation","parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string","description":"CSV: Automation ID; Node ID; Node label; Email statistic ID; Email id"}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/csv/statistics/email/{kind}-detail/{sid}":{"get":{"operationId":"se_csv_email_detail","tags":["SmartEmailing CSV"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Per-contact events of an e-mail statistic id (sent, opened, clicked, bounced, unsubscribed)","parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["sent","opened","clicked","bounced","unsubscribed"]}},{"name":"sid","in":"path","required":true,"schema":{"type":"string"},"description":"c<campaign id> or a<automation id>:<node key>."},{"name":"interval_from","in":"query","schema":{"type":"string"},"description":"YYYY-MM-DD HH:MM:SS local time."},{"name":"interval_to","in":"query","schema":{"type":"string"},"description":"YYYY-MM-DD HH:MM:SS local time."}],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string","description":"CSV, one row per contact and event."}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/openapi.json":{"get":{"operationId":"openapi_document","tags":["Meta"],"security":[],"summary":"This OpenAPI document","responses":{"200":{"description":"OpenAPI 3.1 JSON (public, cacheable for an hour)","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/public/price-list":{"get":{"operationId":"price_list","summary":"Public price list (no authentication)","tags":["Account"],"description":"The active tiers and the settings of the calculator (public, as SmartEmailing's price list on its web).","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v1/tenants/{tenant}/account-webhooks":{"get":{"operationId":"account_webhooks_index","summary":"List account webhooks and their events","tags":["Account"],"description":"{items, events, silentEvents, limit}: the company's account webhooks (oldest first), the events a webhook can listen to (SmartEmailing's 11) and those accepted for compatibility that never fire yet.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountWebhooks"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"account_webhooks_create","summary":"Create an account webhook","tags":["Account"],"description":"{url, event, basicAuth?: {login, password}} -> 201 the webhook. Only what happens after the registration is sent. 400 validation url | event | basicAuth, 409 conflict url (the same address and event) | limit.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountWebhookInput"}}},"description":"Required by the server: event, url."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountWebhook"}}}},"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}/account-webhooks/{webhook_id}":{"delete":{"operationId":"account_webhooks_delete","summary":"Delete an account webhook","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"webhook_id","in":"path","required":true,"description":"Id of the webhook (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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":"account_webhooks_update","summary":"Edit, switch off or on an account webhook","tags":["Account"],"description":"{url?, event?, active?, basicAuth?}: basicAuth null removes the credentials, {login, password: ''} keeps the password. A changed event starts at the newest item; switching on again clears the errors.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"webhook_id","in":"path","required":true,"description":"Id of the webhook (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountWebhookInput"}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountWebhook"}}}},"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}/account-webhooks/{webhook_id}/test":{"post":{"operationId":"account_webhooks_test","summary":"Send a test call of an account webhook now","tags":["Account"],"description":"Sends one test call now (a fictional contact test@example.com, \"test\": true, header X-Postarna-Test: 1): {ok, status, ms, error} with error scheme | dns | address | deadline | network | status. Moves nothing.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"webhook_id","in":"path","required":true,"description":"Id of the webhook (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountWebhookTest"}}}},"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":{"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}/billing":{"get":{"operationId":"billing_overview","summary":"Tariff, usage and balance","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"billing","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingOverview"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/billing/cancel":{"get":{"operationId":"billing_cancel_check","summary":"What cancelling the tariff would mean","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"billing","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelInfo"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/billing/invoices":{"get":{"operationId":"billing_invoices","summary":"List invoices","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Status filter."},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"type","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"billing","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: currency, q, sort, status, type)","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}/billing/invoices/{invoice_id}/pdf":{"get":{"operationId":"billing_invoice_pdf","summary":"Download an invoice (PDF)","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"invoice_id","in":"path","required":true,"description":"Id of the invoice (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"billing","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"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}/billing/invoices/{invoice_id}/qr.svg":{"get":{"operationId":"billing_invoice_qr","summary":"QR payment code of an invoice (SVG)","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"invoice_id","in":"path","required":true,"description":"Id of the invoice (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"billing","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"image/svg+xml":{"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}/billing/payments":{"get":{"operationId":"billing_payments","summary":"List payments","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"}],"x-postarna-permission":{"module":"billing","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"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}/billing/profile":{"get":{"operationId":"billing_profile","summary":"Get the billing profile","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"billing","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingProfile"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/billing/quote":{"get":{"operationId":"billing_quote","summary":"Price of a tariff","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"currency","in":"query","required":false,"schema":{"type":"string"}},{"name":"period","in":"query","required":false,"schema":{"type":"string"}},{"name":"tierId","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"billing","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingQuote"}}}},"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}/campaigns":{"get":{"operationId":"campaigns_index","summary":"List campaigns","tags":["Campaigns"],"description":"Campaigns (draft, scheduled, sending, paused, completed, cancelled) with recipients and stats.\n\nContract notes (cs):\n\nParametry `q` (název nebo předmět), `status`, `shop`, `page`, `pageSize`; nejnovější první. Položka `CampaignListItem`: `{ \"id\", \"name\", \"shopId\", \"subject\", \"status\", \"recipients\", \"scheduledAt\", \"startedAt\", \"completedAt\", \"createdAt\", \"updatedAt\", \"stats\" }`.\n• `recipients` = počet příjemců zmrazený při schválení (`expected_recipients`), u konceptu null.\n• `stats` = null, dokud odesílání nezačne, jinak `{ \"sent\", \"delivered\", \"opened\", \"clicked\", \"bounced\", \"complained\", \"unsubscribed\" }`, unikátní kontakty z `events`. Platí `delivered + bounced = sent`. Podíly počítá UI: doručeno a vráceno z odeslaných, otevřeno, prokliky, stížnosti a odhlášení z doručených.","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","scheduled","sending","paused","completed","cancelled"]},"description":"Status filter."},{"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_campaigns","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignListItem"}},"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":"campaigns_create","summary":"Create a campaign (draft)","tags":["Campaigns"],"description":"Creates a campaign draft (only name and shopId are required). Then save_campaign_content, preview_campaign_audience, send_campaign_test and send_campaign.\n\nContract notes (cs):\n\nTělo `CampaignInput`: `{ \"name\", \"shopId\", \"senderId\", \"fromName\", \"subject\", \"preheader\", \"templateId\", \"audience\", \"trackOpens\"?, \"trackClicks\"?, \"utm\"?, \"headers\"?, \"timing\"?, \"plannedAt\"?, \"replyTo\"?, \"linkParams\"?, \"preferTime\"?, \"unsubscribePageId\"?, \"footerId\"? }`. `footerId` (Vybraná patička v Magic editoru, Patička emailu pod HTML editorem, migrace 0410) = publikovaná patička tenanta nebo null (400 `footerId`); koncept ze šablony bez tohoto pole převezme patičku šablony. E-mail kampaně (i testovací, náhled a online verze) končí patičkou kampaně, jinak patičkou šablony, jinak výchozí patičkou editoru, jinak standardní patičkou e-shopu. `unsubscribePageId` (SE krok 3 Odhlašovací stránka, migrace 0391) = aktivní odhlašovací stránka tenanta nebo null (400 `unsubscribePageId`); koncept vytvořený ze šablony bez tohoto pole převezme stránku šablony. Odeslaný e-mail kampaně ukáže stránku kampaně, jinak stránku šablony, jinak výchozí. Koncept smí být neúplný: povinné jsou jen `name` (1 až 150 znaků) a `shopId`. Kontroly: `senderId` = adresa odesílatele téhož e-shopu (400 `senderId`), `templateId` = šablona tenanta (400 `templateId`), `fromName` do 100, `subject` a `preheader` do 200 znaků. Server ke kampani zkopíruje `fromEmail` a `replyTo` odesílatele.\n\n`audience`: `{ \"listIds\", \"segmentIds\", \"excludeListIds\", \"excludeInactive\", \"excludeEmails\", \"onlyWithPurpose\", \"purposeIds\" }`, nejvýš 100 id v každém poli id a nejvýš 1000 adres v `excludeEmails`. Seznamy musí patřit e-shopu kampaně nebo celé firmě, segmenty e-shopu kampaně, `purposeIds` účely tenanta (jinak 400 `audience`).\n• `excludeEmails`: adresy vyloučené ručně (normalizované, bez ohledu na to, jestli jsou kontaktem).\n• `onlyWithPurpose` a `purposeIds`: jen kontakty s platným (nevzatým zpět, v platnosti) souhlasem pro některý z `purposeIds`; prázdné `purposeIds` = libovolný účel stačí.\n\n`trackOpens`, `trackClicks`: musí být boolean. `utm`: `null` nebo `{}` = vypnuto; jinak `source`, `medium` a `campaign` povinné (1 až 100 znaků), `term` a `content` nepovinné; neúplná trojice = 400 `utm`. UTM se doplní jen do odkazů na e-shop kampaně (existující parametry se nepřepíšou), ne do odkazů `/m/…` ani cizích domén. `headers`: pole `{ \"name\", \"value\" }`, `name` `X-[A-Za-z0-9][A-Za-z0-9-]{0,62}` a jedinečné bez ohledu na velikost písmen, `value` do 200 znaků na jednom řádku; 400 `headers`. `timing`: `now` | `schedule` | `later`; jiná hodnota 400 `timing`. `plannedAt`: ISO čas s zónou nebo null; 400 `plannedAt`. Průvodce 1:1 se SE (krok 1 a 3): `replyTo` = jedna z `replyToOptions` (bez ohledu na velikost písmen; `\"\"` = adresa pro odpovědi odesílatele; jiná 400 `replyTo`), schválení ji ponechá; bez `replyTo` se při změně odesílatele nebo e-shopu vezme odesílatelova. `linkParams` = trackovací parametry SE jako volné dvojice `[{ \"name\", \"value\" }]` (nejvýš 20, název `[A-Za-z0-9_.\\[\\]-]{1,64}` jedinečný bez ohledu na velikost písmen, hodnota 1 až 200 znaků na jednom řádku, smí obsahovat merge tagy); doplní se do odkazů na e-shop kampaně jako UTM (parametr, který odkaz už má, zůstane); 400 `linkParams`. `preferTime` (boolean, 400 `preferTime`) = „Ideální čas odeslání“: při startu každá zpráva počká do nejbližší celé hodiny, kdy kontakt nejčastěji otevírá (nejvýš 24 hodin), kontakty bez otevření jdou hned.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignInput"},"examples":{"send-campaign-create":{"summary":"docs/api-examples/send-campaign.json create","value":{"name":"Říjnový newsletter","shopId":"17","senderId":"17","fromName":"Example.cz","subject":"Podzimní novinky","preheader":"Nová káva a tipy na přípravu","audience":{"listIds":["44"],"segmentIds":[],"excludeListIds":[],"excludeInactive":true,"excludeEmails":[],"onlyWithPurpose":false,"purposeIds":[]}}}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-tool":"create_campaign","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetail"},"examples":{"send-campaign-create":{"summary":"docs/api-examples/send-campaign.json create","value":{"id":"151","name":"Říjnový newsletter","shopId":"17","subject":"Podzimní novinky","status":"draft","recipients":null,"scheduledAt":null,"startedAt":null,"completedAt":null,"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","stats":null,"variantGroupId":null,"variantLabel":"","variantPosition":0,"tags":[],"preheader":"Nová káva a tipy na přípravu","senderId":"17","fromName":"Example.cz","fromEmail":"info@example.cz","replyTo":"","templateId":null,"hasContent":false,"audience":{"listIds":["44"],"segmentIds":[],"excludeListIds":[],"excludeInactive":true,"excludeEmails":[],"onlyWithPurpose":false,"purposeIds":[]},"pausedReason":null,"approvedAt":null,"trackOpens":true,"trackClicks":true,"utm":null,"headers":[],"timing":"later","plannedAt":null,"linkParams":[],"preferTime":false,"replyToOptions":["info@example.cz"]}}}}}},"400":{"description":"`validation` (message: audience, footerId, preferTime, replyTo, senderId, templateId, timing, unsubscribePageId)","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}/campaigns/audience":{"post":{"operationId":"campaigns_audience","summary":"Count and explain the recipients of an audience","tags":["Campaigns"],"description":"Counts recipients of an audience without saving: matched, recipients and every excluded reason.\n\nAudienceCount of an audience for a shop: matched, recipients and one reason per left-out contact. anyShop true = the audience of a language variant (lists and segments of any shop).\n\nContract notes (cs):\n\nTělo `{ \"shopId\", \"audience\" }`. Odpověď `{ \"matched\", \"recipients\", \"excluded\": { \"not_mailable\", \"unconfirmed\", \"weak_consent\", \"exception_expired\", \"no_purpose\", \"excluded_list\", \"excluded_manual\", \"inactive\" } }`.\n• `matched` = unikátní kontakty vybraných seznamů (členství kromě `removed`) a segmentů.\n• Každý nepřijatý kontakt má jeden důvod v tomto pořadí: `unconfirmed` (stav `pending`), `not_mailable` (odhlášený, vrácený, stížnost, potlačení, nebo je ve vybraných seznamech jen jako odhlášený), `unconfirmed` (jen nepotvrzené členství), `weak_consent` (slabý souhlas, výchozí D6), `exception_expired` (zákaznická výjimka e-shopu bez dokončené objednávky tolik měsíců: slovenský e-shop 12 měsíců podle zákona, i bez nastavení, jiný e-shop vypnuto, pokud ho tenant nenastaví v `GET`/`PATCH /tenants/{t}/consent-settings`), `no_purpose` (`onlyWithPurpose` a žádný platný souhlas pro `purposeIds`), `excluded_list`, `excluded_manual` (adresa v `excludeEmails`), `inactive` (angažovanost E nebo stav vyloučen při `excludeInactive`). Platí `recipients + součet excluded = matched`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"shopId":{"type":"string"},"audience":{"$ref":"#/components/schemas/CampaignAudience"},"anyShop":{"type":"boolean"}},"required":["shopId","audience","anyShop"]},{"type":"object","properties":{"shopId":{"type":"string"},"audience":{"$ref":"#/components/schemas/CampaignAudience"}},"required":["shopId","audience"]}]},"examples":{"send-campaign-audience":{"summary":"docs/api-examples/send-campaign.json audience","value":{"shopId":"17","audience":{"listIds":["44"],"segmentIds":[],"excludeListIds":[],"excludeInactive":true,"excludeEmails":[],"onlyWithPurpose":false,"purposeIds":[]}}}}}}},"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"preview_campaign_audience","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceCount"},"examples":{"send-campaign-audience":{"summary":"docs/api-examples/send-campaign.json audience","value":{"matched":1,"recipients":1,"excluded":{"not_mailable":0,"unconfirmed":0,"weak_consent":0,"exception_expired":0,"no_purpose":0,"excluded_list":0,"excluded_manual":0,"inactive":0}}}}}}},"400":{"description":"`validation` (message: anyShop, audience)","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}/campaigns/tags":{"post":{"operationId":"campaigns_tags","summary":"Change labels of campaigns","tags":["Campaigns"],"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}/campaigns/{campaign_id}":{"delete":{"operationId":"campaigns_delete","summary":"Delete a campaign draft","tags":["Campaigns"],"description":"Deletes a draft campaign that sent nothing.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"delete_campaign","responses":{"204":{"description":"No content"},"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)","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":"campaigns_show","summary":"Get a campaign","tags":["Campaigns"],"description":"One campaign with audience, sender, tracking and state.\n\nContract notes (cs):\n\n`CampaignDetail` = položka a navíc `preheader`, `senderId`, `fromName`, `fromEmail`, `replyTo`, `templateId`, `hasContent`, `audience`, `pausedReason`, `approvedAt`, `trackOpens`, `trackClicks`, `utm`, `headers`, `timing`, `plannedAt`, `linkParams`, `preferTime`, `replyToOptions` (adresy e-shopu, které smí být „E-mail pro odpovědi“: adresy odesílatelů a jejich adresy pro odpovědi), `unsubscribePageId` (vlastní odhlašovací stránka kampaně, null = stránka šablony, jinak výchozí), `footerId` (vybraná patička kampaně, null = patička šablony, jinak výchozí).\n• `templateId` = šablona, ze které se obsah zkopíroval (jen informace; pozdější úpravy šablony kampaň nemění, po smazání šablony je null). Obsah má kampaň vlastní (`GET …/content`).\n• `hasContent` = kampaň má neprázdné HTML.\n• `pausedReason`: `manual`, `bounce_rate`, `complaint_rate`, `unsubscribe_rate` (automatická pauza jádra podle prahů `tenant.DEFAULT_SENDING.thresholds`), `recipient_drift` (při startu se počet příjemců liší od schváleného o víc než `recipient_drift_pct`, výchozí 5 %).\n• Krok „Rozšířené\": `trackOpens`, `trackClicks` (výchozí true jako v SE), `utm` = `{ \"source\", \"medium\", \"campaign\", \"term\"?, \"content\"? }` nebo null (vypnuto), `headers` = `[{ \"name\", \"value\" }]` (nejvýš 10, jméno `X-…`, `X-SES-…` a `X-Postarna-…` vyhrazené platformě). `timing` (`now` | `schedule` | `later`) a `plannedAt` jsou čas odeslání zvolený v průvodci (koncept si ho pamatuje); skutečný čas odeslání dá až `POST …/approve`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_campaign","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetail"},"examples":{"send-campaign-show":{"summary":"docs/api-examples/send-campaign.json show","value":{"id":"151","name":"Říjnový newsletter","shopId":"17","subject":"Podzimní novinky","status":"scheduled","recipients":1,"scheduledAt":"2026-10-02T07:00:00.000Z","startedAt":null,"completedAt":null,"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","stats":null,"variantGroupId":null,"variantLabel":"","variantPosition":0,"tags":[],"preheader":"Nová káva a tipy na přípravu","senderId":"17","fromName":"Example.cz","fromEmail":"info@example.cz","replyTo":"","templateId":null,"hasContent":true,"audience":{"listIds":["44"],"segmentIds":[],"excludeListIds":[],"excludeInactive":true,"excludeEmails":[],"onlyWithPurpose":false,"purposeIds":[]},"pausedReason":null,"approvedAt":"2026-10-01T08:00:00.000Z","trackOpens":true,"trackClicks":true,"utm":null,"headers":[],"timing":"later","plannedAt":null,"linkParams":[],"preferTime":false,"replyToOptions":["info@example.cz"]}}}}}},"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":"campaigns_update","summary":"Update a campaign draft","tags":["Campaigns"],"description":"Changes a draft campaign (any CampaignInput field).\n\nContract notes (cs):\n\nTělo `CampaignInput`: `{ \"name\", \"shopId\", \"senderId\", \"fromName\", \"subject\", \"preheader\", \"templateId\", \"audience\", \"trackOpens\"?, \"trackClicks\"?, \"utm\"?, \"headers\"?, \"timing\"?, \"plannedAt\"?, \"replyTo\"?, \"linkParams\"?, \"preferTime\"?, \"unsubscribePageId\"?, \"footerId\"? }`. `footerId` (Vybraná patička v Magic editoru, Patička emailu pod HTML editorem, migrace 0410) = publikovaná patička tenanta nebo null (400 `footerId`); koncept ze šablony bez tohoto pole převezme patičku šablony. E-mail kampaně (i testovací, náhled a online verze) končí patičkou kampaně, jinak patičkou šablony, jinak výchozí patičkou editoru, jinak standardní patičkou e-shopu. `unsubscribePageId` (SE krok 3 Odhlašovací stránka, migrace 0391) = aktivní odhlašovací stránka tenanta nebo null (400 `unsubscribePageId`); koncept vytvořený ze šablony bez tohoto pole převezme stránku šablony. Odeslaný e-mail kampaně ukáže stránku kampaně, jinak stránku šablony, jinak výchozí. Koncept smí být neúplný: povinné jsou jen `name` (1 až 150 znaků) a `shopId`. Kontroly: `senderId` = adresa odesílatele téhož e-shopu (400 `senderId`), `templateId` = šablona tenanta (400 `templateId`), `fromName` do 100, `subject` a `preheader` do 200 znaků. Server ke kampani zkopíruje `fromEmail` a `replyTo` odesílatele.\n\n`audience`: `{ \"listIds\", \"segmentIds\", \"excludeListIds\", \"excludeInactive\", \"excludeEmails\", \"onlyWithPurpose\", \"purposeIds\" }`, nejvýš 100 id v každém poli id a nejvýš 1000 adres v `excludeEmails`. Seznamy musí patřit e-shopu kampaně nebo celé firmě, segmenty e-shopu kampaně, `purposeIds` účely tenanta (jinak 400 `audience`).\n• `excludeEmails`: adresy vyloučené ručně (normalizované, bez ohledu na to, jestli jsou kontaktem).\n• `onlyWithPurpose` a `purposeIds`: jen kontakty s platným (nevzatým zpět, v platnosti) souhlasem pro některý z `purposeIds`; prázdné `purposeIds` = libovolný účel stačí.\n\n`trackOpens`, `trackClicks`: musí být boolean. `utm`: `null` nebo `{}` = vypnuto; jinak `source`, `medium` a `campaign` povinné (1 až 100 znaků), `term` a `content` nepovinné; neúplná trojice = 400 `utm`. UTM se doplní jen do odkazů na e-shop kampaně (existující parametry se nepřepíšou), ne do odkazů `/m/…` ani cizích domén. `headers`: pole `{ \"name\", \"value\" }`, `name` `X-[A-Za-z0-9][A-Za-z0-9-]{0,62}` a jedinečné bez ohledu na velikost písmen, `value` do 200 znaků na jednom řádku; 400 `headers`. `timing`: `now` | `schedule` | `later`; jiná hodnota 400 `timing`. `plannedAt`: ISO čas s zónou nebo null; 400 `plannedAt`. Průvodce 1:1 se SE (krok 1 a 3): `replyTo` = jedna z `replyToOptions` (bez ohledu na velikost písmen; `\"\"` = adresa pro odpovědi odesílatele; jiná 400 `replyTo`), schválení ji ponechá; bez `replyTo` se při změně odesílatele nebo e-shopu vezme odesílatelova. `linkParams` = trackovací parametry SE jako volné dvojice `[{ \"name\", \"value\" }]` (nejvýš 20, název `[A-Za-z0-9_.\\[\\]-]{1,64}` jedinečný bez ohledu na velikost písmen, hodnota 1 až 200 znaků na jednom řádku, smí obsahovat merge tagy); doplní se do odkazů na e-shop kampaně jako UTM (parametr, který odkaz už má, zůstane); 400 `linkParams`. `preferTime` (boolean, 400 `preferTime`) = „Ideální čas odeslání“: při startu každá zpráva počká do nejbližší celé hodiny, kdy kontakt nejčastěji otevírá (nejvýš 24 hodin), kontakty bez otevření jdou hned.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":"string"},"senderId":{"type":["string","null"],"description":"A sender address of the campaign shop; it must be verified for approval."},"fromName":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"templateId":{"type":["string","null"],"description":"Template the content was copied from; the content itself is saved with saveCampaignContent."},"audience":{"$ref":"#/components/schemas/CampaignAudience"},"trackOpens":{"type":"boolean"},"trackClicks":{"type":"boolean"},"utm":{"anyOf":[{"$ref":"#/components/schemas/CampaignUtm"},{"type":"null"}]},"headers":{"type":"array","items":{"$ref":"#/components/schemas/CampaignHeader"}},"timing":{"type":"string","enum":["now","schedule","later"]},"plannedAt":{"type":["string","null"]},"replyTo":{"type":"string","description":"One of replyToOptions; '' = the sender's own reply-to."},"linkParams":{"type":"array","items":{"$ref":"#/components/schemas/CampaignLinkParam"}},"preferTime":{"type":"boolean"},"unsubscribePageId":{"type":["string","null"],"description":"An active unsubscribe page of the tenant, null = the template's or the default; left out on a new draft made\nfrom a template = the template's page."},"footerId":{"type":["string","null"],"description":"A published footer of the tenant, null = the template's or the default; left out on a new draft made from a\ntemplate = the template's footer."}}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-tool":"update_campaign","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetail"}}}},"400":{"description":"`validation` (message: audience, footerId, preferTime, replyTo, senderId, templateId, timing, unsubscribePageId)","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)","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}/campaigns/{campaign_id}/approve":{"post":{"operationId":"campaigns_approve","summary":"Approve a campaign: send now or schedule","tags":["Campaigns"],"description":"Approves a draft campaign and sends it now (sendAt null) or schedules it (sendAt ISO time, 5 minutes to 365 days ahead). The preview shows subject, sender and the exact recipient count; expectedRecipients defaults to that count.\n\nBody {sendAt: ISO time in UTC or null (now), expectedRecipients: the number the user confirmed}.\n\nContract notes (cs):\n\nTělo `{ \"sendAt\": \"2026-10-02T07:00:00.000Z\" | null, \"expectedRecipients\": 123 }`. Krok „Schválení“: UI ukáže počet a čas a uživatel je výslovně potvrdí. Kontroly v pořadí: stav `draft` (409 `status`), `subject`, `fromName`, `senderId` (ověřený odesílatel téhož e-shopu), `content` (bez obsahu nejde odeslat), `lint` (kontrola obsahu s pravidly tenanta našla chybu; UI si nálezy načte přes `POST …/content/lint`), `audience` (aspoň jeden seznam nebo segment a aspoň 1 příjemce), `sendAt` (null = hned, jinak za 5 minut až 365 dní), `expectedRecipients` (celé číslo). Když se skutečný počet liší od potvrzeného o víc než 5 % (zaokrouhleno dolů), odpověď je 409 `recipients` a kampaň zůstane konceptem; UI načte nový počet a chce nové potvrzení. Úspěch uloží `approvedAt`, `recipients` a vrátí `CampaignDetail`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveInput"},"examples":{"send-campaign-approve-stale":{"summary":"docs/api-examples/send-campaign.json approve-stale","value":{"sendAt":"2026-10-02T07:00:00.000Z","expectedRecipients":250}}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"send","x-mcp-tool":"send_campaign","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetail"},"examples":{"send-campaign-approve":{"summary":"docs/api-examples/send-campaign.json approve","value":{"id":"151","name":"Říjnový newsletter","shopId":"17","subject":"Podzimní novinky","status":"scheduled","recipients":1,"scheduledAt":"2026-10-02T07:00:00.000Z","startedAt":null,"completedAt":null,"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","stats":null,"variantGroupId":null,"variantLabel":"","variantPosition":0,"tags":[],"preheader":"Nová káva a tipy na přípravu","senderId":"17","fromName":"Example.cz","fromEmail":"info@example.cz","replyTo":"","templateId":null,"hasContent":true,"audience":{"listIds":["44"],"segmentIds":[],"excludeListIds":[],"excludeInactive":true,"excludeEmails":[],"onlyWithPurpose":false,"purposeIds":[]},"pausedReason":null,"approvedAt":"2026-10-01T08:00:00.000Z","trackOpens":true,"trackClicks":true,"utm":null,"headers":[],"timing":"later","plannedAt":null,"linkParams":[],"preferTime":false,"replyToOptions":["info@example.cz"]}}}}}},"400":{"description":"`validation` (message: sendAt)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: test_only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"send-campaign-approve-stale":{"summary":"docs/api-examples/send-campaign.json approve-stale","value":{"error":{"code":"conflict","message":"recipients","params":{"expected":250,"actual":1}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/campaigns/{campaign_id}/cancel":{"post":{"operationId":"campaigns_cancel","summary":"Cancel a scheduled or paused campaign","tags":["Campaigns"],"description":"Cancels a campaign for good (what was sent stays in the statistics).\n\nContract notes (cs):\n\nBez těla, vrací `CampaignDetail`. Obnovení po pauze `recipient_drift` přijme aktuální počet příjemců (UI na to předem upozorní). Zrušení odesílané kampaně zastaví zbytek; co odešlo, zůstane ve statistikách.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (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":"cancel_campaign","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetail"},"examples":{"send-campaign-cancel":{"summary":"docs/api-examples/send-campaign.json cancel","value":{"id":"151","name":"Říjnový newsletter","shopId":"17","subject":"Podzimní novinky","status":"cancelled","recipients":1,"scheduledAt":"2026-10-02T07:00:00.000Z","startedAt":null,"completedAt":null,"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","stats":null,"variantGroupId":null,"variantLabel":"","variantPosition":0,"tags":[],"preheader":"Nová káva a tipy na přípravu","senderId":"17","fromName":"Example.cz","fromEmail":"info@example.cz","replyTo":"","templateId":null,"hasContent":true,"audience":{"listIds":["44"],"segmentIds":[],"excludeListIds":[],"excludeInactive":true,"excludeEmails":[],"onlyWithPurpose":false,"purposeIds":[]},"pausedReason":null,"approvedAt":"2026-10-01T08:00:00.000Z","trackOpens":true,"trackClicks":true,"utm":null,"headers":[],"timing":"later","plannedAt":null,"linkParams":[],"preferTime":false,"replyToOptions":["info@example.cz"]}}}}}},"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)","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}/campaigns/{campaign_id}/content":{"get":{"operationId":"campaigns_content","summary":"Get the content of a campaign","tags":["Campaigns"],"description":"Content of a campaign (editor, html, design, version).\n\nContract notes (cs):\n\nObsah kampaně, stejná pravidla jako u šablony. Měnit jde jen koncept (409 `status`). Kampaň bez obsahu vrací `version` 0 a prázdné `html`. `saveKind` a historie uložení jako u šablony.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_campaign_content","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailContent"}}}},"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"}}},"put":{"operationId":"campaigns_save_content","summary":"Save the content of a campaign draft","tags":["Campaigns"],"description":"Saves the content of a draft campaign (copy a template: get_template, then save its content here).\n\nContract notes (cs):\n\nObsah kampaně, stejná pravidla jako u šablony. Měnit jde jen koncept (409 `status`). Kampaň bez obsahu vrací `version` 0 a prázdné `html`. `saveKind` a historie uložení jako u šablony.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailContentInput"},"examples":{"send-campaign-content":{"summary":"docs/api-examples/send-campaign.json content","value":{"editor":"html","design":null,"baseVersion":0,"html":"<!doctype html><html><body><p>Dobrý den, {{df_salution|default('vážený zákazníku', true)}},</p><p>na e-shopu máme novou podzimní kávu.</p><p><a href=\"https://www.example.cz/novinky\">Prohlédnout novinky</a></p><p style=\"font-size:12px\">{{cl_company}}, {{cl_address}}. <a href=\"{{unsubscribe}}\">Odhlásit odběr</a></p></body></html>"}}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-tool":"save_campaign_content","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailContent"},"examples":{"send-campaign-content":{"summary":"docs/api-examples/send-campaign.json content","value":{"editor":"html","html":"<!doctype html><html><body><p>Dobrý den, {{df_salution|default('vážený zákazníku', true)}},</p><p>na e-shopu máme novou podzimní kávu.</p><p><a href=\"https://www.example.cz/novinky\">Prohlédnout novinky</a></p><p style=\"font-size:12px\">{{cl_company}}, {{cl_address}}. <a href=\"{{unsubscribe}}\">Odhlásit odběr</a></p></body></html>","design":null,"version":1,"updatedAt":"2026-10-01T08:00:00.000Z"}}}}}},"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}/campaigns/{campaign_id}/pause":{"post":{"operationId":"campaigns_pause","summary":"Pause a sending or scheduled campaign","tags":["Campaigns"],"description":"Pauses a scheduled or sending campaign.\n\nContract notes (cs):\n\nBez těla, vrací `CampaignDetail`. Obnovení po pauze `recipient_drift` přijme aktuální počet příjemců (UI na to předem upozorní). Zrušení odesílané kampaně zastaví zbytek; co odešlo, zůstane ve statistikách.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (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_campaign","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetail"}}}},"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)","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}/campaigns/{campaign_id}/preview":{"post":{"operationId":"campaigns_preview","summary":"Render a campaign for one contact","tags":["Campaigns"],"description":"The e-mail as one contact would get it: body {email} of a contact of the tenant; answers {subject, preheader, html} with every merge tag filled and sample links. Nothing is sent or recorded. It shows one contact's data (name, e-mail, custom fields, orders in scripts), so it needs the module contacts too (read): campaigns read alone (content manager, developer) neither reads a contact nor learns whether an address is one (review of batch 8).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]}}},"description":"Required by the server: email."},"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPreview"}}}},"400":{"description":"`validation` (message: script)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` (message: contacts)","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"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/campaigns/{campaign_id}/resume":{"post":{"operationId":"campaigns_resume","summary":"Resume a paused campaign","tags":["Campaigns"],"description":"Resumes a paused campaign (it sends again, or goes back to scheduled when its time is ahead).\n\nContract notes (cs):\n\nBez těla, vrací `CampaignDetail`. Obnovení po pauze `recipient_drift` přijme aktuální počet příjemců (UI na to předem upozorní). Zrušení odesílané kampaně zastaví zbytek; co odešlo, zůstane ve statistikách.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (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":"resume_campaign","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetail"}}}},"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)","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}/campaigns/{campaign_id}/stats":{"get":{"operationId":"campaigns_stats","summary":"Statistics of a campaign by provider and domain","tags":["Campaigns"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (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":{"type":"object","properties":{"total":{"type":"object","additionalProperties":true,"description":"Counts and rates: sent, delivered, bounces, softBounces, complaints, unsubscribes, opens, clicks, queued, failed, skipped and their rates (engine._rates in camelCase)."},"providers":{"type":"object","additionalProperties":{"type":"object","additionalProperties":true,"description":"Counts and rates: sent, delivered, bounces, softBounces, complaints, unsubscribes, opens, clicks, queued, failed, skipped and their rates (engine._rates in camelCase)."}},"domains":{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Counts and rates: sent, delivered, bounces, softBounces, complaints, unsubscribes, opens, clicks, queued, failed, skipped and their rates (engine._rates in camelCase)."}}}}}}},"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}/campaigns/{campaign_id}/test":{"post":{"operationId":"campaigns_test","summary":"Send a test e-mail of a campaign","tags":["Campaigns"],"description":"Sends a test e-mail of the campaign to the account's test addresses only (list_test_recipients).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string"}},"required":["to"]},"examples":{"send-campaign-test":{"summary":"docs/api-examples/send-campaign.json test","value":{"to":"test@example.cz"}}}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-tool":"send_campaign_test","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendResult"},"examples":{"send-campaign-test":{"summary":"docs/api-examples/send-campaign.json test","value":{"to":"test@example.cz","sentAt":"2026-10-01T08:00:00.000Z"}}}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: mail)","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}/campaigns/{campaign_id}/variants":{"get":{"operationId":"variants_index","summary":"Get the language variants of a campaign","tags":["Campaigns"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (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/CampaignVariantGroup"}}}},"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"}}},"post":{"operationId":"variants_create","summary":"Create language variants of a campaign","tags":["Campaigns"],"description":"Duplicate as variant: body {shopId, label, sourceLabel?}. Answers the new variant's id and the group.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shopId":{"type":"string"},"label":{"type":"string"},"sourceLabel":{"type":"string"}},"required":["shopId","label"]}}},"description":"Required by the server: label, shopId."},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVariantGroup"}}}},"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"}}},"put":{"operationId":"variants_arrange","summary":"Change the language variants of a campaign","tags":["Campaigns"],"description":"Order and labels of the group: body {variants: [{id, label}] in the new order, every variant once}.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["variants"]}}},"description":"Required by the server: variants."},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVariantGroup"}}}},"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}/campaigns/{campaign_id}/variants/approve":{"post":{"operationId":"variants_approve","summary":"Approve the language variants (send or schedule)","tags":["Campaigns"],"description":"One send action for every variant: body {sendAt: ISO time or null (now), expectedRecipients: {id: final}}.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantApproveInput"}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"send","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVariantGroup"}}}},"400":{"description":"`validation` (message: sendAt)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: test_only)","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}/campaigns/{campaign_id}/variants/cancel":{"post":{"operationId":"variants_cancel","summary":"Cancel the language variants","tags":["Campaigns"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVariantGroup"}}}},"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, variants)","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}/campaigns/{campaign_id}/variants/pause":{"post":{"operationId":"variants_pause","summary":"Pause the language variants","tags":["Campaigns"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVariantGroup"}}}},"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, variants)","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}/campaigns/{campaign_id}/variants/preview":{"post":{"operationId":"variants_preview","summary":"Preview the audience split of language variants","tags":["Campaigns"],"description":"Final numbers per variant: matched, recipients of its own audience, taken by an earlier variant, final.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (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/VariantPreview"}}}},"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}/campaigns/{campaign_id}/variants/resume":{"post":{"operationId":"variants_resume","summary":"Resume the language variants","tags":["Campaigns"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"x-mcp-confirm":"send","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVariantGroup"}}}},"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, variants)","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}/campaigns/{campaign_id}/variants/stats":{"get":{"operationId":"variants_stats","summary":"Statistics of the language variants","tags":["Campaigns"],"description":"Statistics per variant and combined (unique contacts: one variant per contact, so the sums add up).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (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/VariantStats"}}}},"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}/campaigns/{campaign_id}/versions":{"get":{"operationId":"campaigns_versions","summary":"List saved content versions of a campaign","tags":["Campaigns"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}},{"name":"before","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"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/ContentVersionList"}}}},"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}/campaigns/{campaign_id}/versions/{version_id}":{"get":{"operationId":"campaigns_version","summary":"Get one content version of a campaign","tags":["Campaigns"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}},{"name":"version_id","in":"path","required":true,"description":"Id of the version (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/ContentVersionDetail"}}}},"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}/company":{"get":{"operationId":"account_company","summary":"Get the company data","tags":["Account"],"description":"The company holding the account: legal name, IČO, DIČ / IČ DPH (settings Firma).\n\nContract notes (cs):\n\nFirma, která má účet: `{name, companyId, vatId}` (název, IČO, DIČ / IČ DPH). Čtení modul `settings` `read`, změna `full`. Mezery v IČO a DIČ se vypustí, DIČ velkými písmeny (nejvýš 20 písmen a číslic); 400 `validation` s názvem pole. Patičky e-mailů dál berou firmu jednotlivých e-shopů (níže).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCompany"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"account_company_update","summary":"Update the company data","tags":["Account"],"description":"Contract notes (cs):\n\nFirma, která má účet: `{name, companyId, vatId}` (název, IČO, DIČ / IČ DPH). Čtení modul `settings` `read`, změna `full`. Mezery v IČO a DIČ se vypustí, DIČ velkými písmeny (nejvýš 20 písmen a číslic); 400 `validation` s názvem pole. Patičky e-mailů dál berou firmu jednotlivých e-shopů (níže).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"companyId":{"type":"string"},"vatId":{"type":"string"}}}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCompany"}}}},"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}/consent-settings":{"get":{"operationId":"consent_settings_index","summary":"Consent settings of every shop","tags":["Account"],"description":"Customer exception (soft opt-in) months per shop.\n\nThe customer exception (soft opt-in) of every e-shop: a Slovak shop follows the law's own 12 months unless the tenant sets its own number for it (`months`); any other shop is off unless the tenant turns it on.\n\nContract notes (cs):\n\nZákaznická výjimka (soft opt-in) každého e-shopu: kolik měsíců po poslední dokončené objednávce kontaktu může e-shop ještě posílat obchodní sdělení bez jiného právního důvodu (modul `settings`: čtení GET, plný přístup PATCH). `{ \"items\": [ { \"shopId\": \"12\", \"code\": \"sk\", \"language\": \"sk\", \"months\": 12, \"isDefault\": true } ] }`. `months` je účinná hodnota (`null` = vypnuto); `isDefault` `true` = platí zákonná výchozí hodnota e-shopu (slovenský e-shop 12 měsíců podle zákona č. 452/2021 Z. z. § 116 odst. 16, jiný e-shop vypnuto), `false` = tenant si nastavil vlastní počet (i výslovnou nulu). PATCH tělo `{ \"months\": 6 }` (celé číslo 0 až 120, 0 = výslovně vypnuto) nebo `{ \"months\": null }` (vrátí e-shopu jeho zákonnou výchozí hodnotu); jiná hodnota nebo neznámý e-shop = 400 `validation` s `months`, e-shop jiného tenanta 404.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_consent_settings","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConsentSettings"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/consent-settings/{shop_id}":{"patch":{"operationId":"consent_settings_update","summary":"Update the customer exception of a shop","tags":["Account"],"description":"Sets the customer exception months of a shop (0 to 120, 0 = off, null = legal default).\n\nContract notes (cs):\n\nZákaznická výjimka (soft opt-in) každého e-shopu: kolik měsíců po poslední dokončené objednávce kontaktu může e-shop ještě posílat obchodní sdělení bez jiného právního důvodu (modul `settings`: čtení GET, plný přístup PATCH). `{ \"items\": [ { \"shopId\": \"12\", \"code\": \"sk\", \"language\": \"sk\", \"months\": 12, \"isDefault\": true } ] }`. `months` je účinná hodnota (`null` = vypnuto); `isDefault` `true` = platí zákonná výchozí hodnota e-shopu (slovenský e-shop 12 měsíců podle zákona č. 452/2021 Z. z. § 116 odst. 16, jiný e-shop vypnuto), `false` = tenant si nastavil vlastní počet (i výslovnou nulu). PATCH tělo `{ \"months\": 6 }` (celé číslo 0 až 120, 0 = výslovně vypnuto) nebo `{ \"months\": null }` (vrátí e-shopu jeho zákonnou výchozí hodnotu); jiná hodnota nebo neznámý e-shop = 400 `validation` s `months`, e-shop jiného tenanta 404.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"months":{"type":["number","null"]}},"required":["months"]}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"x-mcp-tool":"update_consent_settings","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentSettings"}}}},"400":{"description":"`validation` (message: months)","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"}}}},"/api/v1/tenants/{tenant}/contacts":{"get":{"operationId":"contacts_list","summary":"List contacts (search, filters, paging)","tags":["Contacts"],"description":"Searches contacts. Filters: q (e-mail, name or #id), tab (all, bounced, no_list, blacklisted, complained), status (pending, subscribed, unsubscribed, bounced, complained), engagement (A to E, N), shop. Paged, newest first.\n\nContract notes (cs):\n\nParametry (všechny volitelné):\n• `q`: e-mail, jméno, příjmení nebo `#id`; bez ohledu na velká písmena a diakritiku, více slov = všechna musí sedět.\n• `tab`: `all` (výchozí), `bounced`, `no_list`, `blacklisted`, `complained`.\n• `status`: `pending`, `subscribed`, `unsubscribed`, `bounced`, `complained` (hodnoty `contacts.status`).\n• `engagement`: `A` až `E`, `N`.\n• `shop`: id e-shopu tenanta (hlavní e-shop kontaktu `contacts.shop_id`); bez parametru = všechny e-shopy. E-shop jiného tenanta = 400.\n• `ff.<pole>.<operátor>=<hodnota>` (SE Filtry každého pole, KG-05, opakovatelné, nejvýš 40): pole `id, email, firstName, lastName, createdAt, domain, titleBefore, titleAfter, vocativeFirstName, vocativeLastName, salutation, gender, company, city, street, country, postalCode, phone, mobile, language, blacklisted, hardBounce, softBounces, birthday, nameDay` a `cf_<id>`; operátor podle typu: text `contains` (bez ohledu na velikost písmen a diakritiku), číslo a datum `gte` / `lte` (datum YYYY-MM-DD, Do = celý den), výčet `in` (čárkami, `gender`: `none`, `m`, `f`), ano/ne `is` (`1` / `0`). Vlastní pole: číslo, datum a zaškrtávátko podle typu, ostatní jako text. Neznámé pole, operátor nebo hodnota = 400 `validation` / `ff.<pole>.<operátor>`.\n• `page`, `pageSize`.\nŘazení: nejnovější (nejvyšší id) první.\n\nPoložka `ContactListItem`: `{ \"id\", \"email\", \"firstName\", \"lastName\", \"status\", \"engagement\", \"shopId\", \"suppressionReason\", \"createdAt\" }`. `suppressionReason` je vyplněný, když je adresa v `suppressions` (důvody jako v DB).\n\nMapování záložek gridu na data (návrh, potvrdit s jádrem):\n\n| tab | Text v UI | Podmínka |\n|---|---|---|\n| `bounced` | Vrácené | `status = 'bounced'` |\n| `no_list` | Bez seznamu | žádný řádek v `list_memberships` |\n| `blacklisted` | Na blacklistu | adresa v `suppressions` s `reason = 'manual'` |\n| `complained` | Vyloučené | `status = 'complained'` |","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"createdFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"createdTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"schema":{"type":"string"},"description":"Engagement grade A to E or N (unknown)."},{"name":"engagementOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"schema":{"type":"string"}},{"name":"import","in":"query","required":false,"schema":{"type":"string"}},{"name":"list","in":"query","required":false,"schema":{"type":"string"}},{"name":"listOp","in":"query","required":false,"schema":{"type":"string"}},{"$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":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"sourceOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"stateOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","subscribed","unsubscribed","bounced","complained"]},"description":"Contact status."},{"name":"tab","in":"query","required":false,"schema":{"type":"string","enum":["all","bounced","no_list","blacklisted","complained"]},"description":"Tab filter."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"search_contacts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactListItem"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]},"examples":{"contacts-search":{"summary":"docs/api-examples/contacts.json search","value":{"items":[{"id":"1202","email":"jana.novakova@example.cz","firstName":"Jana","lastName":"Nováková","status":"subscribed","engagement":"N","excluded":false,"shopId":"3","suppressionReason":null,"blacklisted":false,"blacklistedAt":null,"state":"active","createdAt":"2026-10-01T08:00:00.000Z"}],"total":1,"page":1,"pageSize":25}}}}}},"400":{"description":"`validation` (message: q)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"getting-started-bad-page-size":{"summary":"docs/api-examples/getting-started.json bad-page-size","value":{"error":{"code":"validation","message":"pageSize"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"contacts_create","summary":"Create a contact","tags":["Contacts"],"description":"Creates a contact by hand (like one import row). Needs a purpose of processing and consentConfirmed true (the user confirms a documented consent). Other profile fields by their API names: titleBefore, titleAfter, mobile, companyId, street, postalCode, country, nameDay, note, salutation, salutationFormal, vocativeFirstName, vocativeLastName, affiliateId.\n\nContract notes (cs):\n\nRuční založení kontaktu (UI: „Vytvořit kontakt\"), jako jeden řádek importu. Tělo `{ \"email\", \"shopId\", \"purposeId\", \"consentConfirmed\", \"firstName\"?, \"lastName\"?, … ostatní `df_*` profilová pole nepovinně, \"customFields\"?, \"listIds\"? }`.\n• `purposeId` = účel tenanta (400 `purposeId`), `consentConfirmed` musí být `true` (400 `consentConfirmed`; na rozdíl od importu tu není opt-out režim, pole jsou vždy povinná). `listIds` jen ruční a formulářové seznamy (400 `listIds`). Adresa, která už je kontaktem, vrátí 409 `email`.\n• Nový kontakt: `source` = `manual`, `consentBasis` = `imported` (stejně jako u importu), jazyk bez vlastní hodnoty padá na jazyk e-shopu. Adresa už vrácená nebo potlačená dostane odpovídající stav (`unsubscribed` apod.) a potlačení zůstává; jinak `subscribed`.\n• Odpověď 201 `ContactDetail`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreateInput"},"examples":{"abandoned-cart-contact":{"summary":"docs/api-examples/abandoned-cart.json contact","value":{"email":"lucie.mala@example.cz","shopId":"1","purposeId":"1","consentConfirmed":true,"firstName":"Lucie","vocativeFirstName":"Lucie"}}}}},"description":"Required by the server: email, shopId."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"consent","x-mcp-tool":"create_contact","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetail"},"examples":{"abandoned-cart-contact":{"summary":"docs/api-examples/abandoned-cart.json contact","value":{"id":"1201","email":"lucie.mala@example.cz","firstName":"Lucie","lastName":"","status":"subscribed","engagement":"N","excluded":false,"shopId":"1","suppressionReason":null,"blacklisted":false,"blacklistedAt":null,"state":null,"createdAt":"2026-10-01T08:00:00.000Z","phone":"","mobile":"","titleBefore":"","titleAfter":"","salutation":"","salutationFormal":"","vocativeFirstName":"Lucie","vocativeLastName":"","gender":null,"language":"cs","company":"","companyId":"","street":"","city":"","postalCode":"","note":"","affiliateId":"","country":null,"birthday":null,"nameDay":null,"source":"manual","consentBasis":"imported","statusAt":"2026-10-01T08:00:00.000Z","consentAt":"2026-10-01T08:00:00.000Z","consentWeak":false,"softBounces":0,"lastSentAt":null,"lastOpenAt":null,"lastClickAt":null,"suppressedAt":null,"engagementAt":null,"suppressionNote":null,"customFields":{},"updatedAt":"2026-10-01T08:00:00.000Z","stats90d":{"received":0,"opened":0,"clicked":0,"bestHour":null},"lists":[],"recentActivities":[{"id":"consent-1","type":"status_change","at":"2026-10-01T08:00:00.000Z","title":"purpose_assigned"}],"orders":[],"orderTotals":[],"editedFields":[],"sources":[]}}}}}},"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}/contacts/bulk":{"post":{"operationId":"contacts_bulk_start","summary":"Start a bulk action over contacts in the background","tags":["Contacts"],"description":"SE's bulk actions of the contacts grid as a background job (core/contacts_bulk.py, KG-08): body {action: add_to_list | blacklist | delete, contactIds: [ids] (the ticked rows) or all: true (every contact matching the grid filters given as the query string of GET /contacts), listIds for add_to_list}. Contacts on the blacklist are left out. 202 {jobId, count}; the end comes as the notification contacts_bulk_done.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"createdFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"createdTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"schema":{"type":"string"}},{"name":"engagementOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"schema":{"type":"string"}},{"name":"import","in":"query","required":false,"schema":{"type":"string"}},{"name":"list","in":"query","required":false,"schema":{"type":"string"}},{"name":"listOp","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/shop"},{"$ref":"#/components/parameters/sort"},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"sourceOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"stateOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Status filter."},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactsBulkRequest"}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactsBulkStarted"}}}},"400":{"description":"`validation` (message: all, contactIds, q)","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}/contacts/duplicates":{"get":{"operationId":"contacts_duplicates","summary":"Find possible duplicate contacts","tags":["Contacts"],"description":"Possible duplicates (core/contacts.possible_duplicates): groups of contacts with the same phone or the same name and company. A report only, nothing is merged.\n\nContract notes (cs):\n\nMožné duplicity: `{ \"groups\": [ { \"kind\": \"phone\" | \"name_company\", \"contacts\": [ { \"id\", \"email\", \"firstName\", \"lastName\", \"company\", \"phone\", \"status\", \"createdAt\" } ] } ], \"truncated\" }`. Skupina = kontakty se stejným telefonem (telefon nebo mobil, posledních 9 číslic) nebo se stejným jménem, příjmením a firmou (bez diakritiky a velikosti písmen), každý s jiným e-mailem. Nejvýš 200 skupin po 20 kontaktech. Jen přehled, nic se nesloučí.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateReport"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/contacts/summary":{"get":{"operationId":"contacts_summary","summary":"Count contacts by status","tags":["Contacts"],"description":"Contract notes (cs):\n\n`{ \"total\": 240, \"byStatus\": { \"pending\": 0, \"subscribed\": 0, \"unsubscribed\": 0, \"bounced\": 0, \"complained\": 0 }, \"blacklisted\": 0 }`","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"createdFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"createdTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"schema":{"type":"string"}},{"name":"engagementOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"schema":{"type":"string"}},{"name":"list","in":"query","required":false,"schema":{"type":"string"}},{"name":"listOp","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/shop"},{"$ref":"#/components/parameters/sort"},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"sourceOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"stateOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Status filter."},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSummary"}}}},"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}/contacts/{contact_id}":{"delete":{"operationId":"contacts_delete","summary":"Delete a contact","tags":["Contacts"],"description":"Deletes a contact (its suppression stays, so it is never mailed again by mistake). For a data erasure request use erase_contact.\n\n204, 404, or 423 recently_sent: a campaign e-mail to the contact is queued or went out within 24 hours (SE's HTTP 423, core/contact_data.py RECENT_SEND).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"delete_contact","responses":{"204":{"description":"No content"},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"`recently_sent`","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":"contact_detail","summary":"Get a contact","tags":["Contacts"],"description":"Contact card: profile fields, status and consent, lists, last 90 days of e-mail activity, recent activities and orders (totals per currency).\n\nContract notes (cs):\n\n`ContactDetail` = `ContactListItem` a navíc:\n• systémová pole `df_*`: `phone`, `mobile`, `titleBefore`, `titleAfter`, `salutation`, `salutationFormal`, `vocativeFirstName`, `vocativeLastName`, `gender` (`f`, `m`, null), `language`, `company`, `companyId`, `street`, `city`, `postalCode`, `country`, `birthday` (`YYYY-MM-DD`), `nameDay` (`MM-DD`), `note`, `affiliateId`;\n• původ a souhlas: `source` (`erp_order`, `signup_form`, `import`, `api`, `manual`, `shoptet`, `smartemailing`), `consentBasis` (`soft_opt_in_customer`, `double_opt_in`, `imported`, `none` = zákazník bez souhlasu), `consentWeak`, `sources` (záznamy zdrojů `{ source, consent, consentAt, firstSeenAt, lastSeenAt }`: co o souhlasu říká každý zdroj, ze kterého kontakt přišel; platí nejpřísnější stav, odhlášení a blacklist kdekoli vyhrává), `editedFields` (pole, která upravil člověk v Poštárně; import ani synchronizace je nepřepíše), `statusAt` (čas poslední změny stavu, vždy vyplněný), `consentAt` (čas posledního souhlasu, null bez něj);\n• doručování: `softBounces`, `lastSentAt`, `lastOpenAt`, `lastClickAt`, `suppressedAt`;\n• `stats90d`: `{ \"received\", \"opened\", \"clicked\", \"bestHour\" }` za posledních 90 dní (`bestHour` 0 až 23 v zóně tenanta, null bez dat);\n• `lists`: `[ { \"listId\", \"name\", \"state\", \"changedAt\", \"listSize\" } ]`, `state` = `confirmed`, `unconfirmed`, `unsubscribed`, `removed`;\n• `recentActivities`: `[ { \"id\", \"type\", \"at\", \"title\" } ]`, nejnovější první, max 20; `type` = `sent`, `opened`, `clicked`, `unsubscribed`, `doi`, `form`, `order`, `status_change`, `note`;\n• `orders`: max 20, nejnovější první: `{ \"id\", \"shopId\", \"code\", \"status\", \"sourceStatus\", \"currency\", \"totalWithVat\", \"orderedAt\", \"paidAt\", \"items\": [ { \"name\", \"quantity\", \"priceWithVat\" } ], \"itemCount\" }`; `status` = `pending`, `completed`, `cancelled`, `other`, `items` jen první 3 položky;\n• `orderTotals`: `[ { \"currency\", \"count\", \"totalWithVat\" } ]`, jeden řádek na měnu, součet objednávek bez stornovaných. `totalWithVat` je cena s DPH tak, jak ji poslal e-shop (zda obsahuje dopravu, určí konektor; v UI zatím „Celkem s DPH“).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_contact","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetail"}}}},"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":"contacts_update","summary":"Update a contact","tags":["Contacts"],"description":"Changes profile fields and custom fields of a contact (never its e-mail, status or consent). Other profile fields by their API names: titleBefore, titleAfter, mobile, companyId, street, postalCode, country, nameDay, note, salutation, salutationFormal, vocativeFirstName, vocativeLastName, affiliateId.\n\nContract notes (cs):\n\nStejná profilová pole a `customFields` jako založení, žádné nejsou povinné; mění jen profil a vlastní pole, nikdy stav, souhlas ani adresu (`email` v těle = 400 `email`). Neznámý kontakt 404.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPatch"},"examples":{"contacts-update":{"summary":"docs/api-examples/contacts.json update","value":{"phone":"+420 600 000 000","customFields":{}}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"trigger","x-mcp-tool":"update_contact","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetail"},"examples":{"contacts-update":{"summary":"docs/api-examples/contacts.json update","value":{"id":"1202","email":"jana.novakova@example.cz","firstName":"Jana","lastName":"Nováková","status":"subscribed","engagement":"N","excluded":false,"shopId":"3","suppressionReason":null,"blacklisted":false,"blacklistedAt":null,"state":null,"createdAt":"2026-10-01T08:00:00.000Z","phone":"+420 600 000 000","mobile":"","titleBefore":"","titleAfter":"","salutation":"","salutationFormal":"","vocativeFirstName":"","vocativeLastName":"","gender":null,"language":"cs","company":"","companyId":"","street":"","city":"Brno","postalCode":"","note":"","affiliateId":"","country":null,"birthday":null,"nameDay":null,"source":"manual","consentBasis":"imported","statusAt":"2026-10-01T08:00:00.000Z","consentAt":"2026-10-01T08:00:00.000Z","consentWeak":false,"softBounces":0,"lastSentAt":null,"lastOpenAt":null,"lastClickAt":null,"suppressedAt":null,"engagementAt":null,"suppressionNote":null,"customFields":{},"updatedAt":"2026-10-01T08:00:00.000Z","stats90d":{"received":0,"opened":0,"clicked":0,"bestHour":null},"lists":[],"recentActivities":[{"id":"consent-2","type":"status_change","at":"2026-10-01T08:00:00.000Z","title":"purpose_assigned"}],"orders":[],"orderTotals":[],"editedFields":[],"sources":[]}}}}}},"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}/contacts/{contact_id}/activities":{"get":{"operationId":"contact_activities","summary":"List activities of a contact","tags":["Contacts"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"type","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactActivity"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: q, type)","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"}}},"post":{"operationId":"contact_activity_add","summary":"Add a manual activity (note) to a contact","tags":["Contacts"],"description":"Adds a note, call, deal or other activity to a contact.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomActivityInput"}}},"description":"Required by the server: kind, title."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"add_contact_activity","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactActivity"}}}},"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}/contacts/{contact_id}/automation-runs":{"get":{"operationId":"contact_automation_runs","summary":"The real journey of a contact through the automations (runs and steps)","tags":["Contacts"],"description":"The real journey of one contact through the automations (contact card, tab Automatizace): its runs, newest first, each with {automation: {id, name, status}, nodes: {key: {type, name}}} and its real steps (outcome, branch, next node, reason). Paged. 404 for a contact of another tenant.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactAutomationRun"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"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}/contacts/{contact_id}/blacklist":{"delete":{"operationId":"contact_unblacklist","summary":"Remove a contact from the blacklist","tags":["Contacts"],"description":"Takes the contact off the blacklist (it stays unsubscribed until it subscribes again).\n\nCard menu \"Odebrat z blacklistu\": 204; 404 when the contact is not on the blacklist; 409 suppression_locked when its suppression has another reason (only a confirmed double opt-in lifts those).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"unblacklist_contact","responses":{"204":{"description":"No content"},"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":"`suppression_locked`","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":"contact_blacklist","summary":"Blacklist a contact","tags":["Contacts"],"description":"Puts the contact on the blacklist (manual suppression: never mailed).\n\nCard menu \"Přidat na blacklist\" (KK-02): 201 newly added, 200 already there (the note stays); 409 suppression_locked with params.reason when the address is suppressed for another reason.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"}},"required":["note"]}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"blacklist_contact","responses":{"201":{"description":"Created (200 when it already existed or nothing changed)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlacklistResult"}}}},"200":{"description":"OK: it already existed or nothing changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlacklistResult"}}}},"400":{"description":"`validation` (message: email, note)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`suppression_locked`","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}/contacts/{contact_id}/coupons":{"get":{"operationId":"contact_coupons","summary":"List coupons given to a contact","tags":["Contacts"],"description":"The codes of one contact (tab Slevové kupóny): code, stack, status, assigned and used.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactCoupon"}}},"required":["items"]}}}},"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}/contacts/{contact_id}/erase":{"post":{"operationId":"contact_erase","summary":"Erase a contact (GDPR, irreversible)","tags":["Contacts"],"description":"Erasure on request (GDPR): erases the person and their data, keeps only a keyed hash that blocks a new import.\n\nErasure on request: the tenant's data in the request's transaction, then the consent log as the platform role (only after the tenant transaction committed). When that second step fails, the same request again finishes it (review of batch 4): the contact is gone, but its consent log rows still name the address (cd.erasure_state); a contact that was never erased here stays 404.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean"}},"required":["confirm"]}}},"description":"Required by the server: confirm."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"erase","x-mcp-tool":"erase_contact","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EraseResult"}}}},"400":{"description":"`validation` (message: confirm)","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}/contacts/{contact_id}/export":{"get":{"operationId":"contact_export","summary":"Export all data of a contact (GDPR access)","tags":["Contacts"],"description":"Everything stored about one contact (data access request), as JSON.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"export_contact_data","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"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}/contacts/{contact_id}/neighbors":{"get":{"operationId":"contact_neighbors","summary":"Previous and next contact of a filtered list","tags":["Contacts"],"description":"Contract notes (cs):\n\nStejné filtry jako seznam (bez `page` a `pageSize`). Odpověď `{ \"prevId\": \"…\" | null, \"nextId\": \"…\" | null }` pro šipky předchozí a další kontakt v detailu.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}},{"name":"createdFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"createdTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"schema":{"type":"string"}},{"name":"engagementOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"schema":{"type":"string"}},{"name":"import","in":"query","required":false,"schema":{"type":"string"}},{"name":"list","in":"query","required":false,"schema":{"type":"string"}},{"name":"listOp","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/shop"},{"$ref":"#/components/parameters/sort"},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"sourceOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"stateOp","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Status filter."},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactNeighbors"}}}},"400":{"description":"`validation` (message: 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}/contacts/{contact_id}/purposes":{"get":{"operationId":"contact_purposes","summary":"List consents (purposes) of a contact","tags":["Contacts"],"description":"Consents (purposes of processing) of a contact.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_contact_consents","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactConsent"}}},"required":["items"]}}}},"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"}}},"post":{"operationId":"contact_purpose_assign","summary":"Record a consent (purpose) of a contact","tags":["Contacts"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"validFrom":{"type":"string"},"validUntil":{"type":"string"},"purposeId":{"type":"string"}},"required":["purposeId"]}}},"description":"Required by the server: purposeId."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactConsent"}}},"required":["items"]}}}},"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}/contacts/{contact_id}/purposes/{consent_id}/withdraw":{"post":{"operationId":"contact_purpose_withdraw","summary":"Withdraw a consent of a contact","tags":["Contacts"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}},{"name":"consent_id","in":"path","required":true,"description":"Id of the consent (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"withdraw","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactConsent"}}},"required":["items"]}}}},"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)","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}/contacts/{contact_id}/segments":{"get":{"operationId":"contact_segments","summary":"List segments a contact belongs to","tags":["Contacts"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactSegment"}}},"required":["items"]}}}},"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}/contacts/{contact_id}/unsubscribe":{"post":{"operationId":"contacts_unsubscribe","summary":"Unsubscribe a contact from everything","tags":["Contacts"],"description":"Unsubscribes a contact from all e-mails, as its own unsubscribe link would (only a new double opt-in subscribes it again).\n\nUnsubscribes the contact from everything, as its own unsubscribe link would (store.unsubscribe: status unsubscribed, the address suppressed, queued e-mails skipped, the consent log). Only a new double opt-in subscribes it again. Body optional {note}: up to 500 characters for the consent log. Answers the contact detail.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contact_id","in":"path","required":true,"description":"Id of the contact (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","description":"Reason for the consent log, up to 500 characters.","maxLength":500}}},"examples":{"contacts-unsubscribe":{"summary":"docs/api-examples/contacts.json unsubscribe","value":{"note":"Požádala telefonicky"}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"unsubscribe","x-mcp-tool":"unsubscribe_contact","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetail"},"examples":{"contacts-unsubscribe":{"summary":"docs/api-examples/contacts.json unsubscribe","value":{"id":"1202","email":"jana.novakova@example.cz","firstName":"Jana","lastName":"Nováková","status":"unsubscribed","engagement":"N","excluded":false,"shopId":"3","suppressionReason":"unsubscribed","blacklisted":false,"blacklistedAt":null,"state":null,"createdAt":"2026-10-01T08:00:00.000Z","phone":"+420 600 000 000","mobile":"","titleBefore":"","titleAfter":"","salutation":"","salutationFormal":"","vocativeFirstName":"","vocativeLastName":"","gender":null,"language":"cs","company":"","companyId":"","street":"","city":"Brno","postalCode":"","note":"","affiliateId":"","country":null,"birthday":null,"nameDay":null,"source":"manual","consentBasis":"imported","statusAt":"2026-10-01T08:00:00.000Z","consentAt":"2026-10-01T08:00:00.000Z","consentWeak":false,"softBounces":0,"lastSentAt":null,"lastOpenAt":null,"lastClickAt":null,"suppressedAt":"2026-10-01T08:00:00.000Z","engagementAt":null,"suppressionNote":null,"customFields":{},"updatedAt":"2026-10-01T08:00:00.000Z","stats90d":{"received":0,"opened":0,"clicked":0,"bestHour":null},"lists":[{"listId":"41","name":"VIP zákazníci","state":"confirmed","changedAt":"2026-10-01T08:00:00.000Z","listSize":1}],"recentActivities":[{"id":"consent-4","type":"unsubscribed","at":"2026-10-01T08:00:00.000Z","title":"admin"},{"id":"consent-3","type":"status_change","at":"2026-10-01T08:00:00.000Z","title":"suppressed"},{"id":"consent-2","type":"status_change","at":"2026-10-01T08:00:00.000Z","title":"purpose_assigned"}],"orders":[],"orderTotals":[],"editedFields":[],"sources":[]}}}}}},"400":{"description":"`validation` (message: note)","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}/content/lint":{"post":{"operationId":"content_lint","summary":"Check e-mail content (merge tags, links, required parts)","tags":["Templates"],"description":"Checks e-mail content (merge tags, emoji rules, footer, size, scripts) and answers issue codes.\n\nBody {html, subject, preheader}: {issues: [{code, severity, params}]}, errors first (codes only).\n\nContract notes (cs):\n\nTělo `{ \"html\", \"subject\", \"preheader\" }`, odpověď `{ \"issues\": [ { \"code\", \"severity\", \"params\" } ] }`, chyby první. Stejná pravidla běží v UI při každé změně (`src/api/contentLint.ts`); server přidá pravidla tenanta (`forbid_emoji`, `content_rules`) a pustí je i při schválení kampaně. Kódy a texty pro lidi skládá UI (`lint.<code>` v katalozích).\n\n| code | závažnost | kdy | v jádře |\n|---|---|---|---|\n| `subject_missing` | chyba | prázdný předmět | ano (`missing_subject`) |\n| `subject_too_long` | chyba | předmět nad 200 znaků, `params.count`, `max` | nové |\n| `content_empty` | chyba | žádný viditelný text ani obrázek | nové |\n| `unknown_tag` | chyba | značka, kterou jádro nezná, `params.tags` | ano |\n| `foreign_tag` | chyba | značky jiných nástrojů (`{$x}`, `*\\|X\\|*`, `%%x%%`), `params.tags` | ano |\n| `script_tag` | chyba | dřívější kód pro skript šablony `{% … %}`; od PZ-06 se nevydává, zůstává kvůli uloženým výsledkům kontroly | ano |\n| `script_error` | chyba | skript šablony, který jádro neumí spustit (neznámý tag, funkce nebo test, chybějící `endif`), `params.line`, `params.detail` (anglicky); zjistí jen server | nové (PZ-06) |\n| `unsupported_filter` | chyba | filtr, který skripty jádra neumí (např. `{{ df_name\\|raw }}`), `params.tags` | ano |\n| `bad_fallback` | chyba | náhrada u značky, která ji nesmí mít, nebo neplatný text náhrady, `params.tags` | nové |\n| `emoji` | chyba | emoji v obsahu, předmětu nebo preheaderu, když tenant má `forbid_emoji`, `params.chars` (`U+2615`) | ano |\n| `forbidden_word` | podle pravidla | pravidlo tenanta, `params.why` = text pravidla | ano |\n| `image_placeholder` | chyba | zástupný obrázek editoru nebyl nahrazen, `params.count` | nové |\n| `image_data_uri` | chyba | obrázek vložený jako `data:` (Gmail ho nezobrazí), `params.count` | nové |\n| `banned_host` | chyba | adresa na `cdn-smartemailing.cz` nebo `via.placeholder.com` kdekoli v obsahu (obrázky, odkazy, styly), `params.hosts`; aktivní šablona ji nesmí mít vůbec | ano (F1-C) |\n| `html_too_large` | chyba | HTML nad 102 000 B (Gmail ho ořízne), `params.size`, `max` | ano (F1-C chyba, dřív upozornění) |\n| `no_unsubscribe` | upozornění | chybí `{{unsubscribe}}`; jádro doplní standardní patičku | ano |\n| `footer_incomplete` | upozornění | `{{unsubscribe}}` není adresa odkazu nebo chybí jméno odesílatele (`{{cl_sendername}}`, `{{cl_company}}`), `params.missing` (`link`, `sender`); jádro doplní standardní patičku | ano (F1-C) |\n| `subject_long` | upozornění | předmět nad 45 znaků, `params.count`, `max` | nové |\n| `img_without_alt` | upozornění | obrázek bez `alt` nebo s prázdným `alt`, `params.count` | ano (jádro zatím jen chybějící `alt`) |\n| `insecure_image` | upozornění | obrázek přes `http://`, `params.count` | ano |\n| `image_too_large` | upozornění | změřený obrázek nad 1 600 px na straně, `params.count`, `max` | nové (jen UI, server rozměry nezná) |\n| `image_foreign_host` | upozornění | obrázek z `mailjet.com`, `params.hosts` | ano |\n| `text_image_ratio` | upozornění | text tvoří méně než 70 % plochy obsahu (doporučení SE; znak = 150 px², obrázek = šířka × výška z atributů nebo stylu, bez výšky polovina šířky, bez šířky se nepočítá, sledovací pixely ne), `params.percent`, `min` | ano (F1-C) |","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LintRequest"},"examples":{"send-campaign-lint":{"summary":"docs/api-examples/send-campaign.json lint","value":{"html":"<p>Dobrý den, {{df_jmeno}}</p>","subject":"Podzimní novinky","preheader":""}}}}}},"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"x-mcp-tool":"lint_content","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/LintIssue"}}},"required":["issues"]},"examples":{"send-campaign-lint":{"summary":"docs/api-examples/send-campaign.json lint","value":{"issues":[{"code":"unknown_tag","severity":"error","params":{"tags":"{{df_jmeno}}"}},{"code":"no_unsubscribe","severity":"warning","params":{}}]}}}}}},"400":{"description":"`validation` (message: html, subject)","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}/content/spam-check":{"post":{"operationId":"content_spam_check","summary":"Antispam check of e-mail content","tags":["Templates"],"description":"Body {html, subject, preheader}: {score, verdict (ok | spam | blocked), sizeKb, rules: [{code, points, found?}]} of Poštárna's own antispam rules (core/spam_check.py, SmartEmailing's \"Antispamová kontrola: X / 5\"); found = the phrases, hosts, domains or tags a rule found.\n\nContract notes (cs):\n\nTělo `{ \"html\", \"subject\", \"preheader\"? }` → `{ \"score\", \"verdict\": \"ok\" | \"spam\" | \"blocked\", \"sizeKb\", \"rules\": [ { \"code\", \"points\", \"found\"? } ] }`. `found` = co pravidlo v obsahu našlo (fráze, zkracovače, IP adresy, domény v textu odkazu, zakázané značky HTML), nejvýše 5 položek; aplikace u každého nálezu ukáže, jak ho opravit. Vlastní pravidla Poštárny ve stylu SpamAssassinu, žádná služba třetí strany: předmět (chybí, velká písmena, vykřičníky, spamová slova, falešné RE:), spamové fráze a velká písmena v textu, podíl textu a obrázků, zkracovače a IP adresy v odkazech, text odkazu s jinou doménou, http, zakázané HTML (script, form, iframe), skrytý text, velikost; mínusové body za odhlašovací odkaz, preheader, vyvážený text a https. Skóre pod 5 = projde, 5 a víc = spam, nad 7 = většině nedoručeno. Modul `content`, čtení.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LintRequest"}}}},"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpamCheck"}}}},"400":{"description":"`validation` (message: html, subject)","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}/conversions":{"get":{"operationId":"conversions_summary","summary":"Conversions summary","tags":["Statistics"],"description":"Conversions per kind and currency, optionally of one campaign or automation and in [from, to).\n\nContract notes (cs):\n\n`campaignId`, `automationId`, `from`, `to` → `{items: [{kind, currency, orders, totalWithVat, totalWithoutVat}]}`, zvlášť po druhu a měně. Stornované a smazané objednávky se nepočítají. Konverze: poslední proklik stejného kontaktu nejvýš 5 dní před objednávkou, do 24 h přímá, potom asistovaná.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automationId","in":"query","required":false,"schema":{"type":"string"}},{"name":"campaignId","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","description":"Per kind and currency: kind, currency, orders, revenue (decimal string)."}}}}}}},"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}/coupon-stacks":{"get":{"operationId":"coupon_stacks_list","summary":"List coupon stacks","tags":["Orders and feeds"],"description":"Coupon code stacks with free, assigned and used counts.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_coupon_stacks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CouponStack"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"coupon_stacks_create","summary":"Create a coupon stack","tags":["Orders and feeds"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponStackInput"},"examples":{"name-days-stack":{"summary":"docs/api-examples/name-days.json stack","value":{"name":"Svátek","shopId":"11","mergeKey":"svatek","note":"Sleva 15 % k svátku"}}}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponStack"},"examples":{"name-days-stack":{"summary":"docs/api-examples/name-days.json stack","value":{"id":"11","name":"Svátek","shopId":"11","mergeKey":"svatek","tag":"{{coupon_svatek}}","note":"Sleva 15 % k svátku","counts":{"total":0,"free":0,"assigned":0,"used":0},"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z"}}}}}},"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}/coupon-stacks/{stack_id}":{"delete":{"operationId":"coupon_stacks_delete","summary":"Delete a coupon stack","tags":["Orders and feeds"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"stack_id","in":"path","required":true,"description":"Id of the stack (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"coupon_stacks_show","summary":"Get a coupon stack","tags":["Orders and feeds"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"stack_id","in":"path","required":true,"description":"Id of the stack (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"mergeKey":{"type":"string"},"tag":{"type":"string","description":"Merge tag of the stack: {{coupon_<mergeKey>}}"},"note":{"type":"string"},"counts":{"type":"object","properties":{"total":{"type":"integer"},"free":{"type":"integer"},"assigned":{"type":"integer"},"used":{"type":"integer"}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"description":"routes_coupons.stack_json"},"examples":{"name-days-stack-show":{"summary":"docs/api-examples/name-days.json stack-show","value":{"id":"11","name":"Svátek","shopId":"11","mergeKey":"svatek","tag":"{{coupon_svatek}}","note":"Sleva 15 % k svátku","counts":{"total":3,"free":3,"assigned":0,"used":0},"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z"}}}}}},"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}/coupon-stacks/{stack_id}/assign":{"post":{"operationId":"coupon_stacks_assign","summary":"Give a coupon of a stack to a contact","tags":["Orders and feeds"],"description":"A new code of the stack for the contact, by hand (PZ-05: every assignment is a new code): 201, 409 empty.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"stack_id","in":"path","required":true,"description":"Id of the stack (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactId":{}},"required":["contactId"]}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created (200 when it already existed or nothing changed)","content":{"application/json":{"schema":{"type":"object","properties":{"change":{"type":"string","enum":["assigned","existing"]},"coupon":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"type":"string"},"assignedAt":{"type":["string","null"]},"usedAt":{"type":["string","null"]}}}}}}}},"200":{"description":"OK: it already existed or nothing changed","content":{"application/json":{"schema":{"type":"object","properties":{"change":{"type":"string","enum":["assigned","existing"]},"coupon":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"type":"string"},"assignedAt":{"type":["string","null"]},"usedAt":{"type":["string","null"]}}}}}}}},"400":{"description":"`validation` (message: contactId)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: empty)","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}/coupon-stacks/{stack_id}/codes":{"post":{"operationId":"coupon_stacks_import","summary":"Add coupon codes to a stack","tags":["Orders and feeds"],"description":"Adds codes ({codes: [...]} or {text: \"...\"}) to the stack: {counts, stack}.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"stack_id","in":"path","required":true,"description":"Id of the stack (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},"examples":{"name-days-codes":{"summary":"docs/api-examples/name-days.json codes","value":{"text":"SVATEK-7Q2K\nSVATEK-9P4M\nSVATEK-3X8D\n"}}}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponImportResult"},"examples":{"name-days-codes":{"summary":"docs/api-examples/name-days.json codes","value":{"counts":{"added":3,"duplicate":0,"invalid":0,"total":3},"stack":{"id":"11","name":"Svátek","shopId":"11","mergeKey":"svatek","tag":"{{coupon_svatek}}","note":"Sleva 15 % k svátku","counts":{"total":3,"free":3,"assigned":0,"used":0},"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z"}}}}}}},"400":{"description":"`validation` (message: codes)","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}/coupon-stacks/{stack_id}/coupons":{"get":{"operationId":"coupon_stacks_assigned","summary":"List coupons of a stack","tags":["Orders and feeds"],"description":"Codes of the stack handed out in a period, newest first (SmartEmailing: the magnifier of a stack, data.promo.assigned): ?from= and ?to= (YYYY-MM-DD, the tenant's calendar days, both included), ?status=assigned (not used yet) | used, ?q= (a code or an address), paging. Every item names the contact and the e-mail.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"stack_id","in":"path","required":true,"description":"Id of the stack (string of digits).","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Status filter."},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StackCoupon"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: q, status, to)","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}/coupon-stacks/{stack_id}/used":{"post":{"operationId":"coupon_stacks_used","summary":"Mark coupons as used","tags":["Orders and feeds"],"description":"Marks codes the shop reports used: {marked, already, unknown, stack}.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"stack_id","in":"path","required":true,"description":"Id of the stack (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponUsedResult"}}}},"400":{"description":"`validation` (message: codes)","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}/custom-fields":{"get":{"operationId":"custom_fields_index","summary":"List custom fields","tags":["Contacts"],"description":"Custom contact fields (id, name, type, options).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_custom_fields","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"custom_fields_create","summary":"Create a custom field","tags":["Contacts"],"description":"Creates a custom contact field.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldInput"}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"create_custom_field","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"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}/custom-fields/{field_id}":{"delete":{"operationId":"custom_fields_delete","summary":"Delete a custom field","tags":["Contacts"],"description":"Deletes a custom field and its values.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"field_id","in":"path","required":true,"description":"Id of the field (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"delete_custom_field","responses":{"204":{"description":"No content"},"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":"custom_fields_update","summary":"Update a custom field","tags":["Contacts"],"description":"Renames a custom field or changes its options.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"field_id","in":"path","required":true,"description":"Id of the field (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"options":{"type":"array","items":{"type":"string"}}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"update_custom_field","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"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}/dashboard":{"get":{"operationId":"dashboard","summary":"Dashboard numbers","tags":["Statistics"],"description":"Dashboard: contacts (total, subscribed, added and lost in 30 days, daily trend) and e-mails of the last 30 days against the 30 days before.\n\nContract notes (cs):\n\n`DashboardData` (SE dashboard: Přehled účtu, poslední kontakt a e-mail, statistiky rozesílek 30 dní): `days` (30), `contacts` (`total`, `subscribed`, `added` a `lost` za 30 dní, `trend` po dnech `{date, added, lost}` = nové kontakty a adresy nově v potlačení), `lastContact` `{id, email, source, createdAt}`, `emails` (`current` a `previous` = EmailMetrics e-mailů kampaní a automatizací odeslaných za posledních 30 dní a za 30 dní před tím, `daily` `{date, sent, unsubscribed}`), `lastEmail` `{kind, campaignId, automationId, nodeKey, name, nodeName, sentAt}`. Části, které role člena nesmí číst, jsou `null` (`contacts` a `lastContact` bez modulu kontaktů, `emails` a `lastEmail` bez modulu kampaní). Bez fakturačních ukazatelů.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"x-mcp-tool":"get_dashboard","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardData"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/deliverability/dmarc":{"get":{"operationId":"deliverability_dmarc","summary":"DMARC summary","tags":["Sending"],"description":"Contract notes (cs):\n\n`DmarcSummary` za 30 dní: `domains` (`reports`, `messages`, `dmarcPass`, `dkimPass`, `spfPass`, `passRate`, `lastReport`), `sources` (odesílající IP adresy s počtem zpráv a neúspěchů, nejvýš 20), `reports` (posledních 20: `orgName`, `reportId`, `beginAt`, `endAt`, `messages`, `dmarcPass`, `receivedAt`), `complaints` (`total`, `bySource` (`ses`, `fbl`), `recent` nejvýš 20 bez adres: `at`, `source`, `kind`, `campaignId`, `automationId`, `name`). Reporty a stížnosti nahrává administrace platformy (`python -m postarna.admin deliverability-import` nebo `deliverability-fetch`), ne SPA.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DmarcSummary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/deliverability/dmarc/report":{"get":{"operationId":"deliverability_dmarc_report","summary":"DMARC report detail","tags":["Sending"],"description":"SE Statistiky › DMARC: ?from=&to= (calendar days of the tenant, both included; none = the whole history), ?domain= (sending domain id), ?reporter= (the provider's org name).\n\nContract notes (cs):\n\nSE Statistiky › DMARC: `?from=&to=` (kalendářní dny tenanta, oba včetně; bez nich celá historie, 400 `validation` / `from`, `to`), `?domain=` (id odesílací domény), `?reporter=` (org poskytovatele) → `DmarcReport`: `totals` (zprávy, prošlo DMARC, DKIM, SPF, počet reportů), `domains` (podle hlavičky From), `days` (po dnech konce reportu: reporty, zprávy, průchody), `ips` (odesílající servery s průchody a verzí IP), `ipVersions`, `reporters`, `dispositions`, `cases` (nejnovějších 200 záznamů: doména, reportér, datum, IP, DMARC / DKIM / SPF ok, naložení, počet), `reporterChoices`, `domainChoices`. DMARC prošlo = DKIM nebo SPF prošlo podle vyhodnocení poskytovatele. Země serverů zatím ne (chybí GeoIP, QUEUE).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"domain","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"reporter","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DmarcReport"}}}},"400":{"description":"`validation` (message: to)","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}/deliverability/domains":{"get":{"operationId":"deliverability_domains","summary":"List domains with their DNS state","tags":["Sending"],"description":"Contract notes (cs):\n\n`{items: SendingDomain[], suggestions: string[]}`. `SendingDomain` = `id`, `domain`, `dkimSelectors`, `spf {status, record}`, `dkim {status, records: {<selektor>: {cname, record}}}`, `dmarc {status, record}`, `issues`, `checkedAt`, `createdAt`. `suggestions` = domény odesílacích adres, které ještě nemají řádek (ani nadřazenou doménu).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomainList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"deliverability_domain_create","summary":"Add a domain","tags":["Sending"],"description":"Contract notes (cs):\n\nZaložení `{domain, dkimSelectors?}` → 201 (400 `validation` / `domain` nebo `dkimSelectors`, nejvýš 5 selektorů; 409 `conflict` / `domain`). Úprava `{dkimSelectors}` vrátí stav DKIM na `unknown`. Smazání 204 (smaže i DMARC reporty domény, DNS se nemění).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomainInput"}}},"description":"Required by the server: domain."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomain"}}}},"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}/deliverability/domains/{domain_id}":{"delete":{"operationId":"deliverability_domain_delete","summary":"Delete a domain","tags":["Sending"],"description":"Contract notes (cs):\n\nZaložení `{domain, dkimSelectors?}` → 201 (400 `validation` / `domain` nebo `dkimSelectors`, nejvýš 5 selektorů; 409 `conflict` / `domain`). Úprava `{dkimSelectors}` vrátí stav DKIM na `unknown`. Smazání 204 (smaže i DMARC reporty domény, DNS se nemění).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"domain_id","in":"path","required":true,"description":"Id of the domain (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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":"deliverability_domain_update","summary":"Update a domain","tags":["Sending"],"description":"Contract notes (cs):\n\nZaložení `{domain, dkimSelectors?}` → 201 (400 `validation` / `domain` nebo `dkimSelectors`, nejvýš 5 selektorů; 409 `conflict` / `domain`). Úprava `{dkimSelectors}` vrátí stav DKIM na `unknown`. Smazání 204 (smaže i DMARC reporty domény, DNS se nemění).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"domain_id","in":"path","required":true,"description":"Id of the domain (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dkimSelectors":{"type":"array","items":{"type":"string"}}},"required":["dkimSelectors"]}}},"description":"Required by the server: dkimSelectors."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomain"}}}},"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}/deliverability/domains/{domain_id}/check":{"post":{"operationId":"deliverability_domain_check","summary":"Check the DNS records of a domain now","tags":["Sending"],"description":"Contract notes (cs):\n\nZkontroluje SPF, DKIM (každý selektor: klíč v TXT přímo nebo přes CNAME) a DMARC (doména, jinak nadřazená doména) přes resolver serveru a vrátí `SendingDomain`. Záznam, který byl `ok` a už není, pošle výstrahu `dns_regression`. Bez resolveru 503 `unavailable` / `dns`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"domain_id","in":"path","required":true,"description":"Id of the domain (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomain"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: dns)","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}/deliverability/senders":{"get":{"operationId":"deliverability_senders","summary":"Senders with their authentication state","tags":["Sending"],"description":"Contract notes (cs):\n\n`{items: SenderAuth[]}`: `id`, `shopId`, `name`, `email`, `replyTo`, `domain`, `domainId`, `verified`, `isDefault`, `freemail`, `spf`, `dkim`, `dmarc` (stav domény adresy nebo nadřazené domény), `usableAsSender` (ověřená, ne freemail, všechny tři `ok`).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SenderAuth"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/editor-elements":{"get":{"operationId":"editor_elements_index","summary":"List saved editor elements","tags":["Templates"],"description":"{items: [{id, name, category, kind, mjml, createdAt, updatedAt}]} by category, then name.\n\nContract notes (cs):\n\n`{ \"items\": [EditorElement] }` podle kategorie a názvu.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EditorElement"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"editor_elements_create","summary":"Save an editor element","tags":["Templates"],"description":"Body {name, category?, kind, mjml}: 201 with the element; 409 conflict name (taken in the category), 400 validation limit (500 elements per tenant) or the field.\n\nContract notes (cs):\n\nTělo `{ \"name\", \"category\"?, \"kind\", \"mjml\" }` → 201 `EditorElement`. Chyby 400 `validation` s polem (`name`, `category`, `kind`, `mjml`, neznámé pole), 400 `limit` (nejvýš 500 prvků v tenantu), 409 `conflict` `name` (název v kategorii je obsazený).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorElementInput"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorElement"}}}},"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}/editor-elements/{element_id}":{"delete":{"operationId":"editor_elements_delete","summary":"Delete a saved editor element","tags":["Templates"],"description":"Contract notes (cs):\n\n`PATCH` tělo s libovolnou částí `{ \"name\", \"category\", \"mjml\" }` (`kind` se nemění, 400 `kind`) → `EditorElement`, 409 `name` jako u založení. `DELETE` 204. Neznámý prvek 404.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"element_id","in":"path","required":true,"description":"Id of the element (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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":"editor_elements_update","summary":"Update a saved editor element","tags":["Templates"],"description":"Body {name?, category?, mjml?}: the element.\n\nContract notes (cs):\n\n`PATCH` tělo s libovolnou částí `{ \"name\", \"category\", \"mjml\" }` (`kind` se nemění, 400 `kind`) → `EditorElement`, 409 `name` jako u založení. `DELETE` 204. Neznámý prvek 404.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"element_id","in":"path","required":true,"description":"Id of the element (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"category":{"type":"string"},"mjml":{"type":"string"}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorElement"}}}},"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}/export-fields":{"get":{"operationId":"export_fields","summary":"Fields an export can contain","tags":["Imports and exports"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ExportField"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/exports":{"get":{"operationId":"exports_index","summary":"List exports","tags":["Imports and exports"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"idFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"idTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Status filter."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ExportSummary"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: q, sort, status)","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":"exports_create","summary":"Start a CSV export","tags":["Imports and exports"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportInput"}}},"description":"Required by the server: name, selection."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSummary"}}}},"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}/exports/{export_id}":{"get":{"operationId":"exports_show","summary":"Get an export","tags":["Imports and exports"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"export_id","in":"path","required":true,"description":"Id of the export (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSummary"}}}},"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}/exports/{export_id}/download":{"get":{"operationId":"exports_download","summary":"Download an export (CSV)","tags":["Imports and exports"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"export_id","in":"path","required":true,"description":"Id of the export (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"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"}}}},"409":{"description":"`conflict` (message: status)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"`expired` (message: export)","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}/feed-articles":{"get":{"operationId":"feed_articles_search","summary":"Search articles of the article feeds","tags":["Orders and feeds"],"description":"Articles of the article feeds (kind articles, migration 0130) for the editor's element Články FEED: ?shopId=, ?feedId=, ?q= (title or perex contains, accents ignored), ?ids= (comma separated article ids, at most 100, also articles no longer in their feed), ?limit= 1 to 60 (default 24), ?offset=. {items, total, feeds}.\n\nContract notes (cs):\n\nVýběr článků pro prvek Články FEED Magic editoru: články článkových feedů (`kind` `articles`, RSS 2.0 nebo Atom 1.0, migrace 0130; feed se zakládá v Nastavení › Feedy jako ostatní a stahuje se stejně). `shopId`, `feedId` (jen článkový feed tenanta, jinak 400), `q` (název nebo perex, bez diakritiky), `ids` (přesná id článků, i ty, které už ve feedu nejsou), `limit` 1 až 60, `offset` → `{ \"items\": [ { \"id\", \"feedId\", \"shopId\", \"itemId\", \"title\", \"url\", \"perex\", \"imageUrl\", \"publishedAt\", \"inFeed\" } ], \"total\", \"feeds\" }`. `itemId` = `guid` / `id` článku, jinak odkaz; `perex` = prostý text popisu (nejvýš 500 znaků), `imageUrl` = obrázek z `enclosure`, `media:content` / `media:thumbnail` nebo první `<img>` popisu. Do produktového výběru (`feed-products`) se články nikdy nedostanou.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"feedId","in":"query","required":false,"schema":{"type":"string"}},{"name":"ids","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/q"},{"name":"shopId","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedArticleList"}}}},"400":{"description":"`validation` (message: feedId, ids, q)","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}/feed-products":{"get":{"operationId":"feed_products_search","summary":"Search products of the product feeds","tags":["Orders and feeds"],"description":"?shopId= (optional), ?q= (title, g:id, code or brand contains, case and accents ignored), ?ids= (comma separated g:id values, at most 100: exact matches including products no longer in their feed), ?limit= 1 to 60 (default 24), ?offset=. Answers {items, total, feeds}.\n\nContract notes (cs):\n\nVýběr produktů v Magic editoru (blok Feed a produkty). Hledá v produktech produktových feedů tenanta (`google_products`).\n• Parametry: `shopId` (nepovinně, jen feedy e-shopu; e-shop jiného tenanta 400 `shopId`), `q` (část názvu `title`, `g:id`, kódu nebo značky `g:brand`, bez ohledu na velká písmena a českou a slovenskou diakritiku; do 200 znaků), `ids` (až 100 hodnot `g:id` oddělených čárkou: přesná shoda, vrátí i produkty, které už ve feedu nejsou, `inFeed` false, aby editor obnovil vložené produkty; prázdné nebo víc než 100 = 400 `ids`), `limit` 1 až 60 (výchozí 24), `offset` (od 0). Bez `ids` jen produkty, které ve feedu jsou. Řazení: produkty ve feedu první, pak podle feedu a pořadí ve feedu.\n• Odpověď `{ \"items\": [FeedProduct], \"total\", \"feeds\": [ { \"id\", \"name\", \"shopId\", \"currency\", \"itemCount\", \"refreshedAt\", \"importedAt\", \"refreshError\" } ] }`; `feeds` = všechny produktové feedy tenanta (s `shopId` jen toho e-shopu), protože uživatel obsahu nastavení feedů nečte.\n• `FeedProduct` = `{ \"id\", \"feedId\", \"shopId\", \"itemId\", \"code\", \"name\", \"url\", \"imageUrl\", \"price\", \"regularPrice\", \"currency\", \"priceText\", \"priceCurrencyMismatch\", \"availability\", \"brand\", \"shortDescription\", \"values\", \"inFeed\", \"updatedAt\" }`: `itemId` = `g:id`, `code` = kód podle párování `se-id`, `name` = `title`, `url` = `link`, `imageUrl` = první `g:image_link`, jinak první `g:additional_image_link`, `brand` = `g:brand`, `priceText` = text `g:price`, jak je ve feedu, `shortDescription` = krátký prostý text popisu, `values` = spárované parametry feedu po formátování (Párování feedu, např. `se-product`, `se-price-vat`, vlastní názvy; chybějící pole = `''`, hodnota nejvýš 1 000 znaků): část položky feedu v editoru může ukázat kterýkoli z nich (Párovat feed, ED-19). Celý popis ani jiná velká pole se nevrací.\n• Ceny: `price` a `regularPrice` jsou čísla (nejvýš 2 desetinná místa) v měně e-shopu (`currency`, CZK nebo EUR, nikdy se nepřevádí). Je-li `g:sale_price` a dá se přečíst, `price` = akční cena a `regularPrice` = `g:price`, jinak `price` = `g:price` a `regularPrice` = `null`. Čte se „515 CZK“, „515.00 CZK“, „12,90 EUR“, „1 299 CZK“: čárka nebo tečka s 1 až 2 číslicemi na konci je desetinná, jinak oddělují tisíce (samotná tečka se 3 číslicemi je podle Google desetinná). Text bez čísla = `null`. Má-li text jinou měnu než e-shop, číslo se vrátí a `priceCurrencyMismatch` je `true`.\n• `availability`: `in_stock`, `out_of_stock`, `preorder`, `backorder` (z Google `in stock`, `out of stock`, `preorder`, `backorder` i zápisů s podtržítkem), jinak `''`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"ids","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/q"},{"name":"shopId","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedProductList"}}}},"400":{"description":"`validation` (message: ids, q)","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}/feeds":{"get":{"operationId":"feeds_list","summary":"List feeds","tags":["Orders and feeds"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"feeds_create","summary":"Create a feed","tags":["Orders and feeds"],"description":"Contract notes (cs):\n\n• `GET` vrací `{items: Feed[], defaultPairing}`.\n• `POST {name, shopId, kind?, url?, autoRefresh?, pairing?}` vrací 201 `Feed`. Duplicitní název končí 409 `conflict`.\n• `kind` (migrace 0091): `google_products` (výchozí, produktový feed Google Merchant XML, nejvýš 20 MB) nebo `shop_customers` (export zákazníků e-shopu, CSV nebo XML ze Shoptetu, nejvýš 100 MB). Druh se po založení nemění. Feed zákazníků nemá párování (`pairing` = `[]`, poslané párování = 400 `pairing` s `reason` `not_applicable`) ani náhled.\n• `Feed` má navíc `refreshReason` (kód chyby posledního stažení, `''` = bez chyby), `refreshDetected` (co dokument připomínal, `''` = nevíme) a `maxBytes` (limit druhu). Texty pro lidi skládá UI z kódů.\n• `format` (migrace 0241, jen `kind` `google_products`): `google` (výchozí, Google Merchant XML), `heureka` (Heureka.cz XML) nebo `zbozi` (Zboží.cz XML). Po založení se nemění, `Feed` ho vrací vždy (ostatní druhy `google`). Položky Heureka a Zboží si nechají své prvky a dostanou i názvy Google (`g:id` z `ITEM_ID`, `title` z `PRODUCTNAME` nebo `PRODUCT`, `link` z `URL`, `g:image_link`, `g:additional_image_link`, `g:brand`, `g:product_type`, `g:gtin`, `g:item_group_id`, `g:mpn`, `g:price` z `PRICE_VAT` s měnou e-shopu, `g:availability` z `DELIVERY_DATE`), takže párování, výběr produktů i objednávky fungují stejně. Dokument jiného formátu vrací 400 `xml` s `reason` `not_shop_xml` a `detected`. Jiný `format` = 400 `format` (`invalid`), formát u jiného druhu = 400 `format` (`not_applicable`).\n• `PATCH {name?, url?, autoRefresh?, pairing?}`. Párování musí obsahovat `se-id`. Jméno parametru jsou malá písmena, číslice a pomlčky, pole feedu `g:id`, `title` a podobně. Chyba vrací 400 s `params.reason` (`se_id_required`, `name`, `field`, `duplicate`).\n• `url` (`http://` nebo `https://`): se zapnutým `autoRefresh` ho worker stáhne jednou za 24 h a naimportuje; poslední pokus a jeho chyba jsou v `refreshedAt` a `refreshError` (`''` = naimportováno). `refreshError` má tvar `<kód>` nebo `<pole>: <kód>[: <zjištěný formát>]`, např. `too_large`, `http_404`, `xml: wrong_kind: customers_csv`.\n• Kódy (`refreshReason`, `params.reason`): `wrong_kind` (dokument je druhý druh feedu), `not_google_products`, `not_customers`, `unsupported_format` (HTML, JSON, Excel, ZIP, PDF, binární data), `too_large`, `too_many_items`, `required`, `doctype`, `invalid`, `scheme`, `address`, `dns`, `network`, `http_<status>`. Zjištěný formát (`refreshDetected`, `params.detected`): `customers_csv`, `customers_xml`, `google_products`, `heureka_xml`, `products_csv`, `orders_csv`, `orders_xml`, `csv`, `xml`, `text`, `html`, `json`, `xlsx`, `xls`, `zip`, `gzip`, `pdf`, `binary`.\n• Stažení přes limit druhu: když prvních 64 kB ukáže druhý druh feedu nebo nepodporovaný formát, uloží se tento kód místo `too_large`.\n• Změny (`POST`, `PATCH`, `DELETE`, import) zapisují audit `feed_created`, `feed_changed`, `feed_deleted`, `feed_imported` (jen id, druh, názvy polí a počty, nikdy adresa ani data). API klíč s plným přístupem smí jako dosud, klíč jen ke čtení jen `GET`.\n\n• `kind` `shop_orders` (migrace 0097): export objednávek e-shopu (Shoptet orders.csv, jeden řádek na položku), nejvýš jeden na e-shop (druhý = 409 `conflict`, `message` `shopId`), nejvýš 200 MB, bez párování a náhledu, stahuje se každou hodinu. První import je historie a nespustí žádnou automatizaci, potom jen objednávky nejvýš 2 dny staré (docs/api.md, Feed objednávek). `Feed` má `historyAt` (konec prvního importu, `null` = další import je historie) a `lastCounts` (`created`, `updated`, `unchanged`, `skipped`, `invalid`, `wrongCurrency`, `events`, `total`, `history`; `{}` před prvním). Kód chyby navíc `not_orders`.\n• `url` se v odpovědích vrací s maskovanými tajnými parametry (`hash=********9f3a`); `PATCH` s maskovanou hodnotou adresu nemění.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedInput"}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"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}/feeds/{feed_id}":{"delete":{"operationId":"feeds_delete","summary":"Delete a feed","tags":["Orders and feeds"],"description":"Contract notes (cs):\n\n• `GET` vrací `{items: Feed[], defaultPairing}`.\n• `POST {name, shopId, kind?, url?, autoRefresh?, pairing?}` vrací 201 `Feed`. Duplicitní název končí 409 `conflict`.\n• `kind` (migrace 0091): `google_products` (výchozí, produktový feed Google Merchant XML, nejvýš 20 MB) nebo `shop_customers` (export zákazníků e-shopu, CSV nebo XML ze Shoptetu, nejvýš 100 MB). Druh se po založení nemění. Feed zákazníků nemá párování (`pairing` = `[]`, poslané párování = 400 `pairing` s `reason` `not_applicable`) ani náhled.\n• `Feed` má navíc `refreshReason` (kód chyby posledního stažení, `''` = bez chyby), `refreshDetected` (co dokument připomínal, `''` = nevíme) a `maxBytes` (limit druhu). Texty pro lidi skládá UI z kódů.\n• `format` (migrace 0241, jen `kind` `google_products`): `google` (výchozí, Google Merchant XML), `heureka` (Heureka.cz XML) nebo `zbozi` (Zboží.cz XML). Po založení se nemění, `Feed` ho vrací vždy (ostatní druhy `google`). Položky Heureka a Zboží si nechají své prvky a dostanou i názvy Google (`g:id` z `ITEM_ID`, `title` z `PRODUCTNAME` nebo `PRODUCT`, `link` z `URL`, `g:image_link`, `g:additional_image_link`, `g:brand`, `g:product_type`, `g:gtin`, `g:item_group_id`, `g:mpn`, `g:price` z `PRICE_VAT` s měnou e-shopu, `g:availability` z `DELIVERY_DATE`), takže párování, výběr produktů i objednávky fungují stejně. Dokument jiného formátu vrací 400 `xml` s `reason` `not_shop_xml` a `detected`. Jiný `format` = 400 `format` (`invalid`), formát u jiného druhu = 400 `format` (`not_applicable`).\n• `PATCH {name?, url?, autoRefresh?, pairing?}`. Párování musí obsahovat `se-id`. Jméno parametru jsou malá písmena, číslice a pomlčky, pole feedu `g:id`, `title` a podobně. Chyba vrací 400 s `params.reason` (`se_id_required`, `name`, `field`, `duplicate`).\n• `url` (`http://` nebo `https://`): se zapnutým `autoRefresh` ho worker stáhne jednou za 24 h a naimportuje; poslední pokus a jeho chyba jsou v `refreshedAt` a `refreshError` (`''` = naimportováno). `refreshError` má tvar `<kód>` nebo `<pole>: <kód>[: <zjištěný formát>]`, např. `too_large`, `http_404`, `xml: wrong_kind: customers_csv`.\n• Kódy (`refreshReason`, `params.reason`): `wrong_kind` (dokument je druhý druh feedu), `not_google_products`, `not_customers`, `unsupported_format` (HTML, JSON, Excel, ZIP, PDF, binární data), `too_large`, `too_many_items`, `required`, `doctype`, `invalid`, `scheme`, `address`, `dns`, `network`, `http_<status>`. Zjištěný formát (`refreshDetected`, `params.detected`): `customers_csv`, `customers_xml`, `google_products`, `heureka_xml`, `products_csv`, `orders_csv`, `orders_xml`, `csv`, `xml`, `text`, `html`, `json`, `xlsx`, `xls`, `zip`, `gzip`, `pdf`, `binary`.\n• Stažení přes limit druhu: když prvních 64 kB ukáže druhý druh feedu nebo nepodporovaný formát, uloží se tento kód místo `too_large`.\n• Změny (`POST`, `PATCH`, `DELETE`, import) zapisují audit `feed_created`, `feed_changed`, `feed_deleted`, `feed_imported` (jen id, druh, názvy polí a počty, nikdy adresa ani data). API klíč s plným přístupem smí jako dosud, klíč jen ke čtení jen `GET`.\n\n• `kind` `shop_orders` (migrace 0097): export objednávek e-shopu (Shoptet orders.csv, jeden řádek na položku), nejvýš jeden na e-shop (druhý = 409 `conflict`, `message` `shopId`), nejvýš 200 MB, bez párování a náhledu, stahuje se každou hodinu. První import je historie a nespustí žádnou automatizaci, potom jen objednávky nejvýš 2 dny staré (docs/api.md, Feed objednávek). `Feed` má `historyAt` (konec prvního importu, `null` = další import je historie) a `lastCounts` (`created`, `updated`, `unchanged`, `skipped`, `invalid`, `wrongCurrency`, `events`, `total`, `history`; `{}` před prvním). Kód chyby navíc `not_orders`.\n• `url` se v odpovědích vrací s maskovanými tajnými parametry (`hash=********9f3a`); `PATCH` s maskovanou hodnotou adresu nemění.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"feed_id","in":"path","required":true,"description":"Id of the feed (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"feeds_show","summary":"Get a feed","tags":["Orders and feeds"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"feed_id","in":"path","required":true,"description":"Id of the feed (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"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":"feeds_update","summary":"Update a feed","tags":["Orders and feeds"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"feed_id","in":"path","required":true,"description":"Id of the feed (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["google_products","shop_customers","shop_orders","articles"]},"format":{"type":"string","enum":["google","heureka","zbozi"],"description":"Only with kind google_products; fixed once the feed exists."},"url":{"type":"string"},"autoRefresh":{"type":"boolean"},"pairing":{"type":"array","items":{"$ref":"#/components/schemas/FeedPairing"}}}}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"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}/feeds/{feed_id}/import":{"post":{"operationId":"feeds_import","summary":"Import a feed file by upload","tags":["Orders and feeds"],"description":"Imports the document in exactly one of {\"xml\": text}, {\"content\": text} or {\"contentBase64\": base64 of the file's bytes}; a refused document changes nothing (400 with the reason and the detected format).\n\nContract notes (cs):\n\nPrávě jedno z `{xml}` (text), `{content}` (text) nebo `{contentBase64}` (bajty souboru v base64, aby server poznal kódování CSV), vše do 5 MB těla požadavku → `{counts: {created, updated, unchanged, removed, skipped, total}, feed}`. Před importem se obsah očichá: dokument jiného druhu nebo formátu vrací 400 s `message` = `xml` (produktový feed) nebo `file` (feed zákazníků) a `params: {reason, detected?}`, např. `{reason: wrong_kind, detected: customers_csv}`. Dokument s DOCTYPE nebo ENTITY a rozbité XML vrací 400 (`params.reason`) a nic nemění. Produkty, které z feedu zmizely, zůstávají pro staré objednávky.\n• Feed zákazníků: záznamy se uloží do zákazníků e-shopu stejně jako z konektoru (`customers.save_customer`, podle e-shopu a externího id; opakovaný import nic nezapíše). Nikdy nevznikne kontakt, souhlas ani potlačení. Sloupce, které export nemá, si zachovají uloženou hodnotu, stejně jako příznak smazání z konektoru. `removed` je vždy 0 (export nemá náhrobky). `skipped` = záznam bez id i platné adresy nebo opakované id.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"feed_id","in":"path","required":true,"description":"Id of the feed (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"xml":{"type":"string"}},"required":["xml"]}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedImportResult"}}}},"400":{"description":"`validation` (message: content, contentBase64)","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}/feeds/{feed_id}/items":{"get":{"operationId":"feeds_items","summary":"List items of a feed","tags":["Orders and feeds"],"description":"Položky feedu (SE's product-item-list): the items of a product or article feed still in it, in feed order, ?q= (item id, code or any value, accents ignored), ?page=, ?pageSize= (at most 100). Customer and order feeds keep no items (400 validation kind). {items: [{id, itemId, code, data, values, updatedAt}], total, page, pageSize}; values are the paired parameters after their formatters (product feeds).\n\nContract notes (cs):\n\nPoložky feedu (SE product-item-list): produkty produktového feedu nebo články článkového feedu, které ve feedu jsou, v pořadí feedu. `q` (id položky, kód nebo jakákoli hodnota, bez diakritiky, do 200 znaků), `page`, `pageSize` (nejvýš 100) → `Page<{id, itemId, code, data, values, updatedAt}>`; `values` = hodnoty párování po formátovačích (u článků `{}`), `updatedAt` = poslední import položky. Feed zákazníků a objednávek položky nemá: 400 `kind` s `reason` `not_applicable`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"feed_id","in":"path","required":true,"description":"Id of the feed (string of digits).","schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedItem"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: kind, 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}/feeds/{feed_id}/preview":{"get":{"operationId":"feeds_preview","summary":"Preview a feed (first items, detected fields)","tags":["Orders and feeds"],"description":"One product of the feed (?index=, from 0) with its paired values and the field names of the feed.\n\nContract notes (cs):\n\nJen produktový feed (feed zákazníků vrací 400 `kind` s `reason` `not_applicable`). `index` (od 0) → `{index, total, item, values, fields}` pro obrazovku Párování: syrový produkt, hodnoty podle párování (po formátovačích, měna `feed` = měna e-shopu feedu) a názvy polí feedu.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"feed_id","in":"path","required":true,"description":"Id of the feed (string of digits).","schema":{"type":"string"}},{"name":"index","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedPreview"}}}},"400":{"description":"`validation` (message: kind)","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}/feeds/{feed_id}/refresh":{"post":{"operationId":"feeds_refresh","summary":"Download and process a feed now","tags":["Orders and feeds"],"description":"Queues a download of the feed's URL now (the worker runs it): {\"state\": \"queued\" | \"running\", \"feed\": ...}; 400 validation url when the feed has no URL.\n\nContract notes (cs):\n\nNačíst teď: zařadí stažení adresy feedu hned (úloha workeru; už zařazené stažení posune na teď). 202 `{state: queued | running, feed}`, feed bez adresy 400 `validation` `url` (`reason` `required`). Audit `feed_refresh_queued`. Modul nastavení, plný přístup.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"feed_id","in":"path","required":true,"description":"Id of the feed (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedRefreshResult"}}}},"400":{"description":"`validation` (message: url)","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}/file-folders":{"get":{"operationId":"file_folders_index","summary":"List folders of the file manager","tags":["Templates"],"description":"Contract notes (cs):\n\n`GET` → `{ \"items\": [FileFolder] }`. `POST` tělo `{ \"name\", \"parentId\" }` → 201 `FileFolder`. `PATCH` přejmenuje nebo přesune (`name`, `parentId`; složku nejde přesunout do sebe ani pod sebe: 400 `parentId`). `DELETE` 204, neprázdná složka 409 `not_empty`. Chyby 400 `name`, `parentId`, 409 `name`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FileFolder"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"file_folders_create","summary":"Create a folder","tags":["Templates"],"description":"Contract notes (cs):\n\n`GET` → `{ \"items\": [FileFolder] }`. `POST` tělo `{ \"name\", \"parentId\" }` → 201 `FileFolder`. `PATCH` přejmenuje nebo přesune (`name`, `parentId`; složku nejde přesunout do sebe ani pod sebe: 400 `parentId`). `DELETE` 204, neprázdná složka 409 `not_empty`. Chyby 400 `name`, `parentId`, 409 `name`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parentId":{"type":["string","null"]}},"required":["name","parentId"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileFolder"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: storage)","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}/file-folders/{folder_id}":{"delete":{"operationId":"file_folders_delete","summary":"Delete a folder","tags":["Templates"],"description":"Contract notes (cs):\n\n`GET` → `{ \"items\": [FileFolder] }`. `POST` tělo `{ \"name\", \"parentId\" }` → 201 `FileFolder`. `PATCH` přejmenuje nebo přesune (`name`, `parentId`; složku nejde přesunout do sebe ani pod sebe: 400 `parentId`). `DELETE` 204, neprázdná složka 409 `not_empty`. Chyby 400 `name`, `parentId`, 409 `name`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"folder_id","in":"path","required":true,"description":"Id of the folder (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: storage)","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":"file_folders_update","summary":"Rename a folder","tags":["Templates"],"description":"Contract notes (cs):\n\n`GET` → `{ \"items\": [FileFolder] }`. `POST` tělo `{ \"name\", \"parentId\" }` → 201 `FileFolder`. `PATCH` přejmenuje nebo přesune (`name`, `parentId`; složku nejde přesunout do sebe ani pod sebe: 400 `parentId`). `DELETE` 204, neprázdná složka 409 `not_empty`. Chyby 400 `name`, `parentId`, 409 `name`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"folder_id","in":"path","required":true,"description":"Id of the folder (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parentId":{"type":["string","null"]}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileFolder"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: storage)","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}/files":{"get":{"operationId":"files_index","summary":"List files of the file manager","tags":["Templates"],"description":"?folderId= (empty or missing = the root), ?q= (name contains, all folders), ?sort= name (default), -name, created, -created, size, -size, ?type=image (pictures only), ?recent=1 (files picked into an e-mail, newest pick first, all folders: folderId and sort are ignored), page, pageSize.\n\nContract notes (cs):\n\n`?folderId=` (prázdné = hlavní složka), `?q=` (část názvu, hledá ve všech složkách), `page`, `pageSize` → `{ \"items\": [StoredFile], \"total\", \"page\", \"pageSize\" }`. Neznámá složka 400 `folderId`.\n• `?sort=` jedno z `name` (výchozí, jako dosud), `-name`, `created`, `-created`, `size`, `-size` (`createdAt` a `-createdAt` jako u tabulek fungují taky), shody podle id. Jiná hodnota 400 `sort`.\n• `?type=image` = jen obrázky (`image/*`), jiná hodnota 400 `type`.\n• `?recent=1` = Naposledy použité v knihovně obrázků editoru: soubory s `pickedAt`, nejnovější první, ze všech složek (`folderId` a `sort` se ignorují; jde kombinovat s `type=image` a `q`), stránkování jako jinde. Jiná hodnota než `0`/`1` 400 `recent`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"folderId","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"name":"recent","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/sort"},{"name":"type","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StoredFile"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: recent, sort, type)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: storage)","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":"files_upload","summary":"Upload a file (multipart)","tags":["Templates"],"description":"multipart/form-data: file (one file), folderId (optional). 201 with the file.\n\nContract notes (cs):\n\n`multipart/form-data`: `file` (jeden soubor), nepovinně `folderId`. 201 `StoredFile`. Chyby 400 `file` (chybí nebo prázdný), `size` (nad 30 MB), `type`, `dimensions` (obrázek nad 4096 px), `name`, `folderId`; 409 `name` (stejný název ve složce); 503 `unavailable` / `storage` (úložiště není nastavené).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The file."}},"required":["file"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredFile"}}}},"400":{"description":"`validation` (message: file)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: storage)","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}/files/stock-photo":{"post":{"operationId":"files_stock_photo","summary":"Save a stock photo to the file manager","tags":["Templates"],"description":"Body {id, size?, folderId?}: the picture of the photo bank downloaded into the file manager (no hotlinking), in the root folder Fotobanka unless folderId is given; size large (1280 px, default) or web (640 px). An identical picture stored before is returned instead of a copy. 201 {file, photo: {id, pageUrl, user, userUrl}, existing}.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"size":{"type":"string","enum":["large","web"]},"folderId":{"type":["string","null"]}},"required":["id"]}}},"description":"Required by the server: id."},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPhotoSaved"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` (message: stock)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"502":{"description":"`upstream` (message: stock)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: stock, storage)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/v1/tenants/{tenant}/files/video-thumbnail":{"post":{"operationId":"files_video_thumbnail","summary":"Create a video thumbnail image","tags":["Templates"],"description":"Body {url, folderId?}: the thumbnail of a YouTube or Vimeo video as a file (core/video_thumbs.py), in the root folder Videa unless folderId is given; an identical picture already stored is returned instead. 201 {file, provider, videoId, videoUrl, title}. 400 validation url (reason unsupported) for another address, 502 upstream url (reason not_found, http_<status>, network, too_large, invalid, host) when the picture cannot be fetched.\n\nContract notes (cs):\n\nNáhled videa pro blok Video editoru (SE prvek Video: obrázek s tlačítkem přehrát, který vede na video). Tělo `{ \"url\", \"folderId\"? }`, `url` = adresa videa YouTube (`youtube.com/watch?v=`, `youtu.be/<id>`, `youtube.com/shorts/<id>`, `youtube.com/embed/<id>`) nebo Vimeo (`vimeo.com/<číslo>`, `player.vimeo.com/video/<číslo>`). Server stáhne obrázek bez klíče a bez placeného API (YouTube `i.ytimg.com/vi/<id>/maxresdefault.jpg`, když chybí `hqdefault.jpg`; Vimeo přes veřejný oEmbed `vimeo.com/api/oembed.json`), jen https, bez přesměrování, s limity správce souborů, a uloží ho jako soubor `youtube-<id>.jpg` / `vimeo-<id>.jpg` do složky `folderId`, jinak do hlavní složky `Videa` (založí ji, když chybí). Stejný obrázek, který už ve správci je (stejný obsah), se vrátí místo kopie.\nOdpověď 201 `{ \"file\": StoredFile, \"provider\": \"youtube\" | \"vimeo\", \"videoId\", \"videoUrl\", \"title\" }`, `videoUrl` = `https://www.youtube.com/watch?v=<id>` nebo `https://vimeo.com/<id>`, `title` = název z oEmbed (u YouTube `''`). Chyby: 400 `validation` `url` s `params.reason` `unsupported` (jiná adresa), 400 `folderId`, 502 `upstream` s `message` `url` a `params.reason` (`not_found`, `http_<status>`, `network`, `too_large`, `invalid`, `host`), když obrázek nejde stáhnout; 400 `dimensions` a 503 `storage` jako u nahrání. Modul `content`, plný přístup.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"folderId":{"type":["string","null"]}},"required":["url"]}}},"description":"Required by the server: url."},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoThumbnail"}}}},"400":{"description":"`validation` (message: url)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`upstream` (message: url)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: storage)","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}/files/{asset_id}":{"delete":{"operationId":"files_delete","summary":"Delete a file","tags":["Templates"],"description":"Contract notes (cs):\n\n`GET` → `StoredFileDetail`. `PATCH` tělo `{ \"name\", \"folderId\" }` (libovolná část) → `StoredFile`, adresa zůstává. `DELETE` 204: soubor zmizí i z e-mailů, které ho zobrazují.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"asset_id","in":"path","required":true,"description":"Id of the asset (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"files_show","summary":"Get a file","tags":["Templates"],"description":"The file and its uses: {templates, campaigns} whose content names its address (shown before a delete).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"asset_id","in":"path","required":true,"description":"Id of the asset (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredFileDetail"}}}},"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":"files_update","summary":"Rename or move a file","tags":["Templates"],"description":"Body {name, folderId} (any of them): the address stays the same.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"asset_id","in":"path","required":true,"description":"Id of the asset (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"folderId":{"type":["string","null"]}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredFile"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: storage)","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}/files/{asset_id}/picked":{"post":{"operationId":"files_picked","summary":"Record that a file was used","tags":["Templates"],"description":"The editor picked the file into an e-mail: picked_at = now (the library's recently used tab). The file.\n\nContract notes (cs):\n\nEditor vložil soubor do e-mailu: `pickedAt` = teď. Bez těla, odpověď `StoredFile`, neznámý soubor 404. Modul `content`, plný přístup; audit se nezapisuje (použití, ne změna souboru).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"asset_id","in":"path","required":true,"description":"Id of the asset (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredFile"}}}},"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}/footers":{"get":{"operationId":"footers_index","summary":"List footers","tags":["Templates"],"description":"?editor=visual|html (default all), ?q= part of the name, ?sort= id, name, default with '-' for descending.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"editor","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FooterSummary"}}},"required":["items"]}}}},"400":{"description":"`validation` (message: editor, sort)","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":"footers_create","summary":"Create a footer","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FooterInput"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FooterDetail"}}}},"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}/footers/{footer_id}":{"delete":{"operationId":"footers_delete","summary":"Delete a footer","tags":["Templates"],"description":"204; 409 default for the default footer.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"footers_show","summary":"Get a footer","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FooterDetail"}}}},"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":"footers_rename","summary":"Rename a footer","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FooterDetail"}}}},"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}/footers/{footer_id}/content":{"put":{"operationId":"footers_content","summary":"Save the content of a footer","tags":["Templates"],"description":"The draft as e-mail content {editor, html, design, baseVersion, saveKind}: EmailContent; 409 version.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailContentInput"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailContent"}}}},"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}/footers/{footer_id}/copy":{"post":{"operationId":"footers_copy","summary":"Copy a footer","tags":["Templates"],"description":"Kopírovat patičku: body {suffix} (the word after the name, from the client's language, default 'kopie').","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"suffix":{"type":"string"}},"required":["suffix"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FooterDetail"}}}},"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}/footers/{footer_id}/default":{"delete":{"operationId":"footers_default_off","summary":"Stop using a footer as the default","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FooterDetail"}}}},"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"}}},"post":{"operationId":"footers_default","summary":"Make a footer the default","tags":["Templates"],"description":"Nastavit jako výchozí: 409 published for a footer that was never published.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FooterDetail"}}}},"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}/footers/{footer_id}/publish":{"post":{"operationId":"footers_publish","summary":"Publish a footer","tags":["Templates"],"description":"Publikovat: 409 incomplete with {gaps: [link, sender, loop, empty]}.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FooterDetail"}}}},"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}/footers/{footer_id}/versions":{"get":{"operationId":"footers_versions","summary":"List saved versions of a footer","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}},{"name":"before","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentVersionList"}}}},"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}/footers/{footer_id}/versions/{version_id}":{"get":{"operationId":"footers_version","summary":"Get one version of a footer","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"footer_id","in":"path","required":true,"description":"Id of the footer (string of digits).","schema":{"type":"string"}},{"name":"version_id","in":"path","required":true,"description":"Id of the version (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentVersionDetail"}}}},"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}/forms":{"get":{"operationId":"forms_list","summary":"List forms","tags":["Forms"],"description":"Sign-up forms (classic or popup).\n\nContract notes (cs):\n\n`{ \"items\": [FormSummary] }`, nejnovější první. Filtr štítků `?tag=` (opakovatelný, musí sedět všechny).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"tag","in":"query","required":false,"schema":{"type":"string"},"description":"Label filter; repeat for more labels."}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_forms","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FormSummary"}}},"required":["items"]}}}},"400":{"description":"`validation` (message: 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":"forms_create","summary":"Create a form","tags":["Forms"],"description":"Creates a double opt-in sign-up form.\n\nContract notes (cs):\n\nTělo `FormInput`. Povinné: `name` (1 až 100 znaků, v tenantu jedinečný), `shopId`, `listIds` (1 až 20 ručních nebo formulářových seznamů tohoto e-shopu nebo celé firmy) a text souhlasu podle `consentMode`. Odpověď 201 s `FormDetail`. Chyby: 400 `validation` s `message` = název pole (`name`, `shop`, `fields`, `listIds`, `purposeId`, `design.width`, `settings.notify`, `settings.extraPurposes.0.label` …); 409 `conflict` / `name`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormInput"},"examples":{"double-opt-in-create":{"summary":"docs/api-examples/double-opt-in.json create","value":{"name":"Patička webu","shopId":"5","status":"active","fields":[{"field":"firstName","required":false}],"listIds":["42"],"purposeId":"3","consentText":"Souhlasím se zasíláním obchodních sdělení.","title":"Odebírejte novinky","description":"Jednou za měsíc tipy a novinky.","submitLabel":"Přihlásit","successUrl":"https://www.example.cz/dekujeme","confirmedUrl":"https://www.example.cz/potvrzeno"}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-tool":"create_form","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDetail"},"examples":{"double-opt-in-create":{"summary":"docs/api-examples/double-opt-in.json create","value":{"previewUrl":"https://links.example.cz/f/3/50af3dc2-488b-4715-a1b3-3d059af683d8?preview=1","id":"21","name":"Patička webu","shopId":"5","status":"active","listIds":["42"],"purposeId":"3","createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","kind":"classic","tags":[],"fills":0,"publicId":"50af3dc2-488b-4715-a1b3-3d059af683d8","fields":[{"label":"","error":"","placeholder":"","field":"email","required":true},{"label":"","error":"","placeholder":"","field":"firstName","required":false}],"consentText":"Souhlasím se zasíláním obchodních sdělení.","consentVersion":1,"title":"Odebírejte novinky","description":"Jednou za měsíc tipy a novinky.","submitLabel":"Přihlásit","successUrl":"https://www.example.cz/dekujeme","confirmedUrl":"https://www.example.cz/potvrzeno","captcha":false,"hostedUrl":"https://links.example.cz/f/3/50af3dc2-488b-4715-a1b3-3d059af683d8","popup":null,"scriptUrl":null,"design":{"template":"classic","style":"basic-bb2d2d","width":320,"image":"","imagePosition":"top","showTitle":true,"showText":true,"titleColor":"","textColor":"","buttonColor":"","buttonTextColor":""},"settings":{"existingMode":"update","errorUrl":"","notify":[],"newTab":false,"keepParams":false,"affiliateParam":"","thanksHtml":"","typoCheck":true,"doi":true,"doiTemplateId":null,"senderName":"","senderEmail":"","replyTo":"","doiAfter":"thanks","doiThanksHtml":"","consentMode":"checkbox","consentLabel":"","consentLinkText":"","consentLinkUrl":"","extraPurposes":[]}}}}}}},"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}/forms/doi-templates":{"get":{"operationId":"forms_doi_templates","summary":"List templates usable as the double opt-in e-mail","tags":["Forms"],"description":"E-mail templates with the confirmation link ({{confirmlink}}) a form may send as its double opt-in.\n\nContract notes (cs):\n\nŠablony e-mailů s `{{confirmlink}}`, které smí formulář poslat jako potvrzovací e-mail: `{ \"items\": [ { \"id\", \"name\" } ] }`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DoiTemplate"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/forms/preview":{"post":{"operationId":"forms_preview","summary":"Render a form preview","tags":["Forms"],"description":"Contract notes (cs):\n\nTělo `FormInput`, i neuložený a neúplný (název, seznamy a účel smí chybět). Odpověď `{ \"html\" }` = celá veřejná stránka formuláře s poznámkou „Náhled“ a vypnutým tlačítkem.\n\nOprávnění: modul `content` (čtení: seznam, detail, kódy, historie, šablony a náhled; plné: změny, kopie a štítky).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FormField"}},"listIds":{"type":"array","items":{"type":"string"}},"purposeId":{"type":["string","null"]},"consentText":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"submitLabel":{"type":"string"},"successUrl":{"type":"string"},"confirmedUrl":{"type":"string"},"captcha":{"type":"boolean"},"kind":{"type":"string","enum":["classic","popup","slide"]},"popup":{"type":["object","null"],"properties":{"trigger":{"type":"string","enum":["load","delay","scroll"]},"delaySeconds":{"type":"number","description":"delay: 1 to 600 seconds after the page is ready."},"scrollUnit":{"type":"string","enum":["percent","pixels"],"description":"scroll in % of the page (10 to 100) or in pixels from the top (1 to 20000, SmartEmailing)."},"scrollPercent":{"type":"number"},"scrollPixels":{"type":"number"},"repeat":{"type":"string","enum":["days","session","browser"],"description":"session = after closing hidden for the browser session, never after a sign-up; browser = again in the next\nsession, a sign-up too; days = hidden for repeatDays (1 to 365) after closing."},"repeatDays":{"type":"number"},"after":{"type":"string","enum":["redirect","thanks","close"],"description":"thanks = Děkovací okno (the thank-you message in the same dialog, closes itself after closeSeconds); close = Bez\nděkovací stránky (the dialog closes at once, \"Hotovo\" shows for 2 s); redirect needs successUrl (the whole page goes\nthere after the sign-up)."},"closeSeconds":{"type":"number","description":"Děkovací okno closes itself after 0 to 60 seconds, 0 = stays open until the visitor closes it."},"delayScope":{"type":"string","enum":["page","site"],"description":"site = the delay counts time on the whole e-shop across page views; page = each page starts again."},"mobile":{"type":"string","enum":["off","sheet"],"description":"sheet = a bottom sheet on phones and tablets; off = never there (SmartEmailing's recommended default)."},"side":{"type":"string","enum":["left","right"],"description":"Slide-in: the button at the bottom right or left."},"skipLoggedIn":{"type":"boolean","description":"Never for a signed-in Shoptet customer (dataLayer)."},"skipFromEmail":{"type":"boolean","description":"Never for visitors from a Poštárna e-mail (marker parameter emailParam or utm_source in emailSources), 365 days."},"emailParam":{"type":"string"},"emailSources":{"type":"array","items":{"type":"string"}},"skipAfterOrder":{"type":"boolean","description":"Never after an order (thank-you page address contains one of orderPatterns), 365 days."},"orderPatterns":{"type":"array","items":{"type":"string"}},"excludePatterns":{"type":"array","items":{"type":"string"},"description":"Never on addresses containing one of these (cart, checkout)."}},"description":"Pop-up settings, completed with POPUP_DEFAULTS; ignored for a classic form."},"design":{"type":"object","properties":{"template":{"type":"string","enum":["classic","popup","slide","popup-image","popup-image-aside","slide-image"]},"style":{"type":"string","description":"<category>-<colour> of formStyles.json."},"width":{"type":"number"},"image":{"type":"string","description":"https address of the picture, '' = none."},"imagePosition":{"type":"string","enum":["top","aside"]},"showTitle":{"type":"boolean"},"showText":{"type":"boolean"},"titleColor":{"type":"string","description":"#rrggbb or '' (the style's colour)."},"textColor":{"type":"string"},"buttonColor":{"type":"string"},"buttonTextColor":{"type":"string"},"font":{"type":"string","enum":["arial","verdana","tahoma","trebuchet","georgia","times","courier"],"description":"Písmo (core/form_builder.FONTS): fonts every device has."},"titleSize":{"type":"number","description":"px, 14 to 48 / 12 to 28 (core/form_builder.SIZE_LIMITS)."},"textSize":{"type":"number"}}},"settings":{"type":"object","properties":{"existingMode":{"type":"string","enum":["error","update","keep"]},"errorUrl":{"type":"string"},"notify":{"type":"array","items":{"type":"string"}},"newTab":{"type":"boolean"},"keepParams":{"type":"boolean"},"affiliateParam":{"type":"string"},"thanksHtml":{"type":"string"},"typoCheck":{"type":"boolean"},"doi":{"type":"boolean"},"doiTemplateId":{"type":["string","null"]},"senderName":{"type":"string"},"senderEmail":{"type":"string"},"replyTo":{"type":"string"},"doiAfter":{"type":"string","enum":["redirect","thanks"]},"doiThanksHtml":{"type":"string"},"consentMode":{"type":"string","enum":["text","checkbox"],"description":"checkbox = a required check box with consentText; text = SmartEmailing's information text with a link."},"consentLabel":{"type":"string"},"consentLinkText":{"type":"string"},"consentLinkUrl":{"type":"string"},"extraPurposes":{"type":"array","items":{"$ref":"#/components/schemas/FormExtraPurpose"}}}},"tags":{"type":"array","items":{"type":"string"}}}}}}},"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string"}},"required":["html"]}}}},"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}/forms/tags":{"post":{"operationId":"forms_tags","summary":"Change labels of forms","tags":["Forms"],"description":"Contract notes (cs):\n\nŠtítky vybraných formulářů jako u ostatních gridů (`{ \"ids\", \"add\", \"remove\" }` nebo `{ \"ids\", \"tags\" }`).","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":"content","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}/forms/{form_id}":{"delete":{"operationId":"forms_delete","summary":"Delete a form","tags":["Forms"],"description":"Deletes a form (its address stops working).\n\nContract notes (cs):\n\n`GET` vrací `FormDetail`. `PATCH` přijme libovolnou část `FormInput` (`settings` a `design` celé) a vrací `FormDetail`; změna typu bez `design` dostane šablonu nového typu. `DELETE` 204: adresa formuláře přestane fungovat, záznamy souhlasů zůstávají.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"form_id","in":"path","required":true,"description":"Id of the form (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"delete_form","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"forms_show","summary":"Get a form","tags":["Forms"],"description":"One form with its fields, consent text and public address.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"form_id","in":"path","required":true,"description":"Id of the form (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_form","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDetail"}}}},"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":"forms_update","summary":"Update a form","tags":["Forms"],"description":"Changes a form.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"form_id","in":"path","required":true,"description":"Id of the form (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FormField"}},"listIds":{"type":"array","items":{"type":"string"}},"purposeId":{"type":["string","null"]},"consentText":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"submitLabel":{"type":"string"},"successUrl":{"type":"string"},"confirmedUrl":{"type":"string"},"captcha":{"type":"boolean"},"kind":{"type":"string","enum":["classic","popup","slide"]},"popup":{"type":["object","null"],"properties":{"trigger":{"type":"string","enum":["load","delay","scroll"]},"delaySeconds":{"type":"number","description":"delay: 1 to 600 seconds after the page is ready."},"scrollUnit":{"type":"string","enum":["percent","pixels"],"description":"scroll in % of the page (10 to 100) or in pixels from the top (1 to 20000, SmartEmailing)."},"scrollPercent":{"type":"number"},"scrollPixels":{"type":"number"},"repeat":{"type":"string","enum":["days","session","browser"],"description":"session = after closing hidden for the browser session, never after a sign-up; browser = again in the next\nsession, a sign-up too; days = hidden for repeatDays (1 to 365) after closing."},"repeatDays":{"type":"number"},"after":{"type":"string","enum":["redirect","thanks","close"],"description":"thanks = Děkovací okno (the thank-you message in the same dialog, closes itself after closeSeconds); close = Bez\nděkovací stránky (the dialog closes at once, \"Hotovo\" shows for 2 s); redirect needs successUrl (the whole page goes\nthere after the sign-up)."},"closeSeconds":{"type":"number","description":"Děkovací okno closes itself after 0 to 60 seconds, 0 = stays open until the visitor closes it."},"delayScope":{"type":"string","enum":["page","site"],"description":"site = the delay counts time on the whole e-shop across page views; page = each page starts again."},"mobile":{"type":"string","enum":["off","sheet"],"description":"sheet = a bottom sheet on phones and tablets; off = never there (SmartEmailing's recommended default)."},"side":{"type":"string","enum":["left","right"],"description":"Slide-in: the button at the bottom right or left."},"skipLoggedIn":{"type":"boolean","description":"Never for a signed-in Shoptet customer (dataLayer)."},"skipFromEmail":{"type":"boolean","description":"Never for visitors from a Poštárna e-mail (marker parameter emailParam or utm_source in emailSources), 365 days."},"emailParam":{"type":"string"},"emailSources":{"type":"array","items":{"type":"string"}},"skipAfterOrder":{"type":"boolean","description":"Never after an order (thank-you page address contains one of orderPatterns), 365 days."},"orderPatterns":{"type":"array","items":{"type":"string"}},"excludePatterns":{"type":"array","items":{"type":"string"},"description":"Never on addresses containing one of these (cart, checkout)."}},"description":"Pop-up settings, completed with POPUP_DEFAULTS; ignored for a classic form."},"design":{"type":"object","properties":{"template":{"type":"string","enum":["classic","popup","slide","popup-image","popup-image-aside","slide-image"]},"style":{"type":"string","description":"<category>-<colour> of formStyles.json."},"width":{"type":"number"},"image":{"type":"string","description":"https address of the picture, '' = none."},"imagePosition":{"type":"string","enum":["top","aside"]},"showTitle":{"type":"boolean"},"showText":{"type":"boolean"},"titleColor":{"type":"string","description":"#rrggbb or '' (the style's colour)."},"textColor":{"type":"string"},"buttonColor":{"type":"string"},"buttonTextColor":{"type":"string"},"font":{"type":"string","enum":["arial","verdana","tahoma","trebuchet","georgia","times","courier"],"description":"Písmo (core/form_builder.FONTS): fonts every device has."},"titleSize":{"type":"number","description":"px, 14 to 48 / 12 to 28 (core/form_builder.SIZE_LIMITS)."},"textSize":{"type":"number"}}},"settings":{"type":"object","properties":{"existingMode":{"type":"string","enum":["error","update","keep"]},"errorUrl":{"type":"string"},"notify":{"type":"array","items":{"type":"string"}},"newTab":{"type":"boolean"},"keepParams":{"type":"boolean"},"affiliateParam":{"type":"string"},"thanksHtml":{"type":"string"},"typoCheck":{"type":"boolean"},"doi":{"type":"boolean"},"doiTemplateId":{"type":["string","null"]},"senderName":{"type":"string"},"senderEmail":{"type":"string"},"replyTo":{"type":"string"},"doiAfter":{"type":"string","enum":["redirect","thanks"]},"doiThanksHtml":{"type":"string"},"consentMode":{"type":"string","enum":["text","checkbox"],"description":"checkbox = a required check box with consentText; text = SmartEmailing's information text with a link."},"consentLabel":{"type":"string"},"consentLinkText":{"type":"string"},"consentLinkUrl":{"type":"string"},"extraPurposes":{"type":"array","items":{"$ref":"#/components/schemas/FormExtraPurpose"}}}},"tags":{"type":"array","items":{"type":"string"}}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-tool":"update_form","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDetail"}}}},"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}/forms/{form_id}/copy":{"post":{"operationId":"forms_copy","summary":"Copy a form","tags":["Forms"],"description":"Vytvořit kopii formuláře: an inactive copy with a free name.\n\nContract notes (cs):\n\nVytvořit kopii formuláře: 201 `FormDetail` vypnuté kopie s volným názvem „<název> (kopie)“.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"form_id","in":"path","required":true,"description":"Id of the form (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDetail"}}}},"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}/forms/{form_id}/embed":{"get":{"operationId":"forms_embed","summary":"Get the embed code of a form","tags":["Forms"],"description":"The codes of Vložit do stránky: script (JavaScript, always current), url (Odkaz na webový formulář), styled (HTML), html (Minimální HTML).\n\nContract notes (cs):\n\n`{ \"script\", \"url\", \"styled\", \"html\" }` = Vložení formuláře na web: `script` (JavaScript, `popup.js` nebo `form.js`, vždy aktuální), `url` (odkaz na veřejnou stránku), `styled` (HTML se vzhledem a vlastním CSS, po změně vložit znovu), `html` (minimální HTML bez stylů; typ pop-up a vysouvací se ztratí).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"form_id","in":"path","required":true,"description":"Id of the form (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormEmbed"},"examples":{"double-opt-in-embed":{"summary":"docs/api-examples/double-opt-in.json embed","value":{"html":"<!-- Formulář Poštárny: Patička webu -->\n<form method=\"post\" action=\"https://links.example.cz/f/3/50af3dc2-488b-4715-a1b3-3d059af683d8\" accept-charset=\"UTF-8\">\n  <div class=\"pf-row\" data-field=\"email\"><label for=\"pf-email\">E-mailová adresa <span class=\"pf-req\">*</span></label><input id=\"pf-email\" type=\"email\" name=\"email\" maxlength=\"254\" autocomplete=\"email\" required><p class=\"pf-typo\" hidden></p></div>\n  <div class=\"pf-row\" data-field=\"firstName\"><label for=\"pf-firstName\">Jméno</label><input id=\"pf-firstName\" type=\"text\" name=\"firstName\" maxlength=\"200\" autocomplete=\"given-name\"></div>\n  <p style=\"position:absolute;left:-10000px\" aria-hidden=\"true\"><input type=\"text\" name=\"pa_website\" tabindex=\"-1\" autocomplete=\"off\"></p>\n  <div class=\"pf-row\"><label class=\"pf-choice\"><input type=\"checkbox\" name=\"consent\" value=\"1\" required> <span>Souhlasím se zasíláním obchodních sdělení.</span></label></div>\n  <button type=\"submit\">Přihlásit</button>\n  <p><small>Example s.r.o., Ukázková 1, 110 00 Praha 1 <a href=\"https://shop-cz.example.test/ochrana-osobnich-udaju/\">Zásady ochrany osobních údajů</a></small></p>\n</form>\n","styled":"<!-- Formulář Poštárny: Patička webu -->\n<style>.pf-50af3dc2{box-sizing:border-box;max-width:320px;width:100%;margin:0 auto;background:#ececec;color:#333333;border-radius:4px;font:15px/1.45 Arial,Helvetica,sans-serif;}.pf-50af3dc2 *{box-sizing:border-box}.pf-50af3dc2 .pf-in{padding:20px 22px}.pf-50af3dc2 .pf-flex{display:flex;align-items:stretch}.pf-50af3dc2 .pf-flex .pf-side{flex:0 0 42%;background-size:cover;background-position:center}.pf-50af3dc2 .pf-flex .pf-in{flex:1 1 auto;min-width:0}.pf-50af3dc2 img.pf-img{display:block;width:calc(100% + 44px);max-width:none;height:auto;margin:4px -22px 14px}.pf-50af3dc2 h2.pf-title{margin:0 0 8px;font-size:22px;line-height:1.25;color:#bb2d2d;text-align:center}.pf-50af3dc2 p.pf-text{margin:0 0 12px;color:#333333;text-align:center}.pf-50af3dc2 .pf-row{margin:0 0 12px}.pf-50af3dc2 label{display:block;margin:0 0 4px;font-weight:700;font-size:13px;color:#333333}.pf-50af3dc2 label .pf-req{color:#d0021b}.pf-50af3dc2 input[type=text],.pf-50af3dc2 input[type=email],.pf-50af3dc2 input[type=tel],.pf-50af3dc2 input[type=date],.pf-50af3dc2 input[type=number],.pf-50af3dc2 select,.pf-50af3dc2 textarea{width:100%;padding:9px 10px;font:inherit;font-size:16px;color:#222;background:#fff;border:1px solid #c9c9c9;border-radius:3px}.pf-50af3dc2 textarea{min-height:80px}.pf-50af3dc2 .pf-choice{display:flex;gap:8px;align-items:flex-start;font-weight:400}.pf-50af3dc2 .pf-choice input{margin-top:3px;flex:none}.pf-50af3dc2 .pf-note{font-size:12px;margin:0 0 10px;color:#333333}.pf-50af3dc2 .pf-note a,.pf-50af3dc2 .pf-choice a{color:#bb2d2d}.pf-50af3dc2 .pf-err{color:#d0021b;font-size:13px;margin:4px 0 0}.pf-50af3dc2 .pf-typo{font-size:13px;margin:4px 0 0}.pf-50af3dc2 .pf-actions{text-align:center}.pf-50af3dc2 button.pf-btn{display:inline-block;padding:11px 22px;font:700 16px Arial,Helvetica,sans-serif;color:#ffffff;background:#bb2d2d;border:0;border-radius:4px;cursor:pointer;min-width:50%}.pf-50af3dc2 .pf-hp{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}@media (max-width:479px){.pf-50af3dc2 .pf-flex{display:block}.pf-50af3dc2 .pf-flex .pf-side{height:160px}}</style><div class=\"pf-50af3dc2 pf pf-basic\" data-template=\"classic\"><div class=\"pf-in\"><h2 class=\"pf-title\">Odebírejte novinky</h2><p class=\"pf-text\">Jednou za měsíc tipy a novinky.</p><form method=\"post\" action=\"https://links.example.cz/f/3/50af3dc2-488b-4715-a1b3-3d059af683d8\" accept-charset=\"UTF-8\" novalidate data-typo=\"1\"><div class=\"pf-row\" data-field=\"email\"><label for=\"pf-50af3dc2-email\">E-mailová adresa <span class=\"pf-req\">*</span></label><input id=\"pf-50af3dc2-email\" type=\"email\" name=\"email\" maxlength=\"254\" autocomplete=\"email\" required><p class=\"pf-typo\" hidden></p></div><div class=\"pf-row\" data-field=\"firstName\"><label for=\"pf-50af3dc2-firstName\">Jméno</label><input id=\"pf-50af3dc2-firstName\" type=\"text\" name=\"firstName\" maxlength=\"200\" autocomplete=\"given-name\"></div><p class=\"pf-hp\" aria-hidden=\"true\"><label>Toto pole nevyplňujte <input type=\"text\" name=\"pa_website\" tabindex=\"-1\" autocomplete=\"off\"></label></p><div class=\"pf-row\"><label class=\"pf-choice\"><input type=\"checkbox\" name=\"consent\" value=\"1\" required> <span>Souhlasím se zasíláním obchodních sdělení.</span></label></div><div class=\"pf-actions\"><button type=\"submit\" class=\"pf-btn primary\">Přihlásit</button></div><p><small>Example s.r.o., Ukázková 1, 110 00 Praha 1 <a href=\"https://shop-cz.example.test/ochrana-osobnich-udaju/\">Zásady ochrany osobních údajů</a></small></p></form></div></div>\n","url":"https://links.example.cz/f/3/50af3dc2-488b-4715-a1b3-3d059af683d8","script":"<script src=\"https://links.example.cz/f/3/50af3dc2-488b-4715-a1b3-3d059af683d8/form.js\" async></script>"}}}}}},"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}/forms/{form_id}/history":{"get":{"operationId":"forms_history","summary":"Change history of a form","tags":["Forms"],"description":"Historie vyplnění: the sign-ups of a form, newest first (?q= address, ?filledFrom= and ?filledTo= calendar days of the tenant, ?page=, ?pageSize=, ?sort=).\n\nContract notes (cs):\n\nHistorie vyplnění: `?q=` (část adresy), `?filledFrom=` a `?filledTo=` (kalendářní dny tenanta, oba včetně), `?page=`, `?pageSize=` (nejvýš 100), `?sort=` (`-filled` výchozí, `filled`, `email`, `-email`, `id`, `-id`). Odpověď `{ \"items\": [FormFill], \"total\", \"page\", \"pageSize\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"form_id","in":"path","required":true,"description":"Id of the form (string of digits).","schema":{"type":"string"}},{"name":"filledFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"filledTo","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FormFill"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: filledTo, page)","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}/forms/{form_id}/welcome":{"get":{"operationId":"forms_welcome","summary":"Get the e-mail after a sign-up (the form's own automation)","tags":["Forms"],"description":"E-mail po přihlášení (core/form_welcome.py): the form's own automation and its e-mail, the coupon tags of the template (?templateId= another template to check before saving) and the shop's coupon stacks.\n\nContract notes (cs):\n\nE-mail po přihlášení (`core/form_welcome.py`): formulář vlastní automatizaci (spouštěč vyplnění formuláře s jeho id, každý kontakt jednou, jeden uzel Odeslat e-mail). Najde se podle spouštěče, ručně vytvořená se převezme (žádná druhá). `GET` (`?templateId=` = ověřit jinou šablonu) vrací `{ \"enabled\", \"automation\": { \"id\", \"name\", \"status\", \"custom\" } | null, \"templateId\", \"senderId\", \"senderName\", \"replyTo\", \"template\": { \"id\", \"name\", \"couponKeys\" } | null, \"couponStackId\", \"stacks\": [ { \"id\", \"name\", \"mergeKey\", \"tag\", \"free\", \"low\" } ], \"others\" }`. `custom` = automatizace má víc uzlů, upravuje se jen v editoru automatizací. `PUT` (modul kampaně, plný přístup) s `{ \"enabled\", \"templateId\", \"senderId\", \"senderName\", \"replyTo\", \"couponStackId\" }`: zapnuto vytvoří nebo upraví automatizaci a spustí ji, vypnuto ji pozastaví. Chyby: 400 `validation` `welcome.templateId`, `welcome.coupon` (šablona nemá značku zásobníku, `tag` v detailu), `welcome.incomplete` (`issues`); 409 `conflict` `welcome.custom`, `test_only`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"form_id","in":"path","required":true,"description":"Id of the form (string of digits).","schema":{"type":"string"}},{"name":"templateId","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormWelcome"}}}},"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"}}},"put":{"operationId":"forms_welcome_save","summary":"Switch the e-mail after a sign-up on or off","tags":["Forms"],"description":"Switches the e-mail after a sign-up on (creates or adopts the form's automation, saves its e-mail and starts it) or off (pauses it). Module campaigns: it runs an automation.\n\nContract notes (cs):\n\nE-mail po přihlášení (`core/form_welcome.py`): formulář vlastní automatizaci (spouštěč vyplnění formuláře s jeho id, každý kontakt jednou, jeden uzel Odeslat e-mail). Najde se podle spouštěče, ručně vytvořená se převezme (žádná druhá). `GET` (`?templateId=` = ověřit jinou šablonu) vrací `{ \"enabled\", \"automation\": { \"id\", \"name\", \"status\", \"custom\" } | null, \"templateId\", \"senderId\", \"senderName\", \"replyTo\", \"template\": { \"id\", \"name\", \"couponKeys\" } | null, \"couponStackId\", \"stacks\": [ { \"id\", \"name\", \"mergeKey\", \"tag\", \"free\", \"low\" } ], \"others\" }`. `custom` = automatizace má víc uzlů, upravuje se jen v editoru automatizací. `PUT` (modul kampaně, plný přístup) s `{ \"enabled\", \"templateId\", \"senderId\", \"senderName\", \"replyTo\", \"couponStackId\" }`: zapnuto vytvoří nebo upraví automatizaci a spustí ji, vypnuto ji pozastaví. Chyby: 400 `validation` `welcome.templateId`, `welcome.coupon` (šablona nemá značku zásobníku, `tag` v detailu), `welcome.incomplete` (`issues`); 409 `conflict` `welcome.custom`, `test_only`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"form_id","in":"path","required":true,"description":"Id of the form (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormWelcomeInput"}}}},"x-postarna-permission":{"module":"campaigns","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormWelcome"}}}},"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: welcome.custom)","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}/grid-tags":{"get":{"operationId":"grid_tags_index","summary":"Labels used in a grid","tags":["Account"],"description":"Labels used in one grid (?grid=lists|segments|campaigns|automations), for the Štítky filter.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"grid","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]}}}},"400":{"description":"`validation` (message: grid)","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}/imports":{"get":{"operationId":"imports_index","summary":"List imports","tags":["Imports and exports"],"description":"Imports with status and counts.\n\nContract notes (cs):\n\nSeznam (nejnovější první, `page`, `pageSize`) položek `ImportSummary`: `{ \"id\", \"name\", \"status\", \"kind\", \"fileName\", \"shopId\", \"mode\", \"listIds\", \"createdAt\", \"startedAt\", \"finishedAt\", \"progress\": { \"processed\", \"total\" }, \"counts\" }`. Grid SE „Všechny importy“ (audit IM-01): `q` (slova názvu), Filtry `idFrom`, `idTo`, `name`, `status` (`draft`, `queued`, `running`, `finished`, `failed`; jiný stav nebo nečíselné ID 400), řazení navíc `lists` (počet vybraných seznamů); položka seznamu nese `listNames` (názvy vybraných seznamů v jejich pořadí). Stejné Filtry (`idFrom`, `idTo`, `name`, `status` exportu) bere `GET …/exports` (EX-01). Detail `ImportDetail` navíc `source`, `purposeId`, `addedToLists` (nová členství), `errors` (prvních 50 chybných řádků `{ \"row\", \"error\", \"field\" }`) a `report` (`ImportReport`, null do dokončení).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"idFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"idTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Status filter."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_imports","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ImportSummary"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: q, sort, status)","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":"imports_run","summary":"Start an import","tags":["Imports and exports"],"description":"Runs an import. upsert and update_only need purposeId and consentConfirmed true; unsubscribe, remove and blacklist leave both out.\n\nContract notes (cs):\n\nTělo `ImportRequest` = `ImportPlan` a navíc `name` (1 až 100 znaků), `source` (odkud kontakty jsou, 1 až 200), `purposeId` (účel tenanta), `consentConfirmed` (musí být true: uživatel potvrzuje doložený a platný účel u všech kontaktů), nepovinně `runAutomations` (boolean, výchozí `false`). Chyby 400 `name`, `source`, `purpose`, `consent`, `runAutomations` (není boolean) a chyby náhledu.\n• **Import nespouští automatizace** (migrace 0077): kontakty, členství v seznamech, změny stavu v seznamu, změny polí a potlačení, které import zapíše, nespustí žádný spouštěč (přidání do seznamu, změna stavu v seznamu, přihlášení, nový kontakt, změna kontaktu, blacklist), jinak by tisíce importovaných lidí dostaly e-mail najednou. Jen když uživatel výslovně zaškrtne `runAutomations: true`, chová se import jako běžný zápis a automatizace spustí. Stejně tak přechod ze SmartEmailingu a jeho hodinová synchronizace nespouští automatizace nikdy. `ImportDetail` vrací `runAutomations`.\n• **Opt-out režimy (`unsubscribe`, `remove`, `blacklist`) nezapisují žádný profil ani souhlas**, takže `purposeId` a `consentConfirmed` jsou u nich nepovinné: klíč musí v těle úplně chybět (prázdný řetězec je pořád neplatné id a vrátí 400 `purpose`), server si pro záznam dosadí první účel tenanta; `consentConfirmed` se u nich vůbec nekontroluje. U ostatních režimů platí povinnost jako dřív.\n• Výsledek se rozhoduje stejně jako v náhledu. Nový kontakt: stav `subscribed` (bez souhlasu `customer`), `source` = `import` (u druhů Shoptetu `shoptet`), `consent_basis` = `imported` (bez souhlasu `none`), jazyk podle e-shopu, když ho soubor nemá. Jeden e-mail = jeden kontakt bez ohledu na zdroj: aktualizace přepíše jen neprázdné hodnoty, které se liší, nikdy e-mail a **nikdy pole, které upravil člověk v Poštárně** (`editedFields` kontaktu). Přidání do seznamů jako `confirmed` (u `pending` `unconfirmed`), jen se souhlasem; kdo se ze seznamu odhlásil, zůstane odhlášený.\n• Server ke každému kontaktu se souhlasem zapíše souhlas (`consents`: účel, `valid_from` = datum souhlasu ze souboru, jinak teď, `valid_until` podle platnosti účelu) a záznam do `consent_log` se zdrojem importu (`import` nebo `shoptet`); opt-out režimy žádný souhlas nezapisují, jen `consent_log` (`list_unsubscribed`, `suppressed`). Každý kontakt, kterého se řádek týká, dostane záznam zdroje (`sources` v detailu kontaktu: zdroj, co říká o souhlasu, kdy byl vidět poprvé a naposledy; u Shoptetu jeden záznam na e-shop).\n• Odpověď `ImportDetail` (viz níže). Do 1 000 řádků server import provede hned (`finished`), větší zařadí jako úlohu (`queued`, `running`): worker ho zpracuje po dávkách 2 000 řádků, po každé dávce uloží průběh (`progress`) a po restartu pokračuje od posledního uloženého řádku. UI se ptá `GET /imports/{id}`, dokud není `finished` nebo `failed`. Po dokončení přijde notifikace `import_finished`. Mock import provede hned.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRequest"},"examples":{"import-contacts-run":{"summary":"docs/api-examples/import-contacts.json run","value":{"name":"Kontakty z veletrhu","source":"csv","fileId":"71","mapping":["email","firstName","lastName","city"],"mode":"upsert","shopId":"9","listIds":[],"purposeId":"5","consentConfirmed":true}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"import","x-mcp-tool":"start_import","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDetail"},"examples":{"import-contacts-run":{"summary":"docs/api-examples/import-contacts.json run","value":{"id":"61","name":"Kontakty z veletrhu","status":"finished","kind":"csv","fileName":"vlozeny-text.csv","shopId":"9","mode":"upsert","listIds":[],"createdAt":"2026-10-01T08:00:00.000Z","startedAt":"2026-10-01T08:00:00.000Z","finishedAt":"2026-10-01T08:00:00.000Z","progress":{"processed":3,"total":3},"counts":{"rows":3,"create":2,"remove":0,"update":0,"invalid":1,"blacklist":0,"duplicate":0,"skipMissing":0,"unsubscribe":0,"skipSuppressed":0},"source":"csv","purposeId":"5","addedToLists":0,"errors":[{"row":4,"error":"email_invalid","field":"email"}],"runAutomations":false,"options":{},"report":{"consent":{"none":0,"optIn":2,"keptUnsubscribed":0},"merge":{"existing":0,"fromSources":{},"fieldsUpdated":0,"fieldsKeptEdited":0},"dropped":{}}}}}}}},"400":{"description":"`validation` (message: consent, draftId, purpose, runAutomations)","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}/imports/drafts":{"post":{"operationId":"imports_draft_create","summary":"Start an import draft (wizard)","tags":["Imports and exports"],"description":"SE \"Rozpracováno\": the wizard saves itself after its first step. Body {name, source, step, state, fileId?, shopId?}; 201 ImportDraft.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDraftInput"}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDraft"}}}},"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}/imports/drafts/{import_id}":{"get":{"operationId":"imports_draft_show","summary":"Get an import draft","tags":["Imports and exports"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"import_id","in":"path","required":true,"description":"Id of the import (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDraft"}}}},"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"}}},"put":{"operationId":"imports_draft_update","summary":"Save an import draft","tags":["Imports and exports"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"import_id","in":"path","required":true,"description":"Id of the import (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDraftInput"}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDraft"}}}},"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}/imports/files":{"post":{"operationId":"imports_upload","summary":"Upload a CSV file for import","tags":["Imports and exports"],"description":"Uploads CSV text for an import (header row, ; , or tab, up to 5 MB of text; larger files through the administration, up to 64 MB and 300 000 rows). Answers fileId, columns, sample rows, suggestedKind and suggestedMapping.\n\nmultipart/form-data with the field file (up to imports.MAX_BYTES; werkzeug spools it to a temporary file, it is read from there as a stream) or JSON {text} (pasted, up to imports.TEXT_MAX_BYTES). 201 with the stored file, its encoding and the suggested kind and mapping.\n\nContract notes (cs):\n\nSoubor jako `multipart/form-data` v poli `file` (nejvýš 64 MB), nebo vložený text jako JSON `{ \"text\": \"…\" }` (nejvýš 5 MB). Odpověď `ImportFile`: `{ \"fileId\", \"fileName\", \"size\", \"delimiter\", \"encoding\", \"columns\", \"rowCount\", \"sample\", \"suggestedKind\", \"suggestedMapping\" }`.\n• Kódování pozná server sám: UTF-8 (i s BOM), UTF-16 s BOM (Excel „Text v kódování Unicode“), jinak windows-1250 (Shoptet, český Excel); `encoding` = `utf-8`, `utf-16` nebo `windows-1250`. Oddělovač `;`, `,` nebo tabulátor podle hlavičky, uvozovky podle RFC 4180 (zdvojené uvozovky, nové řádky v poli). První řádek je hlavička, prázdné řádky se přeskočí. `sample` = prvních 5 datových řádků. Soubor se čte proudem a ukládá po dávkách, celý v paměti nikdy není.\n• `suggestedKind` a `suggestedMapping`: návrh druhu souboru a mapování podle názvů sloupců (cs, sk, en a názvy Shoptetu, `docs/imports.md`); UI ho použije, uživatel ho může změnit.\n• Chyby 400: `file` (prázdný), `size` (nad 64 MB, u vloženého textu nad 5 MB; `params.maxBytes`), `encoding` (nejde přečíst ani jako windows-1250), `header`, `rows` (žádný datový řádek nebo nad 300 000; `params.maxRows`), `format` (buňka nad 128 000 znaků, typicky chybějící uzavírací uvozovky). Tělo nad limit odmítne už server před čtením: 413 `validation` `size`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"delimiter":{"type":"string"},"quote":{"type":"string"},"hasHeader":{"type":"boolean"},"text":{"type":"string"}},"required":["delimiter","quote","hasHeader","text"]},{"type":"object","properties":{"delimiter":{},"quote":{},"hasHeader":{},"text":{"type":"string"}},"required":["text"]}]},"examples":{"import-contacts-upload":{"summary":"docs/api-examples/import-contacts.json upload","value":{"text":"email;jmeno;prijmeni;mesto\nmarie.dvorakova@example.cz;Marie;Dvořáková;Praha\ntomas.cerny@example.cz;Tomáš;Černý;Ostrava\nchybna-adresa;Jan;Bez;Plzeň\n","delimiter":";","quote":"\"","hasHeader":true}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"upload_import_csv","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportFile"},"examples":{"import-contacts-upload":{"summary":"docs/api-examples/import-contacts.json upload","value":{"fileId":"71","fileName":"vlozeny-text.csv","size":155,"delimiter":";","quote":"\"","hasHeader":true,"encoding":"utf-8","columns":["email","jmeno","prijmeni","mesto"],"rowCount":3,"sample":[["marie.dvorakova@example.cz","Marie","Dvořáková","Praha"],["tomas.cerny@example.cz","Tomáš","Černý","Ostrava"],["chybna-adresa","Jan","Bez","Plzeň"]],"suggestedKind":"csv","suggestedMapping":["email","firstName","lastName","city"]}}}}}},"400":{"description":"`validation` (message: file)","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}/imports/preview":{"post":{"operationId":"imports_preview","summary":"Preview an import: mapping, counts, problems","tags":["Imports and exports"],"description":"What an import would do with the file: counts per action and the first rows.\n\nContract notes (cs):\n\nTělo `ImportPlan`: `{ \"fileId\", \"mapping\", \"mode\", \"kind\"?, \"shopId\", \"listIds\" }`.\n• `mapping`: pro každý sloupec pole kontaktu nebo null (nenačítat). Pole: `email`, `firstName`, `lastName`, `fullName` (jméno a příjmení v jednom sloupci, doplní prázdné jméno a příjmení), `titleBefore`, `titleAfter`, `phone`, `mobile`, `company`, `companyId` (IČO), `street`, `city`, `postalCode`, `country`, `language`, `gender`, `birthday`, `note`, `newsletterConsent` (souhlas s newsletterem v řádku), `newsletterConsentAt` (jeho datum), `registeredAt` (datum registrace, uloží se ke zdroji kontaktu). Právě jeden sloupec `email`, žádné pole dvakrát (jinak 400 `mapping`).\n• `kind` (výchozí `csv`): odkud je souhlas řádku. `csv` = souhlas ke všem řádkům potvrzuje uživatel (`consentConfirmed`), ledaže soubor má namapovaný `newsletterConsent`; `shoptet_customers` = export zákazníků ze Shoptetu, souhlas rozhoduje sloupec `newsletterConsent` (povinný, jinak 400 `consentColumn`); `shoptet_newsletter` = export odběratelů newsletteru, každý řádek je odběratel; bez namapovaného `newsletterConsent` musí plán nést `subscribersConfirmed: true` (uživatel v kroku Sloupce potvrdil, že každý řádek je aktivní odběratel; sloupce tohoto exportu nejsou ověřené proti Shoptetu), jinak 400 `subscribers`. **Řádek bez souhlasu se uloží jen jako zákazník** (stav `customer`, `consentBasis` `none`, nikdy se mu neposílá, nepřidá se do `listIds`, žádný souhlas). U druhů Shoptetu se hodnota, která nejde přečíst (neznámá země, chybné datum), vynechá a započítá v `report.dropped`, řádek kvůli ní není chybný; neznámé slovo v souhlasu = bez souhlasu. Neznámý druh = 400 `kind`.\n• `mode`: `upsert` (přidat nové a aktualizovat stávající), `update_only` (jen stávající, nové přeskočit), nebo tři režimy SE, co kontakty jen vyřazují a nic nezapisují do profilu ani do souhlasu (`OPT_OUT_MODES`): `unsubscribe` (odhlásit z `listIds`), `remove` (odebrat z `listIds`) a `blacklist` (adresa na blacklist, i když ještě není kontakt). `unsubscribe` a `remove` potřebují aspoň jeden list (jinak 400 `listIds`, `LIST_MODES`); `blacklist` list nepotřebuje.\n• `shopId` = hlavní e-shop nových kontaktů; vypnutý e-shop (Nastavení › E-shopy) nový import nepřijme, 400 `shop`. `listIds` = seznamy, kam kontakty přidat (nebo u opt-out režimů odhlásit/odebrat): jen ruční a formulářové seznamy tohoto e-shopu nebo celé firmy (jinak 400 `listIds`); do seznamů napojení na e-shop se neimportuje.\n• Neznámý `fileId` (i soubor jiného tenanta) = 404.\n\nOdpověď `{ \"counts\": { \"rows\", \"create\", \"update\", \"skipSuppressed\", \"skipMissing\", \"invalid\", \"duplicate\", \"unsubscribe\", \"remove\", \"blacklist\" }, \"rows\": [ … prvních 20 … ], \"report\": ImportReport }`, řádek `{ \"row\", \"email\", \"action\", \"error\", \"field\", \"values\", \"consent\" }` (`consent` true/false, null u chybného řádku a opt-out režimů). Náhled projde celý soubor po dávkách.\n• Hodnoty se ořežou a znormalizují: e-mail malými písmeny, bez neviditelných znaků, mezinárodní doména v ASCII podobě (IDNA), tečky v adrese zůstávají; `gender` f/m (také žena, muž), `language` cs/sk (cz = cs), `country` dvě písmena nebo běžný název země (Česká republika, Slovensko, Německo …), `birthday` `YYYY-MM-DD` nebo `D. M. YYYY`, telefon jen číslice, mezery a `+()-./`, `companyId` písmena a číslice bez mezer, `newsletterConsent` `yes`/`no` (ano, áno, 1, x, souhlas, přihlášen / ne, nie, 0, odhlášen), data `newsletterConsentAt` a `registeredAt` (`D. M. YYYY` nebo `YYYY-MM-DD`, případně s časem, místní čas firmy) jako ISO UTC, ostatní text do 200 znaků. Prázdná buňka nic nemění.\n• `ImportReport` (souhrn sloučení): `consent` `{ optIn, none, keptUnsubscribed }` (řádky se souhlasem, bez souhlasu, odhlášené kontakty, které soubor uvádí se souhlasem a zůstaly odhlášené), `merge` `{ existing, fromSources, fieldsUpdated, fieldsKeptEdited }` (řádky k existujícímu kontaktu, z nich kolik už přišlo z jiného zdroje podle zdroje `csv`, `shoptet`, `smartemailing`, `api`, `form`, `manual`, `erp`; počet přepsaných hodnot a hodnot ponechaných, protože pole upravil člověk v Poštárně; obojí jen u spuštění), `dropped` `{ pole: počet }`.\n• `action`: `invalid` (`error` = `email_missing`, `email_invalid`, nebo `value_invalid` s `field`), `duplicate` (adresa už byla výš v souboru), `skip_suppressed` (kontakt je odhlášený, vrácený, se stížností nebo na seznamu potlačení: **import ho nikdy znovu nepřihlásí a nic na něm nezmění**; server navíc kontroluje tabulku `suppressions` i pro adresy bez kontaktu), `update`, `skip_missing` (`update_only` a adresa není kontakt), `create`, `unsubscribe`, `remove`, `blacklist` (poslední tři jen u odpovídajícího opt-out režimu).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPlan"},"examples":{"import-contacts-preview":{"summary":"docs/api-examples/import-contacts.json preview","value":{"fileId":"71","mapping":["email","firstName","lastName","city"],"mode":"upsert","shopId":"9","listIds":[]}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"preview_import","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPreview"},"examples":{"import-contacts-preview":{"summary":"docs/api-examples/import-contacts.json preview","value":{"counts":{"rows":3,"create":2,"update":0,"skipSuppressed":0,"skipMissing":0,"invalid":1,"duplicate":0,"unsubscribe":0,"remove":0,"blacklist":0},"rows":[{"row":2,"email":"marie.dvorakova@example.cz","action":"create","error":null,"field":null,"values":{"email":"marie.dvorakova@example.cz","firstName":"Marie","lastName":"Dvořáková","city":"Praha"},"consent":true},{"row":3,"email":"tomas.cerny@example.cz","action":"create","error":null,"field":null,"values":{"email":"tomas.cerny@example.cz","firstName":"Tomáš","lastName":"Černý","city":"Ostrava"},"consent":true},{"row":4,"email":"chybna-adresa","action":"invalid","error":"email_invalid","field":"email","values":{"email":"chybna-adresa","firstName":"Jan","lastName":"Bez","city":"Plzeň"},"consent":null}],"report":{"consent":{"optIn":2,"none":0,"keptUnsubscribed":0},"merge":{"existing":0,"fromSources":{},"fieldsUpdated":0,"fieldsKeptEdited":0},"dropped":{}}}}}}}},"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}/imports/{import_id}":{"delete":{"operationId":"imports_delete","summary":"Delete an import record","tags":["Imports and exports"],"description":"SE \"Odstranit import\": only a draft (409 status for an import that started).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"import_id","in":"path","required":true,"description":"Id of the import (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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)","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":"imports_show","summary":"Get an import with its progress and result","tags":["Imports and exports"],"description":"Contract notes (cs):\n\nSeznam (nejnovější první, `page`, `pageSize`) položek `ImportSummary`: `{ \"id\", \"name\", \"status\", \"kind\", \"fileName\", \"shopId\", \"mode\", \"listIds\", \"createdAt\", \"startedAt\", \"finishedAt\", \"progress\": { \"processed\", \"total\" }, \"counts\" }`. Grid SE „Všechny importy“ (audit IM-01): `q` (slova názvu), Filtry `idFrom`, `idTo`, `name`, `status` (`draft`, `queued`, `running`, `finished`, `failed`; jiný stav nebo nečíselné ID 400), řazení navíc `lists` (počet vybraných seznamů); položka seznamu nese `listNames` (názvy vybraných seznamů v jejich pořadí). Stejné Filtry (`idFrom`, `idTo`, `name`, `status` exportu) bere `GET …/exports` (EX-01). Detail `ImportDetail` navíc `source`, `purposeId`, `addedToLists` (nová členství), `errors` (prvních 50 chybných řádků `{ \"row\", \"error\", \"field\" }`) a `report` (`ImportReport`, null do dokončení).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"import_id","in":"path","required":true,"description":"Id of the import (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDetail"},"examples":{"import-contacts-show":{"summary":"docs/api-examples/import-contacts.json show","value":{"id":"61","name":"Kontakty z veletrhu","status":"finished","kind":"csv","fileName":"vlozeny-text.csv","shopId":"9","mode":"upsert","listIds":[],"createdAt":"2026-10-01T08:00:00.000Z","startedAt":"2026-10-01T08:00:00.000Z","finishedAt":"2026-10-01T08:00:00.000Z","progress":{"processed":3,"total":3},"counts":{"rows":3,"create":2,"remove":0,"update":0,"invalid":1,"blacklist":0,"duplicate":0,"skipMissing":0,"unsubscribe":0,"skipSuppressed":0},"source":"csv","purposeId":"5","addedToLists":0,"errors":[{"row":4,"error":"email_invalid","field":"email"}],"runAutomations":false,"options":{},"report":{"consent":{"none":0,"optIn":2,"keptUnsubscribed":0},"merge":{"existing":0,"fromSources":{},"fieldsUpdated":0,"fieldsKeptEdited":0},"dropped":{}}}}}}}},"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}/labels":{"get":{"operationId":"labels_index","summary":"List labels","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Label"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"labels_create","summary":"Create a label","tags":["Account"],"description":"Contract notes (cs):\n\nŠtítky účtu (SE Nastavení › Firma › Štítky, migrace 0150, modul `content`: čtení GET, plný přístup ostatní). `{ \"items\": [ { \"id\", \"name\", \"color\", \"used\", \"createdAt\" } ] }`, `color` = `#rrggbbaa` (malými písmeny; vstup `#rrggbb` dostane `ff`), `used` = počet seznamů, segmentů, kampaní a scénářů se štítkem. POST `{name, color}` → 201; jméno 1 až 40 znaků, bez ohledu na velikost písmen unikátní (jinak 409 `conflict`). PATCH `{name?, color?}`: přejmenování přejmenuje štítek i na záznamech. DELETE štítek ze záznamů odebere → 204. `assign` tělo `{lists?, segments?, campaigns?, automations?: [id]}` (každý druh potřebuje plný přístup ve svém modulu, cizí id 400 `validation`) → `{updated}`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"color":{"type":"string"}},"required":["name","color"]}}},"description":"Required by the server: color, name."},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}},"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}/labels/{label_id}":{"delete":{"operationId":"labels_delete","summary":"Delete a label","tags":["Account"],"description":"Contract notes (cs):\n\nŠtítky účtu (SE Nastavení › Firma › Štítky, migrace 0150, modul `content`: čtení GET, plný přístup ostatní). `{ \"items\": [ { \"id\", \"name\", \"color\", \"used\", \"createdAt\" } ] }`, `color` = `#rrggbbaa` (malými písmeny; vstup `#rrggbb` dostane `ff`), `used` = počet seznamů, segmentů, kampaní a scénářů se štítkem. POST `{name, color}` → 201; jméno 1 až 40 znaků, bez ohledu na velikost písmen unikátní (jinak 409 `conflict`). PATCH `{name?, color?}`: přejmenování přejmenuje štítek i na záznamech. DELETE štítek ze záznamů odebere → 204. `assign` tělo `{lists?, segments?, campaigns?, automations?: [id]}` (každý druh potřebuje plný přístup ve svém modulu, cizí id 400 `validation`) → `{updated}`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"label_id","in":"path","required":true,"description":"Id of the label (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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":"labels_update","summary":"Update a label","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"label_id","in":"path","required":true,"description":"Id of the label (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"color":{"type":"string"}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}},"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}/labels/{label_id}/assign":{"post":{"operationId":"labels_assign","summary":"Assign a label to objects","tags":["Account"],"description":"{lists?, segments?, campaigns?, automations?: [ids]} get the label (each kind needs full rights in its module).\n\nContract notes (cs):\n\nŠtítky účtu (SE Nastavení › Firma › Štítky, migrace 0150, modul `content`: čtení GET, plný přístup ostatní). `{ \"items\": [ { \"id\", \"name\", \"color\", \"used\", \"createdAt\" } ] }`, `color` = `#rrggbbaa` (malými písmeny; vstup `#rrggbb` dostane `ff`), `used` = počet seznamů, segmentů, kampaní a scénářů se štítkem. POST `{name, color}` → 201; jméno 1 až 40 znaků, bez ohledu na velikost písmen unikátní (jinak 409 `conflict`). PATCH `{name?, color?}`: přejmenování přejmenuje štítek i na záznamech. DELETE štítek ze záznamů odebere → 204. `assign` tělo `{lists?, segments?, campaigns?, automations?: [id]}` (každý druh potřebuje plný přístup ve svém modulu, cizí id 400 `validation`) → `{updated}`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"label_id","in":"path","required":true,"description":"Id of the label (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelTargets"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"]}}}},"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}/landing-pages":{"get":{"operationId":"landing_pages_index","summary":"List landing pages","tags":["Templates"],"description":"{items: LandingPageSummary[]} without the HTML.","parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LandingPageSummary"}}},"required":["items"]}}}},"400":{"description":"`validation` (message: sort)","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":"landing_pages_create","summary":"Create a landing page","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPageInput"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"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}/landing-pages/{landing_page_id}":{"delete":{"operationId":"landing_pages_delete","summary":"Delete a landing page","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"landing_page_id","in":"path","required":true,"description":"Id of the landing page (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"landing_pages_show","summary":"Get a landing page","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"landing_page_id","in":"path","required":true,"description":"Id of the landing page (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"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":"landing_pages_update","summary":"Update a landing page","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"landing_page_id","in":"path","required":true,"description":"Id of the landing page (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"},"html":{"type":"string"}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"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}/landing-pages/{landing_page_id}/copy":{"post":{"operationId":"landing_pages_copy","summary":"Copy a landing page","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"landing_page_id","in":"path","required":true,"description":"Id of the landing page (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"suffix":{"type":"string"}},"required":["suffix"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"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}/lists":{"get":{"operationId":"lists_index","summary":"List contact lists","tags":["Lists"],"description":"Contact lists with member counts by bucket. shop = lists of the shop and of the whole company.\n\nFiltry of the grid (routes_grid.py): ?tag= (repeatable, every label), ?idFrom=&idTo=, ?createdFrom=&createdTo= (calendar days), ?membersFrom=&membersTo= (members of any state except removed), ?activeFrom=&activeTo= (SE's Počet aktivních kontaktů), ?publicName= (part of the public name).\n\nContract notes (cs):\n\nParametry: `q` (část názvu nebo veřejného názvu, bez ohledu na velká písmena a diakritiku), `shop` (seznamy e-shopu **a** seznamy bez e-shopu; e-shop jiného tenanta = 400), `tag`, `sort` (obecná pravidla), `page`, `pageSize`. Výchozí řazení: nejnovější první.","parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"name":"publicName","in":"query","required":false,"schema":{"type":"string"}},{"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":"tag","in":"query","required":false,"schema":{"type":"string"},"description":"Tag filter."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_lists","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactListSummary"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: publicName, q, sort, 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":"lists_create","summary":"Create a list","tags":["Lists"],"description":"Creates a manual list.\n\nContract notes (cs):\n\nTělo `ListInput`: `{ \"name\", \"publicName\", \"shopId\" (null = celá firma), \"notifyOnUnsubscribe\", \"notifyOnAdd\", \"note\", \"tags\", \"signatureHtml\" }`, povinné je jen `name`. Vrací 201 nebo 200 s `ContactListDetail` (vždy ruční seznam). Texty se ořežou. Chyby: 400 `name` (prázdný nebo nad 100 znaků), `publicName` (nad 100), `note` (nad 1 000), `signatureHtml` (nad 5 000 znaků; nebezpečné značky a atributy se odstraní), `shop`; 409 `conflict` / `name`, když název v tenantu už existuje (přesná shoda jako `UNIQUE (tenant_id, name)`).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInput"},"examples":{"contacts-list-create":{"summary":"docs/api-examples/contacts.json list-create","value":{"name":"VIP zákazníci","publicName":"Novinky pro VIP","shopId":null,"notifyOnUnsubscribe":false,"notifyOnAdd":false,"note":""}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"create_list","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListDetail"},"examples":{"contacts-list-create":{"summary":"docs/api-examples/contacts.json list-create","value":{"id":"41","name":"VIP zákazníci","publicName":"Novinky pro VIP","shopId":null,"systemKind":null,"locked":false,"manualMembers":true,"tags":[],"counts":{"total":0,"byBucket":{"active":0,"unconfirmed":0,"unsubscribed":0,"bounced":0,"complained":0,"blacklisted":0}},"createdAt":"2026-10-01T08:00:00.000Z","notifyOnUnsubscribe":false,"notifyOnAdd":false,"note":""}}}}}},"400":{"description":"`validation` (message: replyTo, senderEmail, senderName, signatureHtml, tags)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked, name)","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}/lists/merge":{"post":{"operationId":"lists_merge","summary":"Merge lists into a new list (background)","tags":["Lists"],"description":"Bulk action Sloučit seznamy kontaktů (SZ-07): body {listIds (2 to 100), name, deleteSources}. Creates the new list named name now (409 conflict name_taken) and merges the members in the background (202 {list, jobId}; the notification list_merged tells when it is done). A contact in more lists keeps its most cautious state, nobody is subscribed again. deleteSources deletes the original lists afterwards (only the lists; 409 conflict locked when one of them is a system list).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMergeInput"}}},"description":"Required by the server: listIds, name."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMergeResult"}}}},"400":{"description":"`validation` (message: listIds, replyTo, senderEmail, senderName, signatureHtml, tags)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked, name)","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}/lists/tags":{"post":{"operationId":"lists_tags","summary":"Change labels of lists","tags":["Lists"],"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":"contacts","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}/lists/{list_id}":{"delete":{"operationId":"lists_delete","summary":"Delete a list (only the list, with its contacts, or keeping contacts in other lists)","tags":["Lists"],"description":"Deletes a manual list (memberships go, contacts stay).\n\nSE's Smazat seznam with its three ways (?mode=, SZ-08): list (default) = only the list, its contacts stay (204); with_contacts = the list and its contacts, keep_used = the list and those of its contacts that are in no other list or segment: both run in the background (202 {jobId}; the notification list_deleted tells when it is done). Unsubscribed contacts keep their suppression, contacts a campaign was just sent to stay. 409 conflict locked for a system list.\n\nContract notes (cs):\n\nSmaže ruční nebo formulářový seznam (kontakty zůstávají, členství zmizí). Seznam napojení na e-shop (`locked`) = 409 `conflict` / `locked`, neznámý 404. Odpověď 204. UI: ⋮ řádku a hromadná akce přehledu seznamů.\n\nPoložka `ContactListSummary`:\n```json\n{ \"id\": \"106\", \"name\": \"VIP zákazníci CZ\", \"publicName\": \"Věrní zákazníci\", \"shopId\": \"11\",\n  \"systemKind\": null, \"locked\": false, \"manualMembers\": true, \"createdAt\": \"…\",\n  \"counts\": { \"total\": 14, \"byBucket\": { \"active\": 12, \"unconfirmed\": 0, \"unsubscribed\": 1, \"bounced\": 1, \"complained\": 0, \"blacklisted\": 0 } } }\n```\n• `systemKind` = `lists.system_kind` (`shop_contacts`, `shop_newsletter`, `shop_unsubscribed`, `form`, nebo null u ručního seznamu). `locked` = systémový seznam nejde smazat.\n• `manualMembers` = do seznamu jde ručně přidávat a odebírat. Seznamy plněné napojením na e-shop (`shop_contacts`, `shop_newsletter`, `shop_unsubscribed`) mají false, seznamy formuláře a ruční true.\n• Počty: každý člen (bez stavu `removed`) spadne právě do jedné skupiny v tomto pořadí: `blacklisted` (potlačení s důvodem `manual`), `bounced` (stav kontaktu `bounced` nebo potlačení `hard_bounce`, `soft_bounce_limit`, `invalid`), `complained` (stav `complained` nebo potlačení `complaint`), `unsubscribed` (odhlášený ze seznamu, globálně odhlášený nebo potlačení `unsubscribed`), `unconfirmed` (nepotvrzený v seznamu nebo stav `pending`), jinak `active`. `total` = součet skupin.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (string of digits).","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"delete_list","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListJobQueued"}}}},"400":{"description":"`validation` (message: mode)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked)","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":"lists_show","summary":"Get a list","tags":["Lists"],"description":"One list with counts and settings.\n\nContract notes (cs):\n\n`ContactListDetail` = `ContactListSummary` a navíc `notifyOnUnsubscribe`, `notifyOnAdd`, `note`, `signatureHtml` (podpis seznamu v HTML, značka `{{cl_signature}}` e-mailů pro seznam; SE Podpis v e-mailu pro tento seznam kontaktů).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_list","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListDetail"}}}},"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":"lists_update","summary":"Update a list","tags":["Lists"],"description":"Changes a list (name, public name, notifications, note).\n\nContract notes (cs):\n\nTělo: libovolná podmnožina `ListInput`. Systémovému seznamu nejde změnit e-shop (400 `shop`), přejmenovat ho jde. Vrací `ContactListDetail`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"publicName":{"type":"string"},"shopId":{"type":["string","null"]},"notifyOnUnsubscribe":{"type":"boolean"},"notifyOnAdd":{"type":"boolean"},"note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"signatureHtml":{"type":"string"},"senderEmail":{"type":"string"},"senderName":{"type":"string","description":"SE's sendername and replyto of a list (API only in SE, SZ-04)."},"replyTo":{"type":"string"}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"update_list","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListDetail"}}}},"400":{"description":"`validation` (message: replyTo, senderEmail, senderName, signatureHtml, tags)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked, name)","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}/lists/{list_id}/autofill":{"post":{"operationId":"lists_autofill","summary":"Fill empty name day, gender and salutations of the members","tags":["Lists"],"description":"Row menu \"Doplnit svátek, pohlaví a pozdrav\" (SZ-06, core/contact_autofill.py): fills only empty fields of the members; {members, contacts, fields: {column: contacts}}.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAutofillResult"}}}},"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}/lists/{list_id}/copy":{"post":{"operationId":"lists_copy","summary":"Copy a list with its members","tags":["Lists"],"description":"Row menu \"Vytvořit kopii seznamu\" (SZ-06): body {name}; 201 with the new list (members in their states, no automation starts), 404 unknown list, 409 conflict name_taken.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}},"description":"Required by the server: name."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListDetail"}}}},"400":{"description":"`validation` (message: replyTo, senderEmail, senderName, signatureHtml, tags)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked, name)","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}/lists/{list_id}/members":{"get":{"operationId":"lists_members","summary":"List members of a list","tags":["Lists"],"description":"Members of a list. bucket: active, unconfirmed, unsubscribed, bounced, complained, blacklisted.\n\nContract notes (cs):\n\nParametry: `q` (jako u kontaktů), `bucket` (`active`, `unconfirmed`, `unsubscribed`, `bounced`, `complained`, `blacklisted`; bez parametru všichni), `page`, `pageSize`. Řazení: nejnovější kontakt první. Položka `ListMember` = `ContactListItem` a navíc `listState` (`confirmed`, `unconfirmed`, `unsubscribed`; odebraní se nevrací), `bucket`, `addedAt`, `changedAt`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (string of digits).","schema":{"type":"string"}},{"name":"bucket","in":"query","required":false,"schema":{"type":"string","enum":["active","unconfirmed","unsubscribed","bounced","complained","blacklisted"]},"description":"Bucket filter."},{"name":"createdFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"createdTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"schema":{"type":"string"}},{"name":"import","in":"query","required":false,"schema":{"type":"string"}},{"name":"list","in":"query","required":false,"schema":{"type":"string"}},{"name":"listState","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Search text."},{"$ref":"#/components/parameters/shop"},{"$ref":"#/components/parameters/sort"},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Status filter."},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_list_members","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ListMember"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]},"examples":{"contacts-list-members":{"summary":"docs/api-examples/contacts.json list-members","value":{"items":[{"id":"1202","email":"jana.novakova@example.cz","firstName":"Jana","lastName":"Nováková","status":"subscribed","engagement":"N","excluded":false,"shopId":"3","suppressionReason":null,"blacklisted":false,"blacklistedAt":null,"state":"active","createdAt":"2026-10-01T08:00:00.000Z","listState":"confirmed","bucket":"active","addedAt":"2026-10-01T08:00:00.000Z","changedAt":"2026-10-01T08:00:00.000Z"}],"total":1,"page":1,"pageSize":25}}}}}},"400":{"description":"`validation` (message: q, sort)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked, name)","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":"lists_add_members","summary":"Add contacts to a list","tags":["Lists"],"description":"Adds contacts to a manual list (1 to 1000 ids). Never re-subscribes anyone who unsubscribed.\n\nContract notes (cs):\n\nTělo `{ \"contactIds\": [\"1001\", \"1002\"] }`, 1 až 1 000 id kontaktů tenanta (jinak 400 `contactIds` a nic se nezmění; duplicity se počítají jednou). Systémový seznam = 409 `locked`. Odpověď `{ \"added\", \"alreadyMember\", \"skipped\" }`:\n• `alreadyMember`: kontakt už je v seznamu potvrzený nebo nepotvrzený.\n• `skipped`: kontakt se ze seznamu odhlásil, nebo je odhlášený, vrácený, se stížností či na seznamu potlačení. **Ruční přidání nikoho znovu nepřihlásí.**\n• `added`: nový člen, nebo dříve odebraný (`removed`). Stav `confirmed`, u kontaktu ve stavu `pending` `unconfirmed`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactIds":{"type":"array","items":{"type":"string"}}},"required":["contactIds"]},"examples":{"contacts-list-add":{"summary":"docs/api-examples/contacts.json list-add","value":{"contactIds":["1202"]}}}}},"description":"Required by the server: contactIds."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"trigger","x-mcp-tool":"add_list_members","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMembersResult"},"examples":{"contacts-list-add":{"summary":"docs/api-examples/contacts.json list-add","value":{"added":1,"alreadyMember":0,"skipped":0}}}}}},"400":{"description":"`validation` (message: contactIds)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked)","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}/lists/{list_id}/members/remove":{"post":{"operationId":"lists_remove_members","summary":"Remove contacts from a list","tags":["Lists"],"description":"Removes contacts from a manual list.\n\nContract notes (cs):\n\nTělo `{ \"contactIds\": [...] }` se stejnou kontrolou. Potvrzený a nepotvrzený člen dostane stav `removed` (řádek a historie zůstávají). Člen, který se ze seznamu odhlásil, zůstane `unsubscribed`, aby ho pozdější přidání znovu nepřihlásilo. Odpověď `{ \"removed\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (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":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"remove","x-mcp-tool":"remove_list_members","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveMembersResult"}}}},"400":{"description":"`validation` (message: contactIds)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked)","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}/lists/{list_id}/members/unsubscribe":{"post":{"operationId":"lists_unsubscribe_members","summary":"Unsubscribe contacts from a list","tags":["Lists"],"description":"Unsubscribes the given members from this list only (body {contactIds}); 409 locked for lists filled by an e-shop connection. Answers {unsubscribed: n}.\n\nContract notes (cs):\n\nTělo `{ \"contactIds\": [...] }` se stejnou kontrolou. Potvrzený a nepotvrzený člen dostane stav `unsubscribed` jen v tomto seznamu (karta kontaktu, tab Seznamy: „Odhlásit kontakt ze seznamu“); stav kontaktu a ostatní seznamy se nemění, nikdo se tím znovu nepřihlásí. Seznam plněný napojením e-shopu = 409 `locked`. Odpověď `{ \"unsubscribed\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"list_id","in":"path","required":true,"description":"Id of the list (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":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"unsubscribed":{"type":"number"}},"required":["unsubscribed"]}}}},"400":{"description":"`validation` (message: contactIds)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: locked)","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}/maintenance/phone-landline-mobile":{"post":{"operationId":"maintenance_phone_landline_mobile","summary":"Maintenance: move landline-stored mobile numbers to mobile (dry run unless apply)","tags":["Account"],"description":"Owner, 13. 10. 2026: contacts whose phone (landline, \"Pevná linka\") in fact holds a mobile number (core/ phone.py classify_contact_field, from before that module existed) move it into mobile, only while mobile is still empty and nobody edited phone or mobile by hand; a true landline stays. Body {apply}, a dry run by default. 200 {checked, moved, keptLandline, keptEdited, applied}.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"apply":{}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"checked":{"type":"integer"},"moved":{"type":"integer"},"keptLandline":{"type":"integer"},"keptEdited":{"type":"integer"},"applied":{"type":"boolean"}},"required":["checked","moved","keptLandline","keptEdited","applied"]}}}},"400":{"description":"`validation` (message: apply)","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}/maintenance/se-backfill-contacts":{"post":{"operationId":"maintenance_se_backfill","summary":"Maintenance: fill empty contact fields from a SmartEmailing backup (dry run unless apply)","tags":["Account"],"description":"MG-01, AN-01 (core/se_backfill.run_records): body {contacts: [{email, column: value}] (records_to_json, a part of the export is fine), audienceFields: false, shopCustomers: false, apply}. Fills only empty fields; apply also recomputes the engagement grades. A large backfill goes in parts with reach: false and recompute: false (both default true) on all but the last part, so each call stays far under the 60 s request limit. 200 {counts per field ..., automations, applied}.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apply":{},"contacts":{}},"required":["contacts"]}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Counts only (never an address), applied (false = dry run) and automations (active scenarios that read what would change). routes_maintenance.py."}}}},"400":{"description":"`validation` (message: apply, contacts)","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}/maintenance/shop-enrich":{"post":{"operationId":"maintenance_shop_enrich","summary":"Maintenance: fill empty contact fields from the e-shop feeds (dry run unless apply)","tags":["Account"],"description":"Contact data from the e-shop feeds (core/shop_enrich.run): body {apply}. Fills only empty fields from the customer accounts, the delivery data and the shop's language, derives gender, name day and salutations; apply also turns on the ongoing enrichment of the feed imports (phones and billing addresses come with the next whole order export). 200 {contacts, matched, contactsChanged, fill, language, derived, keptEdited, automationReach: [{id, name, nameDay, before, after, new, newPerMonth, newNext30Days}] (mailable contacts that may enter each active repeat automation before and after), ongoingBefore, ongoing, applied}.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apply":{"type":"boolean"}},"required":["apply"]}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Counts only (never an address), applied (false = dry run) and automations (active scenarios that read what would change). routes_maintenance.py."}}}},"400":{"description":"`validation` (message: apply, reach)","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}/maintenance/shop-lists":{"post":{"operationId":"maintenance_shop_lists","summary":"Maintenance: rebuild the e-shop lists (dry run unless apply)","tags":["Account"],"description":"SZ-09, KK-09 (core/shop_lists.sync): body {seBackup: {lists: {se id: name}, members: {se id: [[address, state]]}} (optional), apply}. 200 {counts, lists: [{name, kind, action, members}], automations: active scenarios reading what changes, applied}.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"apply":{},"seBackup":{}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Counts only (never an address), applied (false = dry run) and automations (active scenarios that read what would change). routes_maintenance.py."}}}},"400":{"description":"`validation` (message: apply)","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}/notifications":{"get":{"operationId":"notifications_list","summary":"List notifications","tags":["Account"],"description":"Notifications of the account (import finished, campaign sent or paused, automation paused...), newest first, with the unread count.\n\nContract notes (cs):\n\n`{ \"items\": [ { \"id\", \"type\", \"params\", \"important\", \"read\", \"createdAt\" } ], \"unread\": 3 }`, nejnovější první. `type`: `import_finished`, `campaign_sent`, `domain_verified`, `bounce_warning`, `export_ready`, `automation_paused`, `list_contacts_added`, `list_unsubscribed`, `campaign_paused`, `automation_notice`, `se_sync_problem` (hodinová synchronizace ze SmartEmailingu neproběhla, důležitá, `{status: failed | late, problem}`). `params` jsou hodnoty pro text `notifications.type.<type>` v `src/locales`; čísla formátuje UI.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"x-mcp-tool":"list_notifications","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/notifications/delete":{"post":{"operationId":"notifications_delete","summary":"Delete notifications","tags":["Account"],"description":"{ids: [...]} removes those notifications, {all: true} every notification of the tenant (SE \"Smazat vše\").\n\nContract notes (cs):\n\n`{ids: [...]}` smaže ty notifikace tenanta (cizí a neznámá id ignoruje), `{all: true}` všechny (SE „Smazat vše“) → 204; jinak 400 `validation` / `ids`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"}},"required":["all"]},{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"]}]}}}},"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"responses":{"204":{"description":"No content"},"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}/notifications/read":{"post":{"operationId":"notifications_read","summary":"Mark notifications as read","tags":["Account"],"description":"Contract notes (cs):\n\nTělo `{ \"ids\": [\"n-1\", \"n-2\"] }`. 204. Neznámá id a id jiného tenanta server ignoruje.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"]}}},"description":"Required by the server: ids."},"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"responses":{"204":{"description":"No content"},"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}/notifications/unread":{"post":{"operationId":"notifications_unread","summary":"Mark notifications as unread","tags":["Account"],"description":"SE \"Označit jako nepřečtené\": {ids: [...]}.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"]}}},"description":"Required by the server: ids."},"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"responses":{"204":{"description":"No content"},"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}/onboarding":{"get":{"operationId":"onboarding_show","summary":"State of the onboarding wizard","tags":["Account"],"description":"The onboarding wizard's state (core/onboarding.py).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingState"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"onboarding_update","summary":"Save the onboarding wizard","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingPatch"}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingState"}}}},"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}/order-states":{"get":{"operationId":"order_states_show","summary":"Get the order state mapping","tags":["Orders and feeds"],"description":"Contract notes (cs):\n\n`GET` vrací `{states, items: [{sourceStatus, match: exact | prefix, state}], seen: [{sourceStatus, shopId, orders, state, origin: map | shop | none | invalid}]}`. `PUT {items}` pravidla nahradí, přemapuje uložené objednávky a vrátí totéž plus `changed`. Pravidla nerozlišují velikost písmen a mezery a názvy mají nejvýš 80 znaků. Delší název stavu v objednávce je chyba synchronizace: stav `other` a záznam v logu.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"states":{"type":"array","items":{"type":"string"},"description":"Canonical states: new, unpaid, paid, processing, shipped, pickup, delivered, cancelled, returned, other (unknown)."},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderStateRule"}},"seen":{"type":"array","description":"State names seen in orders with their effective state.","items":{"type":"object","properties":{"sourceStatus":{"type":"string"},"shopId":{"type":"string"},"orders":{"type":"integer"},"state":{"type":"string"},"origin":{"type":"string","enum":["map","shop","none","invalid"]}}}}},"description":"routes_orders.state_map_json"},"examples":{"post-purchase-order-states":{"summary":"docs/api-examples/post-purchase.json order-states","value":{"states":["new","unpaid","paid","processing","shipped","delivered","cancelled","returned","other"],"items":[],"seen":[]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"order_states_replace","summary":"Replace the order state mapping","tags":["Orders and feeds"],"description":"Replaces the rules and re-maps the stored orders (no order events).\n\nContract notes (cs):\n\n`GET` vrací `{states, items: [{sourceStatus, match: exact | prefix, state}], seen: [{sourceStatus, shopId, orders, state, origin: map | shop | none | invalid}]}`. `PUT {items}` pravidla nahradí, přemapuje uložené objednávky a vrátí totéž plus `changed`. Pravidla nerozlišují velikost písmen a mezery a názvy mají nejvýš 80 znaků. Delší název stavu v objednávce je chyba synchronizace: stav `other` a záznam v logu.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/OrderStateRule"},"description":"The new rules (replace all)."}},"required":["items"]}}},"description":"Required by the server: items."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"states":{"type":"array","items":{"type":"string"},"description":"Canonical states: new, unpaid, paid, processing, shipped, pickup, delivered, cancelled, returned, other (unknown)."},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderStateRule"}},"seen":{"type":"array","description":"State names seen in orders with their effective state.","items":{"type":"object","properties":{"sourceStatus":{"type":"string"},"shopId":{"type":"string"},"orders":{"type":"integer"},"state":{"type":"string"},"origin":{"type":"string","enum":["map","shop","none","invalid"]}}}},"changed":{"type":"integer"}},"description":"routes_orders.state_map_json"}}}},"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}/orders":{"get":{"operationId":"orders_list","summary":"List orders","tags":["Orders and feeds"],"description":"Orders, filtered by contact, shop, state or text. Money per currency, never summed across currencies.\n\nContract notes (cs):\n\n`contactId`, `shop`, `state`, `q` (kód objednávky, id nebo e-mail), `page`, `pageSize` → `Page<Order>` bez smazaných objednávek, nejnovější první, u každé jen první 3 položky. Cizí nebo neznámý `contactId` vrací 400.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"contactId","in":"query","required":false,"schema":{"type":"string"},"description":"Contact id."},{"$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."},{"name":"state","in":"query","required":false,"schema":{"type":"string"},"description":"Order state."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_contact_orders","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: contactId, q, state)","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":"orders_save","summary":"Create or update an order","tags":["Orders and feeds"],"description":"Creates or updates one order by (shop, id): 201 created, 200 updated or unchanged.\n\nContract notes (cs):\n\nSchéma Orders API SE: `{id, shopId, createdAt, paidAt?, email? | contactId?, status, eshopCode?, orderUrl?, currency?, totalWithVat?, totalWithoutVat?, companyId?, deleted?, seller?, orderDelivery?, items: [{id, name, description?, price: {withVat?, withoutVat?, currency?}, quantity?, unit?, url?, imageUrl?, attributes?}]}`. `status` je název stavu v e-shopu. Odpověď je `{change, order}`: 201 `created`, nebo 200 `updated` / `unchanged` (opakované doručení nic nezapíše). Kupující bez kontaktu dostane kontakt ve stavu `customer`. Chyby: 400 `validation` s `message` = pole (`order` s `params.reason`, `items`, `shopId`, `contactId` nebo neznámý klíč).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":["string","integer"],"description":"Order id in the e-shop (1 to 100 characters). The order is created or updated by (shopId, id)."},"shopId":{"type":"string","description":"Shop of the order."},"createdAt":{"type":"string","description":"ISO 8601 with a time zone, e.g. 2026-10-12T09:30:00+02:00."},"paidAt":{"type":["string","null"]},"email":{"type":"string","description":"Buyer e-mail (or contactId). A buyer without a contact gets one without marketing consent (status customer, never e-mailed)."},"contactId":{"type":"string","description":"Existing contact (its e-mail must match email when both)."},"status":{"type":"string","description":"State name of the e-shop (at most 200), mapped to a canonical state by GET/PUT /order-states. Unmapped names are other (never a purchase)."},"eshopCode":{"type":"string"},"orderUrl":{"type":"string"},"companyId":{"type":"string"},"currency":{"type":"string","description":"Default and only allowed value: the shop currency."},"totalWithVat":{"type":["string","number"]},"totalWithoutVat":{"type":["string","number"]},"seller":{"type":"object"},"orderDelivery":{"type":"object"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":["string","integer"],"description":"Product code (SKU) of the item."},"name":{"type":"string","description":"Required, at most 500 characters."},"description":{"type":"string"},"quantity":{"type":["number","string"],"description":"Default 1."},"unit":{"type":"string"},"price":{"type":"object","properties":{"withVat":{"type":["string","number"]},"withoutVat":{"type":["string","number"]},"currency":{"type":"string","description":"Must be the shop currency."}}},"url":{"type":"string"},"imageUrl":{"type":"string"},"attributes":{"type":"object","description":"Feed attributes (Category, Brand ...), at most 50."}},"required":["name"]},"maxItems":1000},"deleted":{"type":"boolean","description":"true = the order is deleted (ends post-purchase runs)."}},"required":["id","shopId","createdAt","status"]},"examples":{"post-purchase-order":{"summary":"docs/api-examples/post-purchase.json order","value":{"id":"2026001234","shopId":"13","createdAt":"2026-10-01T09:30:00+02:00","paidAt":"2026-10-01T09:31:00+02:00","email":"karel.vesely@example.cz","status":"Zaplaceno","eshopCode":"2026001234","orderUrl":"https://www.example.cz/objednavka/2026001234","currency":"CZK","totalWithVat":"1290.00","totalWithoutVat":"1066.12","items":[{"id":"KAVA-1KG","name":"Káva Kolumbie 1 kg","quantity":1,"unit":"ks","price":{"withVat":"1290.00","withoutVat":"1066.12","currency":"CZK"},"url":"https://www.example.cz/kava-kolumbie","attributes":{"Category":"Káva","Brand":"Example"}}]}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"trigger","responses":{"201":{"description":"Created (200 when it already existed or nothing changed)","content":{"application/json":{"schema":{"type":"object","properties":{"change":{"type":"string","enum":["created","updated","unchanged"]},"order":{"$ref":"#/components/schemas/Order"}},"required":["change","order"]},"examples":{"post-purchase-order":{"summary":"docs/api-examples/post-purchase.json order","value":{"change":"created","order":{"id":"5001","externalId":"2026001234","eshopCode":"2026001234","eshopName":"Example.cz","shopId":"13","createdAt":"2026-10-01T07:30:00.000Z","paidAt":"2026-10-01T07:31:00.000Z","email":"karel.vesely@example.cz","contactId":"1205","state":"paid","status":"completed","sourceStatus":"Zaplaceno","orderUrl":"https://www.example.cz/objednavka/2026001234","currency":"CZK","totalWithVat":"1290.00","totalWithoutVat":"1066.12","itemCount":1,"items":[{"id":"1","productCode":"KAVA-1KG","name":"Káva Kolumbie 1 kg","description":"","price":{"withVat":"1290.00","withoutVat":"1066.12","currency":"CZK"},"quantity":1,"unit":"ks","url":"https://www.example.cz/kava-kolumbie","imageUrl":"","attributes":{"Brand":"Example","Category":"Káva"},"paired":false}],"conversion":null,"deleted":false,"receivedAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","seller":{},"orderDelivery":{}}}}}}}},"200":{"description":"OK: it already existed or nothing changed","content":{"application/json":{"schema":{"type":"object","properties":{"change":{"type":"string","enum":["created","updated","unchanged"]},"order":{"$ref":"#/components/schemas/Order"}},"required":["change","order"]},"examples":{"post-purchase-order":{"summary":"docs/api-examples/post-purchase.json order","value":{"change":"created","order":{"id":"5001","externalId":"2026001234","eshopCode":"2026001234","eshopName":"Example.cz","shopId":"13","createdAt":"2026-10-01T07:30:00.000Z","paidAt":"2026-10-01T07:31:00.000Z","email":"karel.vesely@example.cz","contactId":"1205","state":"paid","status":"completed","sourceStatus":"Zaplaceno","orderUrl":"https://www.example.cz/objednavka/2026001234","currency":"CZK","totalWithVat":"1290.00","totalWithoutVat":"1066.12","itemCount":1,"items":[{"id":"1","productCode":"KAVA-1KG","name":"Káva Kolumbie 1 kg","description":"","price":{"withVat":"1290.00","withoutVat":"1066.12","currency":"CZK"},"quantity":1,"unit":"ks","url":"https://www.example.cz/kava-kolumbie","imageUrl":"","attributes":{"Brand":"Example","Category":"Káva"},"paired":false}],"conversion":null,"deleted":false,"receivedAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","seller":{},"orderDelivery":{}}}}}}}},"400":{"description":"`validation` (message: contactId, items, order)","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}/orders/paid-at":{"post":{"operationId":"maintenance_orders_paid_at","summary":"Maintenance: fill empty dates of payment of orders (SmartEmailing data)","tags":["Orders and feeds"],"description":"ES-01 (core/orders.set_paid_at): the dates of payment SmartEmailing kept, for orders whose e-shop export has none. Body {items: [{shop: shop code, code: the e-shop's order number, paidAt: ISO time with an offset or Z, or \"YYYY-MM-DD HH:MM[:SS]\" in the tenant's local time}] (1 to 5 000), dryRun: bool (required)}. Sets orders.paid_at only where it is empty, never overwrites one, writes no order event. 200 {updated, alreadySet, notFound, dryRun}.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dryRun":{},"items":{}},"required":["dryRun","items"]}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer"},"alreadySet":{"type":"integer"},"notFound":{"type":"integer"},"dryRun":{"type":"boolean"}},"required":["updated","alreadySet","notFound","dryRun"]}}}},"400":{"description":"`validation` (message: dryRun, items)","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}/orders/{order_id}":{"get":{"operationId":"orders_show","summary":"Get an order","tags":["Orders and feeds"],"description":"Contract notes (cs):\n\nDetail `Order` se všemi položkami.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"order_id","in":"path","required":true,"description":"Id of the order (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"post-purchase-order-show":{"summary":"docs/api-examples/post-purchase.json order-show","value":{"id":"5001","externalId":"2026001234","eshopCode":"2026001234","eshopName":"Example.cz","shopId":"13","createdAt":"2026-10-01T07:30:00.000Z","paidAt":"2026-10-01T07:31:00.000Z","email":"karel.vesely@example.cz","contactId":"1205","state":"paid","status":"completed","sourceStatus":"Předáno zákazníkovi","orderUrl":"","currency":"CZK","totalWithVat":"1290.00","totalWithoutVat":null,"itemCount":1,"items":[{"id":"2","productCode":"KAVA-1KG","name":"Káva Kolumbie 1 kg","description":"","price":{"withVat":"1290.00","withoutVat":null,"currency":"CZK"},"quantity":1,"unit":"","url":"","imageUrl":"","attributes":{},"paired":false}],"conversion":null,"deleted":false,"receivedAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","seller":{},"orderDelivery":{}}}}}}},"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}/purposes":{"get":{"operationId":"purposes_index","summary":"List purposes of processing (consent types)","tags":["Contacts"],"description":"Purposes of processing (consents) with legal basis and validity.\n\nContract notes (cs):\n\n`{ \"items\": [ { \"id\", \"name\", \"legalBasis\", \"validityDays\" } ] }`, `legalBasis` jako `purposes.legal_basis` (`consent`, `contract`, `legal_obligation`, `legitimate_interest`, `vital_interest`, `public_interest`), `validityDays` null = bez pevné lhůty.\n• Vlna account (migrace 0261, 0262): položka má navíc `validity` `{ \"value\", \"unit\" }` (jednotky SE `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, `years`; null = bez pevné lhůty; účel uložený dřív ukáže dny, celé roky když jsou dělitelné 365) a `notes`, `consents`, `createdAt`. `POST …/purposes` a `PATCH …/purposes/{id}` přijímají `validity` místo `validityDays` (měsíc = 30 dní, rok = 365 dní jako dosud, nejvýš 36 500 dní; chyba 400 `validity`).\n• `POST …/purposes/{id}/to-contact-list` `{ \"listId\" }` (SE „Přidat ke kontaktům v seznamu“): souhlas s účelem od teď (konec podle délky účelu) pro potvrzené a nepotvrzené členy seznamu, kteří ho ještě nemají; odhlášené a odebrané vynechá, nikoho nepřihlásí. Odpověď `{ \"count\" }`, notifikace `purpose_assigned_list`. Cizí nebo neznámý účel či seznam 404, špatné `listId` 400.\n• `POST /tenants/{t}/notifications/unread` `{ \"ids\": [...] }` (SE „Označit jako nepřečtené“, nejvýš 500 id): notifikace firmy znovu nepřečtené, cizí id se ignorují; 204.\n• `GET /tenants/{t}/running-actions` (SE „Probíhající akce“, UI-03): `{ \"items\": [ { \"id\", \"kind\", \"status\": \"queued\" | \"running\", \"since\" } ] }` = úlohy firmy na pozadí, které běží nebo čekají na spuštění (`import_run`, `import_doi`, `export_run`, `feed_refresh`, `order_feed_refresh`, `se_discover`, `se_sync_suppressions`, `engagement_recompute`), nejstarší první, nejvýš 20; bez obsahu úlohy.\n• `GET …/rfm` → `{ \"enabled\": false, \"requested\", \"requestedAt\" }`; `POST …/rfm/enable-request` (SE „Zapnout RFM analýzu“) zapíše žádost jednou (druhé volání vrátí první čas), nic nezapne.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_purposes","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Purpose"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"purposes_create","summary":"Create a purpose of processing","tags":["Contacts"],"description":"Creates a purpose of processing.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurposeInput"}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"create_purpose","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Purpose"}}}},"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}/purposes/{purpose_id}":{"delete":{"operationId":"purposes_delete","summary":"Delete a purpose of processing","tags":["Contacts"],"description":"Deletes an unused purpose of processing.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"purpose_id","in":"path","required":true,"description":"Id of the purpose (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"delete_purpose","responses":{"204":{"description":"No content"},"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: in_use)","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":"purposes_update","summary":"Update a purpose of processing","tags":["Contacts"],"description":"Changes a purpose of processing.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"purpose_id","in":"path","required":true,"description":"Id of the purpose (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"legalBasis":{"type":"string","enum":["consent","contract","legal_obligation","legitimate_interest","vital_interest","public_interest"]},"validityDays":{"type":["number","null"],"description":"Older callers send whole days; the purpose form sends validity."},"validity":{"anyOf":[{"$ref":"#/components/schemas/ValidityLength"},{"type":"null"}]},"notes":{"type":"string"}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"update_purpose","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Purpose"}}}},"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}/purposes/{purpose_id}/to-contact-list":{"post":{"operationId":"purposes_to_list","summary":"Create a list of the contacts with a purpose","tags":["Contacts"],"description":"SE \"Přidat ke kontaktům v seznamu\": body {listId}; answers {count} of the consents added.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"purpose_id","in":"path","required":true,"description":"Id of the purpose (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"listId":{"type":"string"}},"required":["listId"]}}},"description":"Required by the server: listId."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}}}},"400":{"description":"`validation` (message: listId)","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}/rfm":{"get":{"operationId":"rfm_state","summary":"State of the RFM analysis","tags":["Account"],"description":"SE GET rfm-analysis/model: Poštárna has no RFM model yet; whether the tenant asked for it.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RfmState"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/rfm/enable-request":{"post":{"operationId":"rfm_enable_request","summary":"Ask to enable the RFM analysis","tags":["Account"],"description":"SE \"Zapnout RFM analýzu\": records the request (once), switches nothing on.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RfmState"}}}},"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}/running-actions":{"get":{"operationId":"running_actions_index","summary":"Running background actions (imports, exports ...)","tags":["Account"],"description":"SE \"Probíhající akce\": background work of the tenant that runs or waits to run (core/jobs.running_actions).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RunningAction"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/script-templates":{"get":{"operationId":"script_templates_index","summary":"List script templates (Twig)","tags":["Templates"],"description":"{items: [{id, name, content, parses, createdAt, updatedAt}]}; ?q= (name or content contains), ?sort= id, name, content, createdAt, updatedAt with a leading '-' for descending (default -createdAt, SmartEmailing's grid).","parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ScriptTemplate"}}},"required":["items"]}}}},"400":{"description":"`validation` (message: sort)","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":"script_templates_create","summary":"Create a script template","tags":["Templates"],"description":"Body {name, content}: 201 with the template; 409 conflict name, 400 validation (field or limit).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptTemplateInput"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptTemplate"}}}},"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}/script-templates/{script_id}":{"delete":{"operationId":"script_templates_delete","summary":"Delete a script template","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"script_id","in":"path","required":true,"description":"Id of the script (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"script_templates_show","summary":"Get a script template","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"script_id","in":"path","required":true,"description":"Id of the script (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"content":{"type":"string"},"parses":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"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"}}},"patch":{"operationId":"script_templates_update","summary":"Update a script template","tags":["Templates"],"description":"Body {name?, content?}: the template.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"script_id","in":"path","required":true,"description":"Id of the script (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptTemplate"}}}},"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}/search":{"get":{"operationId":"search","summary":"Search contacts, campaigns, templates and more","tags":["Contacts"],"description":"Quick search over contacts and lists (at least 2 characters).\n\nContract notes (cs):\n\nHledání pro paletu ⌘K. `q` aspoň 2 znaky (jinak prázdný výsledek), bez ohledu na velká písmena a diakritiku. Odpověď `{ \"contacts\": [ContactListItem] (max 5), \"lists\": [ { \"id\", \"name\", \"size\" } ] (max 5) }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Search text."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"search","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResults"}}}},"400":{"description":"`validation` (message: q)","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}/segments":{"get":{"operationId":"segments_index","summary":"List segments","tags":["Segments"],"description":"Segments with matched and mailable counts.\n\nFiltry of the grid (routes_grid.py): ?tag= (repeatable), ?idFrom=&idTo=, ?createdFrom=&createdTo=, ?updatedFrom=&updatedTo= (calendar days), ?refresh=static|daily.\n\nContract notes (cs):\n\nParametry `q` (název), `shop`, `page`, `pageSize`; nejnovější první. Položka `SegmentSummary`: `{ \"id\", \"name\", \"publicName\", \"shopId\", \"refresh\", \"matched\", \"mailable\", \"computedAt\", \"ruleCount\", \"createdAt\", \"updatedAt\" }`.\n• `refresh`: `static` = snímek členů při uložení, `daily` = přepočet každých 24 hodin.\n• `matched` = kontakty e-shopu, které splní podmínky (v jakémkoli stavu). `mailable` = z nich přihlášené, bez potlačení a bez slabého souhlasu (výchozí podle D6), tedy kolik jich může dostat kampaň.\n• `computedAt` = čas posledního přepočtu (u statického segmentu čas uložení). Mock počítá denní segment živě.\n• `publicName`: pokročilé nastavení (se-spec 01 §3): název seznamu na odhlašovací stránce, když se segment použije jako rozesílatelný seznam; výchozí `\"\"` (bez vlastního jména).","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":"refresh","in":"query","required":false,"schema":{"type":"string"}},{"name":"shop","in":"query","required":false,"schema":{"type":"string"},"description":"Shop id filter."},{"$ref":"#/components/parameters/sort"},{"name":"tag","in":"query","required":false,"schema":{"type":"string"},"description":"Label filter; repeat for more labels."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_segments","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SegmentSummary"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: q, refresh, sort, 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":"segments_create","summary":"Create a segment","tags":["Segments"],"description":"Creates a segment of one shop from a condition tree {type: group, match: all|any, rules: [...]} (rule types: get_api_reference Segmenty).\n\nContract notes (cs):\n\nTělo `{ \"name\", \"publicName\"?, \"shopId\", \"refresh\"?, \"definition\", \"signatureHtml\"? }` (PATCH podmnožina; bez `refresh` je nový segment `static`, jako v SE „Automaticky obnovovat segment“ výchozí vypnuto). Chyby: 400 `name` (1 až 100 znaků), `publicName` (do 100 znaků), `signatureHtml` (do 5 000 znaků), `shop`, `refresh`, `definition…`; 409 `name` při obsazeném názvu. E-shop uloženého segmentu se nemění (400 `shop`), protože na něm stojí kampaně. Každé uložení statického segmentu udělá nový snímek.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentInput"},"examples":{"segments-create":{"summary":"docs/api-examples/segments.json create","value":{"name":"Aktivní a utrácející","shopId":"15","refresh":"daily","definition":{"type":"group","match":"all","rules":[{"type":"list","operator":"in","listId":"43"},{"type":"group","match":"any","rules":[{"type":"order_value","operator":"gte","amount":"3000","currency":"CZK","shopId":"15","days":"365"},{"type":"field","field":"lastClickAt","operator":"in_last_days","value":"30"}]}]}}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"create_segment","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentDetail"},"examples":{"segments-create":{"summary":"docs/api-examples/segments.json create","value":{"id":"31","name":"Aktivní a utrácející","publicName":"","shopId":"15","refresh":"daily","matched":0,"mailable":0,"computedAt":"2026-10-01T08:00:00.000Z","ruleCount":3,"tags":[],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","definition":{"type":"group","match":"all","rules":[{"type":"list","listId":"43","operator":"in"},{"type":"group","match":"any","rules":[{"days":"365","type":"order_value","amount":"3000","shopId":"15","currency":"CZK","operator":"gte"},{"type":"field","field":"lastClickAt","value":"30","operator":"in_last_days"}]}]},"signatureHtml":""}}}}}},"400":{"description":"`validation` (message: definition, refresh, signatureHtml, tags)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"segments-invalid":{"summary":"docs/api-examples/segments.json invalid","value":{"error":{"code":"validation","message":"definition.0.currency"}}}}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: name)","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}/segments/preview":{"post":{"operationId":"segments_preview","summary":"Count the contacts of a segment definition (no save)","tags":["Segments"],"description":"Counts a condition tree without saving: matched, mailable and total contacts of the shop.\n\nLive count for the editor: {matched, mailable, total}; the root may be empty (all contacts of the shop).\n\nContract notes (cs):\n\nTělo `{ \"shopId\", \"definition\" }` (smí mít prázdný kořen). Odpověď `{ \"matched\", \"mailable\", \"total\" }`, `total` = všechny kontakty e-shopu. Editor ji volá po každé změně (s krátkou prodlevou) pro živý počet.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shopId":{"type":"string"},"definition":{"$ref":"#/components/schemas/SegmentGroup"}},"required":["shopId","definition"]},"examples":{"segments-preview":{"summary":"docs/api-examples/segments.json preview","value":{"shopId":"15","definition":{"type":"group","match":"all","rules":[{"type":"list","operator":"in","listId":"43"},{"type":"group","match":"any","rules":[{"type":"order_value","operator":"gte","amount":"3000","currency":"CZK","shopId":"15","days":"365"},{"type":"field","field":"lastClickAt","operator":"in_last_days","value":"30"}]}]}}}}}}},"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"preview_segment","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreview"},"examples":{"segments-preview":{"summary":"docs/api-examples/segments.json preview","value":{"matched":0,"mailable":0,"total":0}}}}}},"400":{"description":"`validation` (message: definition)","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}/segments/tags":{"post":{"operationId":"segments_tags","summary":"Change labels of segments","tags":["Segments"],"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":"contacts","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}/segments/{segment}":{"delete":{"operationId":"segments_delete","summary":"Delete a segment no campaign, segment or automation names","tags":["Segments"],"description":"SE's Smazat segment: 204; 409 'conflict' with the message campaign, segment or automation while something names it.\n\nContract notes (cs):\n\nSpráva segmentu jako SE (audit SG-06, plný přístup `contacts`). DELETE → 204; 409 `conflict` se zprávou `campaign` (segment je v příjemcích kampaně), `segment` (odkazuje na něj podmínka jiného segmentu) nebo `automation` (podmínka uzlu automatizace); kontakty zůstávají. `to-list` (SE „Převést na seznam“): tělo `{ \"name\" }` (1 až 100 znaků), vznikne ruční seznam e-shopu segmentu s jeho kontakty, kterým se teď smí posílat (přihlášené, bez blokace a slabého souhlasu), jako potvrzení; hromadný zápis, nespustí automatizace. Odpověď 201 `{ \"listId\", \"name\", \"members\" }`, 409 `name` při obsazeném názvu seznamu. `recompute` (SE „Přepočítat segment“): statický segment si vezme nový snímek kontaktů, denní se počítá živě; odpověď detail. Zapnutí a vypnutí obnovy = PATCH `{ \"refresh\": \"daily\" | \"static\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"segment","in":"path","required":true,"description":"Id of the segment (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"segments_show","summary":"Get a segment","tags":["Segments"],"description":"One segment with its definition tree.\n\nContract notes (cs):\n\n`SegmentDetail` = `SegmentSummary`, `definition` a `signatureHtml` (pokročilé nastavení: podpis vlastníka jako HTML, server ho před uložením čistí stejně jako obsah e-mailu: žádný `<script>`, atributy `on*`, `javascript:`; výchozí `\"\"`).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"segment","in":"path","required":true,"description":"Id of the segment (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_segment","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentDetail"},"examples":{"segments-show":{"summary":"docs/api-examples/segments.json show","value":{"id":"31","name":"Aktivní a utrácející","publicName":"","shopId":"15","refresh":"daily","matched":0,"mailable":0,"computedAt":"2026-10-01T08:00:00.000Z","ruleCount":3,"tags":[],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","definition":{"type":"group","match":"all","rules":[{"type":"list","listId":"43","operator":"in"},{"type":"group","match":"any","rules":[{"days":"365","type":"order_value","amount":"3000","shopId":"15","currency":"CZK","operator":"gte"},{"type":"field","field":"lastClickAt","value":"30","operator":"in_last_days"}]}]},"signatureHtml":""}}}}}},"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":"segments_update","summary":"Update a segment","tags":["Segments"],"description":"Changes a segment (the shop never changes).\n\nContract notes (cs):\n\nTělo `{ \"name\", \"publicName\"?, \"shopId\", \"refresh\"?, \"definition\", \"signatureHtml\"? }` (PATCH podmnožina; bez `refresh` je nový segment `static`, jako v SE „Automaticky obnovovat segment“ výchozí vypnuto). Chyby: 400 `name` (1 až 100 znaků), `publicName` (do 100 znaků), `signatureHtml` (do 5 000 znaků), `shop`, `refresh`, `definition…`; 409 `name` při obsazeném názvu. E-shop uloženého segmentu se nemění (400 `shop`), protože na něm stojí kampaně. Každé uložení statického segmentu udělá nový snímek.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"segment","in":"path","required":true,"description":"Id of the segment (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"publicName":{"type":"string"},"shopId":{"type":"string"},"refresh":{"type":"string","enum":["static","daily"]},"definition":{"$ref":"#/components/schemas/SegmentGroup"},"signatureHtml":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (Štítky)."}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"update_segment","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentDetail"}}}},"400":{"description":"`validation` (message: definition, refresh, shop, signatureHtml, tags)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` (message: name)","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}/segments/{segment}/members":{"get":{"operationId":"segments_members","summary":"List the members of a segment","tags":["Segments"],"description":"SE's detail of a segment (SG-07): its members as the contacts grid (?q=, ?state=, ?engagement=, ?sort=, paging; rows as GET /contacts): the stored snapshot of a static segment, the live definition otherwise.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"segment","in":"path","required":true,"description":"Id of the segment (string of digits).","schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"},{"name":"state","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactListItem"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: 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}/segments/{segment}/recompute":{"post":{"operationId":"segments_recompute","summary":"Recompute a segment now","tags":["Segments"],"description":"SE's Přepočítat segment: a static segment takes a new snapshot of its members now, a daily one is live anyway (computedAt moves); the detail.\n\nContract notes (cs):\n\nSpráva segmentu jako SE (audit SG-06, plný přístup `contacts`). DELETE → 204; 409 `conflict` se zprávou `campaign` (segment je v příjemcích kampaně), `segment` (odkazuje na něj podmínka jiného segmentu) nebo `automation` (podmínka uzlu automatizace); kontakty zůstávají. `to-list` (SE „Převést na seznam“): tělo `{ \"name\" }` (1 až 100 znaků), vznikne ruční seznam e-shopu segmentu s jeho kontakty, kterým se teď smí posílat (přihlášené, bez blokace a slabého souhlasu), jako potvrzení; hromadný zápis, nespustí automatizace. Odpověď 201 `{ \"listId\", \"name\", \"members\" }`, 409 `name` při obsazeném názvu seznamu. `recompute` (SE „Přepočítat segment“): statický segment si vezme nový snímek kontaktů, denní se počítá živě; odpověď detail. Zapnutí a vypnutí obnovy = PATCH `{ \"refresh\": \"daily\" | \"static\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"segment","in":"path","required":true,"description":"Id of the segment (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentDetail"}}}},"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}/segments/{segment}/to-list":{"post":{"operationId":"segments_to_list","summary":"Convert a segment into a manual list of its mailable contacts","tags":["Segments"],"description":"SE's Převést na seznam: body {name}; 201 {listId, name, members} with a new manual list of the segment's mailable contacts now (bulk: no automation starts); 409 'conflict' / 'name' for a taken list name.\n\nContract notes (cs):\n\nSpráva segmentu jako SE (audit SG-06, plný přístup `contacts`). DELETE → 204; 409 `conflict` se zprávou `campaign` (segment je v příjemcích kampaně), `segment` (odkazuje na něj podmínka jiného segmentu) nebo `automation` (podmínka uzlu automatizace); kontakty zůstávají. `to-list` (SE „Převést na seznam“): tělo `{ \"name\" }` (1 až 100 znaků), vznikne ruční seznam e-shopu segmentu s jeho kontakty, kterým se teď smí posílat (přihlášené, bez blokace a slabého souhlasu), jako potvrzení; hromadný zápis, nespustí automatizace. Odpověď 201 `{ \"listId\", \"name\", \"members\" }`, 409 `name` při obsazeném názvu seznamu. `recompute` (SE „Přepočítat segment“): statický segment si vezme nový snímek kontaktů, denní se počítá živě; odpověď detail. Zapnutí a vypnutí obnovy = PATCH `{ \"refresh\": \"daily\" | \"static\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"segment","in":"path","required":true,"description":"Id of the segment (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentToListResult"}}}},"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: name)","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}/senders":{"get":{"operationId":"senders_index","summary":"List verified senders","tags":["Campaigns"],"description":"Sender addresses per shop (only verified ones may send).\n\nContract notes (cs):\n\n`{ \"items\": [ { \"id\", \"shopId\", \"name\", \"email\", \"replyTo\", \"verified\", \"isDefault\" } ] }`. Odesílat smí jen ověřená adresa (SPF, DKIM, DMARC). Adresy odebrané v Nastavení › Odesílání se nevracejí. Zdroj dnes `ShopSettings.sender_name` a `sender_email`, později tabulka odesílacích adres (se-spec 06).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_senders","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Sender"}}},"required":["items"]},"examples":{"send-campaign-senders":{"summary":"docs/api-examples/send-campaign.json senders","value":{"items":[{"id":"17","shopId":"17","name":"Example.cz","email":"info@example.cz","replyTo":"","verified":true,"isDefault":true},{"id":"18","shopId":"18","name":"Example.sk","email":"info@example.sk","replyTo":"","verified":true,"isDefault":true}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/sending-defaults":{"get":{"operationId":"sending_defaults","summary":"Get the default settings of new campaigns (tracking parameters on or off)","tags":["Sending"],"description":"SE Nastavení › Rozesílky › Výchozí nastavení beyond what other routes keep (senders, test recipients, the default unsubscribe page): {utmDefaultOn} = new campaign drafts start with the tracking parameters on.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDefaults"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"sending_defaults_update","summary":"Set whether new campaigns start with tracking parameters","tags":["Sending"],"description":"Body {utmDefaultOn: bool} (SE UTM Parametry Nesledovat / Sledovat). Audited as setting_changed.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDefaults"}}},"description":"Required by the server: utmDefaultOn."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDefaults"}}}},"400":{"description":"`validation` (message: utmDefaultOn)","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}/sending-mode":{"get":{"operationId":"sending_mode","summary":"Sending mode of the company (switch, limits)","tags":["Sending"],"description":"What leaves Poštárna for this tenant now (core/backends.mode_of): live (everything), test (only test e-mails to the test whitelist, POSTARNA_SES_LIVE=test), folder (development: files, nothing leaves) or off (nothing). testRecipients = how many addresses the test whitelist has. sendingEnabled = the tenant's kill switch (setting sending_enabled, python -m postarna.admin sending-switch): while it is off no sending tick runs, so no campaign goes out and no automation lets anybody in, whatever the mode says (test e-mails still go out). sendingState = the platform's approval of live sending (pending, live, paused, suspended; migration 0170) and sendingHold why a live tenant is held ('', platform, free_limit, unpaid).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingModeInfo"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/sending/domains":{"post":{"operationId":"sending_domain_add","summary":"Add a sending domain","tags":["Sending"],"description":"Contract notes (cs):\n\nZaložení `{domain}` → 201 `SetupDomain` (znovu stejná doména vrátí existující řádek; 400 `validation` / `domain` s `reason` `freemail`; 409 `conflict` / `domain` s `reason` `taken`, když doménu spravuje jiný účet). Kontrola načte stav identity ze SES a DNS; první ověřená doména tenanta bez nastavení SES mu nastaví `ses` = eu-north-1 / `PLATFORM` (ostré odesílání dál schvaluje platforma). Smazání smaže i identitu v SES (bez přístupu platformy 503 `unavailable` / `domain`).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"}},"required":["domain"]}}},"description":"Required by the server: domain."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupDomain"}}}},"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}/sending/domains/{domain_id}":{"delete":{"operationId":"sending_domain_delete","summary":"Delete a sending domain","tags":["Sending"],"description":"Contract notes (cs):\n\nZaložení `{domain}` → 201 `SetupDomain` (znovu stejná doména vrátí existující řádek; 400 `validation` / `domain` s `reason` `freemail`; 409 `conflict` / `domain` s `reason` `taken`, když doménu spravuje jiný účet). Kontrola načte stav identity ze SES a DNS; první ověřená doména tenanta bez nastavení SES mu nastaví `ses` = eu-north-1 / `PLATFORM` (ostré odesílání dál schvaluje platforma). Smazání smaže i identitu v SES (bez přístupu platformy 503 `unavailable` / `domain`).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"domain_id","in":"path","required":true,"description":"Id of the domain (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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}/sending/domains/{domain_id}/check":{"post":{"operationId":"sending_domain_check","summary":"Check a sending domain","tags":["Sending"],"description":"Contract notes (cs):\n\nZaložení `{domain}` → 201 `SetupDomain` (znovu stejná doména vrátí existující řádek; 400 `validation` / `domain` s `reason` `freemail`; 409 `conflict` / `domain` s `reason` `taken`, když doménu spravuje jiný účet). Kontrola načte stav identity ze SES a DNS; první ověřená doména tenanta bez nastavení SES mu nastaví `ses` = eu-north-1 / `PLATFORM` (ostré odesílání dál schvaluje platforma). Smazání smaže i identitu v SES (bez přístupu platformy 503 `unavailable` / `domain`).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"domain_id","in":"path","required":true,"description":"Id of the domain (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupDomain"}}}},"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}/sending/senders":{"post":{"operationId":"sending_sender_add","summary":"Add a sender","tags":["Sending"],"description":"Contract notes (cs):\n\nPřidání `{shopId, email, name?, replyTo?, isDefault?}` jen na ověřené doméně (400 `validation` / `email`, `reason` `domain_not_verified` nebo `freemail`; 409 `conflict` pro stejnou adresu v e-shopu). První adresa e-shopu je výchozí. Adresa, kterou účet dřív odebral, se stejným přidáním vrátí (stejné `id`, nové jméno a `replyTo`).\n• Úprava (PATCH) `{name?, replyTo?, isDefault: true?}` → `SetupSender`. `name` = jméno odesílatele (Od koho), nejvýš 100 znaků bez `< > { } \"` a řádků (400 `validation` / `name`). `replyTo` = adresa pro odpovědi nebo `\"\"` (odpovědi pak přijdou na adresu odesílatele); co není adresa, odmítne 400 `validation` / `replyTo` (nikdy se tiše nevyprázdní). Samotnou adresu `email` změnit nejde (patří k ověřené doméně): jiná hodnota než uložená = 400 `validation` / `email` s `reason` `read_only`.\n• Odebrání (DELETE) 204. Odmítne 409 `conflict` / `id` s `reason` `default` (výchozí adresa e-shopu) nebo `in_use` (adresu používá kampaň ve stavu `scheduled`, `sending` nebo `paused`, nebo krok E-mail automatizace ve stavu `active` nebo `paused`). Koncepty a skončené kampaně odebrání nebrání. Řádek zůstává (`senders.removed_at`, migrace 0096): skončené kampaně a automatizace si odkaz na odesílatele ponechají, ze všech seznamů a výběrů (`GET …/sending/setup`, `GET /tenants/{t}/senders`, výběr v kampani a automatizaci, schválení) adresa zmizí; koncept s odebranou adresou schválení odmítne 400 `validation` / `senderId`. Další PATCH nebo DELETE odebrané adresy = 404 `not_found`.\n• Modul `settings` `full`, změny zapisují audit (`sender_added`, `sender_updated` s názvy polí, `sender_deleted`).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSenderInput"}}},"description":"Required by the server: email, shopId."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSender"}}}},"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}/sending/senders/{sender_id}":{"delete":{"operationId":"sending_sender_delete","summary":"Delete a sender","tags":["Sending"],"description":"204; 409 conflict default / in_use; ?replacementId= (SE's Náhradní adresa, DO-03) first moves the shop's default, the unfinished campaigns and the automation e-mail steps to that sender of the same shop.\n\nContract notes (cs):\n\nPřidání `{shopId, email, name?, replyTo?, isDefault?}` jen na ověřené doméně (400 `validation` / `email`, `reason` `domain_not_verified` nebo `freemail`; 409 `conflict` pro stejnou adresu v e-shopu). První adresa e-shopu je výchozí. Adresa, kterou účet dřív odebral, se stejným přidáním vrátí (stejné `id`, nové jméno a `replyTo`).\n• Úprava (PATCH) `{name?, replyTo?, isDefault: true?}` → `SetupSender`. `name` = jméno odesílatele (Od koho), nejvýš 100 znaků bez `< > { } \"` a řádků (400 `validation` / `name`). `replyTo` = adresa pro odpovědi nebo `\"\"` (odpovědi pak přijdou na adresu odesílatele); co není adresa, odmítne 400 `validation` / `replyTo` (nikdy se tiše nevyprázdní). Samotnou adresu `email` změnit nejde (patří k ověřené doméně): jiná hodnota než uložená = 400 `validation` / `email` s `reason` `read_only`.\n• Odebrání (DELETE) 204. Odmítne 409 `conflict` / `id` s `reason` `default` (výchozí adresa e-shopu) nebo `in_use` (adresu používá kampaň ve stavu `scheduled`, `sending` nebo `paused`, nebo krok E-mail automatizace ve stavu `active` nebo `paused`). Koncepty a skončené kampaně odebrání nebrání. Řádek zůstává (`senders.removed_at`, migrace 0096): skončené kampaně a automatizace si odkaz na odesílatele ponechají, ze všech seznamů a výběrů (`GET …/sending/setup`, `GET /tenants/{t}/senders`, výběr v kampani a automatizaci, schválení) adresa zmizí; koncept s odebranou adresou schválení odmítne 400 `validation` / `senderId`. Další PATCH nebo DELETE odebrané adresy = 404 `not_found`.\n• Modul `settings` `full`, změny zapisují audit (`sender_added`, `sender_updated` s názvy polí, `sender_deleted`).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sender_id","in":"path","required":true,"description":"Id of the sender (string of digits).","schema":{"type":"string"}},{"name":"replacementId","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"400":{"description":"`validation` (message: replacementId)","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":"sending_sender_update","summary":"Update a sender","tags":["Sending"],"description":"Contract notes (cs):\n\nPřidání `{shopId, email, name?, replyTo?, isDefault?}` jen na ověřené doméně (400 `validation` / `email`, `reason` `domain_not_verified` nebo `freemail`; 409 `conflict` pro stejnou adresu v e-shopu). První adresa e-shopu je výchozí. Adresa, kterou účet dřív odebral, se stejným přidáním vrátí (stejné `id`, nové jméno a `replyTo`).\n• Úprava (PATCH) `{name?, replyTo?, isDefault: true?}` → `SetupSender`. `name` = jméno odesílatele (Od koho), nejvýš 100 znaků bez `< > { } \"` a řádků (400 `validation` / `name`). `replyTo` = adresa pro odpovědi nebo `\"\"` (odpovědi pak přijdou na adresu odesílatele); co není adresa, odmítne 400 `validation` / `replyTo` (nikdy se tiše nevyprázdní). Samotnou adresu `email` změnit nejde (patří k ověřené doméně): jiná hodnota než uložená = 400 `validation` / `email` s `reason` `read_only`.\n• Odebrání (DELETE) 204. Odmítne 409 `conflict` / `id` s `reason` `default` (výchozí adresa e-shopu) nebo `in_use` (adresu používá kampaň ve stavu `scheduled`, `sending` nebo `paused`, nebo krok E-mail automatizace ve stavu `active` nebo `paused`). Koncepty a skončené kampaně odebrání nebrání. Řádek zůstává (`senders.removed_at`, migrace 0096): skončené kampaně a automatizace si odkaz na odesílatele ponechají, ze všech seznamů a výběrů (`GET …/sending/setup`, `GET /tenants/{t}/senders`, výběr v kampani a automatizaci, schválení) adresa zmizí; koncept s odebranou adresou schválení odmítne 400 `validation` / `senderId`. Další PATCH nebo DELETE odebrané adresy = 404 `not_found`.\n• Modul `settings` `full`, změny zapisují audit (`sender_added`, `sender_updated` s názvy polí, `sender_deleted`).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sender_id","in":"path","required":true,"description":"Id of the sender (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSenderPatch"}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSender"}}}},"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}/sending/senders/{sender_id}/check":{"post":{"operationId":"sending_sender_check","summary":"Check whether a sender address is confirmed","tags":["Sending"],"description":"Zkontrolovat of an address confirmed through SES (DO-03): reads the state of its identity.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sender_id","in":"path","required":true,"description":"Id of the sender (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSender"}}}},"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}/sending/senders/{sender_id}/resend":{"post":{"operationId":"sending_sender_resend","summary":"Send the confirmation e-mail of a sender address again","tags":["Sending"],"description":"Poslat znovu the confirmation e-mail of an address verified by e-mail (DO-03); 409 when it is verified already, 503 unavailable when no e-mail could go out.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sender_id","in":"path","required":true,"description":"Id of the sender (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSender"}}}},"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: verified)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: email)","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}/sending/senders/{sender_id}/usage":{"get":{"operationId":"sending_sender_usage","summary":"Where a sender is used","tags":["Sending"],"description":"Where a sender is used (SE \"Použití odesílací adresy\" before Smazat adresu): {items: [{type, id, name, status}]}, type default (its shop's default sender), campaign or automation.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sender_id","in":"path","required":true,"description":"Id of the sender (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SenderUsage"}}},"required":["items"]}}}},"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}/sending/setup":{"get":{"operationId":"sending_setup","summary":"State of the sending setup (domains and senders)","tags":["Sending"],"description":"Contract notes (cs):\n\n`{managed, platformReady, domains: SetupDomain[], suggestions, shops: [{id, displayName, code}], senders: SetupSender[], advanced?}`. `SetupDomain` = `id`, `domain`, `state` (`verified` | `pending` | `failed` | `setup`), `records` (`kind` dkim/spf/dmarc, `type` CNAME/TXT, `host` = název bez domény, `name` = celý název, `value`, `required`, `status` ok/missing/unknown), `checkedAt`, `createdAt`, `advanced?`. `SetupSender` = `id`, `shopId`, `name`, `email`, `replyTo`, `isDefault`, `verified`, `domainVerified`. `advanced` (region, credentialsRef, configurationSet, selektory, stav SES) jen pro administrátory platformy (`PLATFORM_ADMINS`).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingSetup"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/shop-enrich":{"get":{"operationId":"shop_enrich_state","summary":"Whether order feed imports fill empty contact fields","tags":["Account"],"description":"{ongoing}: whether the order feed imports fill empty contact fields as they come (core/shop_enrich.SETTING; off until a member runs the enrichment or turns it on). Nastavení › E-shopy, Údaje kontaktů z e-shopu.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ongoing":{"type":"boolean"}},"required":["ongoing"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"shop_enrich_switch","summary":"Turn the ongoing contact data enrichment on or off","tags":["Account"],"description":"Body {ongoing: bool}: turns the ongoing enrichment of the order feed imports on or off (audited). Nothing is filled now; the one-time fill is POST /maintenance/shop-enrich. 200 {ongoing}.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ongoing":{"type":"boolean"}},"required":["ongoing"]}}},"description":"Required by the server: ongoing."},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ongoing":{"type":"boolean"}},"required":["ongoing"]}}}},"400":{"description":"`validation` (message: ongoing)","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}/shop-settings":{"get":{"operationId":"shop_settings_index","summary":"Sending company data of every shop","tags":["Account"],"description":"Sending company of each shop (name, address, IČO).\n\nThe sender company of every e-shop: name, IČO and registered office (footers of e-mails, pages and forms).\n\nContract notes (cs):\n\nOdesílající firma každého e-shopu (Nastavení › Firma, modul `settings`: čtení GET, plný přístup PATCH). `{ \"items\": [ { \"shopId\": \"11\", \"code\": \"cz\", \"displayName\": \"Example CZ\", \"language\": \"cs\", \"companyName\": \"Example s.r.o.\", \"companyId\": \"12345678\", \"companyAddress\": \"Ukázková 1, 110 00 Praha 1\" } ] }`. Patička každé kampaně a automatizace e-mail označí jako obchodní sdělení firmy a jejího webu a na druhém řádku uvede firmu se sídlem (`companyAddress`) a IČO (`companyId`), jen když jsou vyplněné (občanský zákoník § 435); stejné údaje mají patičky veřejných stránek a formulářů. PATCH přijme kterákoli z polí `companyName` (povinný, nejvýš 200 znaků), `companyId` (písmena a číslice, nejvýš 20, mezery se vynechají), `companyAddress` (nejvýš 300 znaků); mezery se sloučí, znaky `{ } < >` a konce řádků = 400 `validation` s názvem pole, neznámé pole taky. Vrací změněnou položku; e-shop jiného tenanta 404.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_shop_settings","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ShopSettings"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/shop-settings/{shop_id}":{"patch":{"operationId":"shop_settings_update","summary":"Update the sending company data of a shop","tags":["Account"],"description":"Changes the sending company of a shop.\n\nContract notes (cs):\n\nOdesílající firma každého e-shopu (Nastavení › Firma, modul `settings`: čtení GET, plný přístup PATCH). `{ \"items\": [ { \"shopId\": \"11\", \"code\": \"cz\", \"displayName\": \"Example CZ\", \"language\": \"cs\", \"companyName\": \"Example s.r.o.\", \"companyId\": \"12345678\", \"companyAddress\": \"Ukázková 1, 110 00 Praha 1\" } ] }`. Patička každé kampaně a automatizace e-mail označí jako obchodní sdělení firmy a jejího webu a na druhém řádku uvede firmu se sídlem (`companyAddress`) a IČO (`companyId`), jen když jsou vyplněné (občanský zákoník § 435); stejné údaje mají patičky veřejných stránek a formulářů. PATCH přijme kterákoli z polí `companyName` (povinný, nejvýš 200 znaků), `companyId` (písmena a číslice, nejvýš 20, mezery se vynechají), `companyAddress` (nejvýš 300 znaků); mezery se sloučí, znaky `{ } < >` a konce řádků = 400 `validation` s názvem pole, neznámé pole taky. Vrací změněnou položku; e-shop jiného tenanta 404.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"companyId":{"type":"string"},"companyName":{"type":"string"},"companyAddress":{"type":"string"}}}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"x-mcp-tool":"update_shop_settings","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopSettings"}}}},"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}/shops":{"get":{"operationId":"shops","summary":"List shops (e-shops) of the company","tags":["Account"],"description":"Shops (e-shops) of the account with id, code, domain, currency, language.\n\nContract notes (cs):\n\n`{ \"items\": [ { \"id\": \"11\", \"code\": \"cz\", \"displayName\": \"Example CZ\", \"domain\": \"example.cz\", \"currency\": \"CZK\", \"language\": \"cs\" } ] }`","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":null,"level":"read","keyScope":"read or full"},"x-mcp-tool":"list_shops","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Shop"}}},"required":["items"]},"examples":{"getting-started-shops":{"summary":"docs/api-examples/getting-started.json shops","value":{"items":[{"id":"7","code":"cz","displayName":"Example.cz","domain":"example.cz","currency":"CZK","language":"cs","active":true},{"id":"8","code":"sk","displayName":"Example.sk","domain":"example.sk","currency":"EUR","language":"sk","active":true}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"shops_create","summary":"Create a shop","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopInput"}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopDetail"}}}},"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}/shops/{shop_id}":{"get":{"operationId":"shops_show","summary":"Get a shop","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopDetail"}}}},"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":"shops_update","summary":"Update a shop","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"companyId":{"type":"string"},"companyName":{"type":"string"},"currency":{"type":"string","enum":["CZK","EUR"]},"companyAddress":{"type":"string"},"displayName":{"type":"string"},"domain":{"type":"string"},"webDisplay":{"type":"string"},"language":{"type":"string","enum":["cs","sk"]},"platform":{"type":"string","enum":["shoptet","woocommerce","prestashop","upgates","custom"]},"senderName":{"type":"string"},"senderEmail":{"type":"string"},"linkDomain":{"type":"string"}}}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopDetail"}}}},"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}/shops/{shop_id}/brand":{"get":{"operationId":"shops_brand","summary":"Get the brand settings of a shop","tags":["Account"],"description":"{logoUrl, logoLink, logoWidth, primaryColor, secondaryColor, textColor, backgroundColor, fontFamily, headingFontFamily}: '' (logoWidth null) when unset; logoLink defaults to https:// and the shop's web address (web_display, else its domain) when unset.\n\nContract notes (cs):\n\nGrafická identita e-shopu (SE „Grafická identita“); blok Logo v Magic editoru se z ní předvyplní. `GET` (modul `content`, čtení) → `{ \"logoUrl\", \"logoLink\", \"logoWidth\", \"primaryColor\", \"secondaryColor\", \"textColor\", \"backgroundColor\", \"fontFamily\", \"headingFontFamily\" }`, nenastavené = `''` (`logoWidth` `null`); `logoLink` bez hodnoty = `https://` a webová adresa e-shopu (`webDisplay`, jinak doména).\n`PUT` (modul `settings`, plný přístup) s libovolnou částí polí: chybějící pole zůstane, `''` (u `logoWidth` `null`) ho smaže. `logoUrl`, `logoLink` = `''` nebo adresa https; barvy `''` nebo `#rrggbb` (ukládají se malými písmeny); `logoWidth` `null` nebo celé číslo 20 až 800; písma `''` nebo text do 100 znaků bez `< > { } ; \"`. Neznámé pole nebo špatná hodnota 400 `validation` s názvem pole, neznámý e-shop 404. Odpověď jako `GET`. Ukládá se do `shops.settings.brand`; vzhled veřejných stránek (logo stránek) se nemění. Audit `shop_brand_changed` jen s názvy polí.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopBrand"}}}},"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"}}},"put":{"operationId":"shops_brand_update","summary":"Replace the brand settings of a shop","tags":["Account"],"description":"Body with any of the brand fields: a missing field is kept, '' (logoWidth null) clears it. logoUrl and logoLink '' or https, colours '' or #rrggbb (stored in lower case), logoWidth null or 20 to 800, fonts at most 100 characters without < > { } ; \". 400 validation <field>. Answers the brand like GET.\n\nContract notes (cs):\n\nGrafická identita e-shopu (SE „Grafická identita“); blok Logo v Magic editoru se z ní předvyplní. `GET` (modul `content`, čtení) → `{ \"logoUrl\", \"logoLink\", \"logoWidth\", \"primaryColor\", \"secondaryColor\", \"textColor\", \"backgroundColor\", \"fontFamily\", \"headingFontFamily\" }`, nenastavené = `''` (`logoWidth` `null`); `logoLink` bez hodnoty = `https://` a webová adresa e-shopu (`webDisplay`, jinak doména).\n`PUT` (modul `settings`, plný přístup) s libovolnou částí polí: chybějící pole zůstane, `''` (u `logoWidth` `null`) ho smaže. `logoUrl`, `logoLink` = `''` nebo adresa https; barvy `''` nebo `#rrggbb` (ukládají se malými písmeny); `logoWidth` `null` nebo celé číslo 20 až 800; písma `''` nebo text do 100 znaků bez `< > { } ; \"`. Neznámé pole nebo špatná hodnota 400 `validation` s názvem pole, neznámý e-shop 404. Odpověď jako `GET`. Ukládá se do `shops.settings.brand`; vzhled veřejných stránek (logo stránek) se nemění. Audit `shop_brand_changed` jen s názvy polí.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"logoUrl":{"type":"string"},"logoLink":{"type":"string","description":"Where the logo leads; defaults to the shop's web."},"logoWidth":{"type":["number","null"]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"textColor":{"type":"string"},"backgroundColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"type":"string"}}}}}},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopBrand"}}}},"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}/shops/{shop_id}/contact-language":{"put":{"operationId":"shops_contact_language","summary":"Set the default language of new contacts of a shop","tags":["Account"],"description":"SE's Nastavení aplikace › Výchozí jazyk kontaktu (UZ-02) of one shop: {language: cs | sk}; it applies to contacts added from now on by hand, over the API or by a sign-up (migration 0392). 400 validation language, 404 for another shop.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"$ref":"#/components/schemas/Lang"}},"required":["language"]}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shop"}}}},"400":{"description":"`validation` (message: language)","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}/shops/{shop_id}/disable":{"post":{"operationId":"shops_disable","summary":"Switch a shop off","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopDetail"}}}},"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}/shops/{shop_id}/enable":{"post":{"operationId":"shops_enable","summary":"Switch a shop on","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopDetail"}}}},"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}/site-script":{"get":{"operationId":"site_script_index","summary":"Every shop's one script line and connection state","tags":["Account"],"description":"The shops with their one line and connection state (module notes).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SiteScriptShop"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/site-script/{shop_id}":{"patch":{"operationId":"site_script_update","summary":"Switch the checkout newsletter box of a shop","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"checkoutConsent":{"type":"boolean"}},"required":["checkoutConsent"]}}},"description":"Required by the server: checkoutConsent."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteScriptShop"}}}},"400":{"description":"`validation` (message: checkoutConsent)","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}/site-script/{shop_id}/check":{"post":{"operationId":"site_script_check","summary":"Test whether the script is on the shop's homepage","tags":["Account"],"description":"The Test button (module notes): {result, url, state, seenAt}.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteScriptCheck"}}}},"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}/smartemailing":{"get":{"operationId":"smartemailing_state","summary":"State of the SmartEmailing migration","tags":["Account"],"description":"{connection (null before the first connect), migration (the latest run or null)}.\n\nContract notes (cs):\n\n`{ \"connection\": SeConnection | null, \"migration\": SeMigration | null }` (poslední běh).\n• `SeConnection` = `{ login, keyHint, accountId, verifiedAt, lists, options, syncEnabled, syncChangedAt, lastSyncAt, lastSync, syncStatus, syncProblem, syncProblemAt }`. `syncStatus`: `ok`, `skipped` (právě běží přenos, zkusí se znovu za 10 minut), `failed` (poslední běh skončil chybou, `syncProblem` = `credentials`, `unavailable`, `dataKey`, `error`) nebo `late` (zapnutá synchronizace neproběhla 3 hodiny, `syncProblem` = `no_sync` nebo poslední chyba); `syncProblemAt` = od kdy. Změna na `failed` nebo `late` přidá jednu důležitou notifikaci `se_sync_problem`. API klíč se nikdy nevrací, jen `keyHint` (první 3 znaky). `lists` = uložený plán `{ \"<id seznamu SE>\": { role, shop, name } }`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeState"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/smartemailing/migrations/{migration_id}":{"get":{"operationId":"smartemailing_migration","summary":"Get one SmartEmailing migration run","tags":["Account"],"description":"Contract notes (cs):\n\n`SeMigration` = `{ id, status (queued, running, finished, failed), phase ('', fields, contacts, suppressions, apply, purposes, templates, automations, report), progress { read, planned, applied, done }, plan, counts, report, failed, stopped, failure, createdAt, startedAt, finishedAt }`. UI se ptá každé 2 s, dokud běh nedoběhne. `failure` = druh chyby neúspěšného běhu (`stopped`, `credentials`, `unavailable`, `answer`, `dataKey`, `connection`, `error`; jinak prázdné), nikdy technický text; ten zůstává v databázi a v logu workeru (bez adres a klíčů). `stopped` = běh se přerušil, protože se zastavil worker (jeho úloha už neběží); `POST /migrations` se stejným plánem ho obnoví (stejné `id`, hotové fáze se přeskočí, kontakty pokračují za poslední uloženou dávkou), jiný plán založí nový běh.\n• `report` (`SeReport`, jen počty, nikdy adresa): `rows` (`contacts`, `blacklisted`, `hardbounced`, `unsubscribed` (odhlášení ze seznamů), `listUnsubscribes` (odhlášení ze seznamů, které se nepřenášejí, u kontaktů v Poštárně), `customFields`, `purposes`, `consents`, `templates`, `automations`: `{ key, se, postarna, created?, skipped?, archived?, imagesFailed?, failed? }`), `lists` (`{ id, name, role, seConfirmed, seUnsubscribed, postarnaConfirmed, postarnaUnsubscribed }`; u role `skip` je `postarnaUnsubscribed` počet kontaktů, u kterých si Poštárna odhlášení z toho seznamu pamatuje), `skipped` (`not_in_mapped_lists`, `invalid_address`), `merged` `{ duplicate_address }` (záznamy SE se stejnou adresou sloučené do jednoho kontaktu), `problems` (`[{ code, count, blocking }]`, kódy `blacklistMissing`, `hardbounceMissing`, `unsubscribeMissing`, `listUnsubscribeMissing`, `suppressionMissing` blokují; `duplicatesMerged`, `invalidWithOptOut`, `listUnsubscribeNotInPostarna`, `erased` jen informují), `suppressionDiff` `{ seOnly, postarnaOnly }` a `readyToSend` (blacklist, tvrdé bounce i odhlášení SE jsou všechny v Poštárně, osoba vymazaná na žádost se počítá jako zablokovaná, žádný blokující problém).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"migration_id","in":"path","required":true,"description":"Id of the migration (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeMigration"}}}},"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}/sms-templates":{"get":{"operationId":"sms_templates_index","summary":"List SMS templates","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SmsTemplate"}}},"required":["items"]}}}},"400":{"description":"`validation` (message: sort)","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":"sms_templates_create","summary":"Create an SMS template","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsTemplateInput"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsTemplate"}}}},"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}/sms-templates/{sms_template_id}":{"delete":{"operationId":"sms_templates_delete","summary":"Delete an SMS template","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sms_template_id","in":"path","required":true,"description":"Id of the sms template (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"sms_templates_show","summary":"Get an SMS template","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sms_template_id","in":"path","required":true,"description":"Id of the sms template (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsTemplate"}}}},"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":"sms_templates_update","summary":"Update an SMS template","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sms_template_id","in":"path","required":true,"description":"Id of the sms template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"body":{"type":"string"},"stripDiacritics":{"type":"boolean","description":"Odeslat bez diakritiky: the text goes without accents (GSM 7-bit)."}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsTemplate"}}}},"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}/sms-templates/{sms_template_id}/copy":{"post":{"operationId":"sms_templates_copy","summary":"Copy an SMS template","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"sms_template_id","in":"path","required":true,"description":"Id of the sms template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"suffix":{"type":"string"}},"required":["suffix"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsTemplate"}}}},"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}/stats/automations/{automation_id}":{"get":{"operationId":"stats_automation","summary":"Statistics of an automation","tags":["Statistics"],"description":"E-mail statistics of an automation (or of one e-mail node).\n\nContract notes (cs):\n\n`EmailStatsDetail`: hlavička (`kind`, `campaignId`, `automationId`, `nodeKey`, `name`, `subject`, `shopId`, `status`, `sentAt`, `nodes` = e-mailové uzly automatizace `{key, name}`), `totals: EmailMetrics`, `providers` (EmailMetrics a `provider` po skupinách poskytovatelů schránek, nejvýš 15), `timeline` (po dnech: `date`, `opens`, `clicks`, `unsubscribed`), `links` (`url`, `clicks`, `uniqueClicks`, nejvýš 50).","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":"First day YYYY-MM-DD."},{"name":"node","in":"query","required":false,"schema":{"type":"string"},"description":"E-mail node key."},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"Last day YYYY-MM-DD."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_automation_stats","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStatsDetail"}}}},"400":{"description":"`validation` (message: node, to)","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}/stats/automations/{automation_id}/activity":{"get":{"operationId":"stats_automation_activity","summary":"Activity of an automation over time","tags":["Statistics"],"description":"Contract notes (cs):\n\n`?tab=opened|clicked|unsubscribed|bounced&q=&from=&to=&node=&page=&pageSize=` → `Page<StatsActivity>`: jeden řádek na e-mail se záložkou, nejnovější první: `sendId`, `contactId`, `email`, `firstAt`, `lastAt`, `opens`, `clicks`, `type` (`open`, `click`, `unsubscribe`, `complaint`, `hard`, `soft`), `source` (`ses`, `web`, `fbl`), `links` (u prokliků nejvýš 5), `detail` (podtyp vrácení). Počet řádků záložky odpovídá metrice (`opened` = `uniqueOpens`, `clicked` = `uniqueClicks`); záložka Odhlášeno ukazuje i stížnosti.","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":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"node","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StatsActivity"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: node, q, tab, to)","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}/stats/automations/{automation_id}/conversions":{"get":{"operationId":"stats_automation_conversions","summary":"Conversions (orders) of an automation","tags":["Statistics"],"description":"Contract notes (cs):\n\n`EmailConversions`: `available` (false = server nemá zdroj konverzí, UI to napíše místo nul), `directHours` (24), `assistedDays` (5), `currencies` = jedna položka na měnu `{currency, direct: {orders, revenue, revenueWithoutVat}, assisted: {...}}` (desetinné řetězce, CZK a EUR nikdy dohromady), `orders` (nejvýš 100: `orderId`, `code`, `contactId`, `email`, `kind` `direct` nebo `assisted`, `clickedAt`, `orderedAt`, `currency`, `totalWithVat`, `totalWithoutVat`). Zdroj je párování objednávek (`core/conversions.py`): objednávka stejného kontaktu po jeho posledním prokliku, do 24 hodin přímá, od 24 hodin do 5 dní asistovaná; stornované a smazané se nepočítají. Období se na konverze neuplatňuje.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"node","in":"query","required":false,"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/EmailConversions"}}}},"400":{"description":"`validation` (message: node, to)","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}/stats/automations/{automation_id}/heatmap":{"get":{"operationId":"stats_automation_heatmap","summary":"Click map of an automation","tags":["Statistics"],"description":"The same for one e-mail node of an automation (?node=, the template of the node); without a node no HTML.\n\nContract notes (cs):\n\n`{html, links}`: HTML e-mailu (u automatizace šablona uzlu `?node=`, bez uzlu prázdné) a prokliky každého odkazu. UI ho zobrazí v rámu bez skriptů a nad odkazy napíše podíl prokliků.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"node","in":"query","required":false,"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/EmailHeatmap"}}}},"400":{"description":"`validation` (message: node, to)","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}/stats/automations/{automation_id}/recipients":{"get":{"operationId":"stats_automation_recipients","summary":"Recipients of an automation with their events (JSON or CSV)","tags":["Statistics"],"description":"Contract notes (cs):\n\n`?tab=all|opened|clicked|conversions|unsubscribed|bounced&q=&page=&pageSize=` + filtry reportu + vlastní Filtry tabulky (`opened`, `clicked`, `purchased`, `reopened`, `hard` = 1 nebo 0, `state` = received | processing | shipped | cancelled | unknown, `reason`) → `Page` řádků záložky (příjemci s ANO / NE a cenami po měnách, otevření s opakováním a klientem, jednotlivé prokliky, spárované objednávky se stavem a zbožím, odhlášení s důvodem a komentářem, vrácení s odpovědí serveru). `?format=csv` vrátí celou tabulku jako CSV (UTF-8 s BOM, středníky, buňka nikdy jako vzorec).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"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":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"humans","in":"query","required":false,"schema":{"type":"string"}},{"name":"node","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"name":"rows","in":"query","required":false,"schema":{"type":"string"}},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"vat","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"JSON, or CSV with format=csv","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"`validation` (message: engagement, node, q, tab, to)","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}/stats/automations/{automation_id}/report":{"get":{"operationId":"stats_automation_report","summary":"Report of an automation (JSON or CSV)","tags":["Statistics"],"description":"Contract notes (cs):\n\nDetail jako SE (`core/stats_report.py`), filtry `?engagement=A,B,…` (skupiny angažovanosti, prázdné = všechny), `?humans=1` (bez otevření přes proxy obrázků webmailu), `?vat=1` (peníze s DPH, jinak bez), u automatizace `?node=`. 400 `validation` / `engagement`, `humans`, `vat`. `EmailStatsReport`: hlavička (`name`, `status`, `startedAt`, `completedAt`, `shopId`, `nodes`), `filters`, `firstSentAt`, `lastSentAt`, `totals` (EmailMetrics + `orders`, `orderRate`, `reopeners`, `reopenRate`), `baseline` (poměry e-mailů účtu za 30 dní před kampaní, u automatizace před dneškem; `sent` = průměrná velikost jednorázové kampaně; `null` bez dat), `days` (po dnech od prvního e-mailu, nejvýš 31: unikátní otevření, prokliky, odhlášení, vrácení), `domains` (`sent`, `opened`, `clicked`, `unsubscribed`, `bounced`, `buyers`; `{name, count}`, `name` '' = zbytek), `clients` a `systems` (`opened`, `clicked`), `links` (`url`, `clicks`, `uniqueClicks`, `share`), `unsubscribeReasons` (`too_often`, `not_relevant`, `annoying`, `not_signed_up`, `spam_report`, `other`, `custom`, `none`, `misc`), `bounceReasons` (`mailbox_full`, `spam_filter`, `no_address`, `transfer_error`, `temporary`, `server_error`, `mx_error`, `greylisted`, `suppressed`, `other`), `bounceSplit`, `revenue` (po měnách: objednávky, přímé a asistované, průměr, obrat e-shopu stejné měny od prvního e-mailu do 5 dní po posledním a podíl), `revenueDays`, `conversionLinks`, `products` (prodané kusy s obrázkem), `engagementSpend`, `topSpenders`. CZK a EUR nikdy dohromady.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automation_id","in":"path","required":true,"description":"Id of the automation (string of digits).","schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"humans","in":"query","required":false,"schema":{"type":"string"}},{"name":"node","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"vat","in":"query","required":false,"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/EmailStatsReport"}}}},"400":{"description":"`validation` (message: engagement, node, to)","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}/stats/campaigns/{campaign_id}":{"get":{"operationId":"stats_campaign","summary":"Statistics of a campaign","tags":["Statistics"],"description":"E-mail statistics of a campaign: totals, rates (base: sent), providers, daily timeline, links.\n\nContract notes (cs):\n\n`EmailStatsDetail`: hlavička (`kind`, `campaignId`, `automationId`, `nodeKey`, `name`, `subject`, `shopId`, `status`, `sentAt`, `nodes` = e-mailové uzly automatizace `{key, name}`), `totals: EmailMetrics`, `providers` (EmailMetrics a `provider` po skupinách poskytovatelů schránek, nejvýš 15), `timeline` (po dnech: `date`, `opens`, `clicks`, `unsubscribed`), `links` (`url`, `clicks`, `uniqueClicks`, nejvýš 50).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"First day YYYY-MM-DD."},{"name":"node","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"Last day YYYY-MM-DD."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_campaign_stats","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStatsDetail"}}}},"400":{"description":"`validation` (message: to)","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}/stats/campaigns/{campaign_id}/activity":{"get":{"operationId":"stats_campaign_activity","summary":"Activity of a campaign over time","tags":["Statistics"],"description":"Who opened, clicked, unsubscribed or bounced (tab).\n\nContract notes (cs):\n\n`?tab=opened|clicked|unsubscribed|bounced&q=&from=&to=&node=&page=&pageSize=` → `Page<StatsActivity>`: jeden řádek na e-mail se záložkou, nejnovější první: `sendId`, `contactId`, `email`, `firstAt`, `lastAt`, `opens`, `clicks`, `type` (`open`, `click`, `unsubscribe`, `complaint`, `hard`, `soft`), `source` (`ses`, `web`, `fbl`), `links` (u prokliků nejvýš 5), `detail` (podtyp vrácení). Počet řádků záložky odpovídá metrice (`opened` = `uniqueOpens`, `clicked` = `uniqueClicks`); záložka Odhlášeno ukazuje i stížnosti.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"First day YYYY-MM-DD."},{"name":"node","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Search text."},{"name":"tab","in":"query","required":false,"schema":{"type":"string","enum":["opened","clicked","unsubscribed","bounced"]},"description":"Tab."},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"Last day YYYY-MM-DD."}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_campaign_activity","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StatsActivity"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: q, tab, to)","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}/stats/campaigns/{campaign_id}/conversions":{"get":{"operationId":"stats_campaign_conversions","summary":"Conversions (orders) of a campaign","tags":["Statistics"],"description":"Orders after clicks of the campaign (direct within 24 hours, assisted), per currency.\n\nContract notes (cs):\n\n`EmailConversions`: `available` (false = server nemá zdroj konverzí, UI to napíše místo nul), `directHours` (24), `assistedDays` (5), `currencies` = jedna položka na měnu `{currency, direct: {orders, revenue, revenueWithoutVat}, assisted: {...}}` (desetinné řetězce, CZK a EUR nikdy dohromady), `orders` (nejvýš 100: `orderId`, `code`, `contactId`, `email`, `kind` `direct` nebo `assisted`, `clickedAt`, `orderedAt`, `currency`, `totalWithVat`, `totalWithoutVat`). Zdroj je párování objednávek (`core/conversions.py`): objednávka stejného kontaktu po jeho posledním prokliku, do 24 hodin přímá, od 24 hodin do 5 dní asistovaná; stornované a smazané se nepočítají. Období se na konverze neuplatňuje.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}},{"name":"node","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_campaign_conversions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailConversions"}}}},"400":{"description":"`validation` (message: to)","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}/stats/campaigns/{campaign_id}/heatmap":{"get":{"operationId":"stats_campaign_heatmap","summary":"Click map of a campaign","tags":["Statistics"],"description":"SE \"Heatmapa prokliků\": the campaign's HTML (merge tags unfilled, the UI shows it in a sandboxed frame without scripts) and the clicks per link of its e-mails.\n\nContract notes (cs):\n\n`{html, links}`: HTML e-mailu (u automatizace šablona uzlu `?node=`, bez uzlu prázdné) a prokliky každého odkazu. UI ho zobrazí v rámu bez skriptů a nad odkazy napíše podíl prokliků.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}},{"name":"node","in":"query","required":false,"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/EmailHeatmap"}}}},"400":{"description":"`validation` (message: to)","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}/stats/campaigns/{campaign_id}/recipients":{"get":{"operationId":"stats_campaign_recipients","summary":"Recipients of a campaign with their events (JSON or CSV)","tags":["Statistics"],"description":"Contract notes (cs):\n\n`?tab=all|opened|clicked|conversions|unsubscribed|bounced&q=&page=&pageSize=` + filtry reportu + vlastní Filtry tabulky (`opened`, `clicked`, `purchased`, `reopened`, `hard` = 1 nebo 0, `state` = received | processing | shipped | cancelled | unknown, `reason`) → `Page` řádků záložky (příjemci s ANO / NE a cenami po měnách, otevření s opakováním a klientem, jednotlivé prokliky, spárované objednávky se stavem a zbožím, odhlášení s důvodem a komentářem, vrácení s odpovědí serveru). `?format=csv` vrátí celou tabulku jako CSV (UTF-8 s BOM, středníky, buňka nikdy jako vzorec).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"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":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"humans","in":"query","required":false,"schema":{"type":"string"}},{"name":"node","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"name":"rows","in":"query","required":false,"schema":{"type":"string"}},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"vat","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"campaigns","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"JSON, or CSV with format=csv","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"`validation` (message: engagement, q, tab, to)","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}/stats/campaigns/{campaign_id}/report":{"get":{"operationId":"stats_campaign_report","summary":"Report of a campaign (JSON or CSV)","tags":["Statistics"],"description":"Contract notes (cs):\n\nDetail jako SE (`core/stats_report.py`), filtry `?engagement=A,B,…` (skupiny angažovanosti, prázdné = všechny), `?humans=1` (bez otevření přes proxy obrázků webmailu), `?vat=1` (peníze s DPH, jinak bez), u automatizace `?node=`. 400 `validation` / `engagement`, `humans`, `vat`. `EmailStatsReport`: hlavička (`name`, `status`, `startedAt`, `completedAt`, `shopId`, `nodes`), `filters`, `firstSentAt`, `lastSentAt`, `totals` (EmailMetrics + `orders`, `orderRate`, `reopeners`, `reopenRate`), `baseline` (poměry e-mailů účtu za 30 dní před kampaní, u automatizace před dneškem; `sent` = průměrná velikost jednorázové kampaně; `null` bez dat), `days` (po dnech od prvního e-mailu, nejvýš 31: unikátní otevření, prokliky, odhlášení, vrácení), `domains` (`sent`, `opened`, `clicked`, `unsubscribed`, `bounced`, `buyers`; `{name, count}`, `name` '' = zbytek), `clients` a `systems` (`opened`, `clicked`), `links` (`url`, `clicks`, `uniqueClicks`, `share`), `unsubscribeReasons` (`too_often`, `not_relevant`, `annoying`, `not_signed_up`, `spam_report`, `other`, `custom`, `none`, `misc`), `bounceReasons` (`mailbox_full`, `spam_filter`, `no_address`, `transfer_error`, `temporary`, `server_error`, `mx_error`, `greylisted`, `suppressed`, `other`), `bounceSplit`, `revenue` (po měnách: objednávky, přímé a asistované, průměr, obrat e-shopu stejné měny od prvního e-mailu do 5 dní po posledním a podíl), `revenueDays`, `conversionLinks`, `products` (prodané kusy s obrázkem), `engagementSpend`, `topSpenders`. CZK a EUR nikdy dohromady.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"campaign_id","in":"path","required":true,"description":"Id of the campaign (string of digits).","schema":{"type":"string"}},{"name":"engagement","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"Start of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"humans","in":"query","required":false,"schema":{"type":"string"}},{"name":"node","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"End of the period (YYYY-MM-DD local day, or ISO time where noted)."},{"name":"vat","in":"query","required":false,"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/EmailStatsReport"}}}},"400":{"description":"`validation` (message: engagement, to)","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}/stats/emails":{"get":{"operationId":"stats_emails","summary":"E-mail statistics of campaigns and automations","tags":["Statistics"],"description":"Sent campaigns and automation e-mails with their metrics, newest first.\n\nContract notes (cs):\n\n`?q=&kind=campaign|automation&shop=&ref=&name=&sentFrom=&sentTo=&sort=&page=&pageSize=` (`ref` = ID kampaně nebo automatizace, `name` = část názvu bez diakritiky; řazení `id`, `name`, `sentAt`, `sent`, `opens`, `uniqueOpens`, `openRate`, …) → `Page<EmailStatsItem>`: kampaně, které začaly odesílat, a e-mailové uzly automatizací, které něco odeslaly, nejnovější první. `id` = `c<id kampaně>` nebo `a<id automatizace>:<klíč uzlu>`, `kind`, `campaignId`, `automationId`, `nodeKey`, `name`, `nodeName`, `subject` (u automatizace předmět šablony uzlu), `shopId`, `status`, `sentAt` (začátek odesílání, u automatizace první e-mail uzlu), `stats: EmailMetrics`. Hledání bez diakritiky v názvu, uzlu a předmětu.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"automationIds","in":"query","required":false,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["campaign","automation"]},"description":"campaign or automation."},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Search text."},{"name":"ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"shop","in":"query","required":false,"schema":{"type":"string"},"description":"Shop id filter."},{"$ref":"#/components/parameters/sort"},{"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_email_stats","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStatsPage"}}}},"400":{"description":"`validation` (message: automationIds, countTo, kind, name, q, sentTo, sort)","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}/stock-photos":{"get":{"operationId":"stock_photos_search","summary":"Search stock photos","tags":["Templates"],"description":"Search of the photo bank (core/stock_photos.search_params): ?q, lang (cs, sk, en ...), imageType (all, photo, illustration, vector), orientation (all, horizontal, vertical), category, colors (comma separated), order (popular, latest), minWidth, minHeight, editorsChoice, page, perPage (3 to 200; at most 500 results). safesearch is always on. {total, totalHits, page, perPage, hits, source, sourceUrl}; the answers are cached for 24 hours.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"colors","in":"query","required":false,"schema":{"type":"string"}},{"name":"editorsChoice","in":"query","required":false,"schema":{"type":"string"}},{"name":"imageType","in":"query","required":false,"schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string"}},{"name":"minHeight","in":"query","required":false,"schema":{"type":"string"}},{"name":"minWidth","in":"query","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","required":false,"schema":{"type":"string"}},{"name":"orientation","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"name":"perPage","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/q"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockResult"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` (message: stock)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"502":{"description":"`upstream` (message: stock)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: stock)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/v1/tenants/{tenant}/stock-photos/status":{"get":{"operationId":"stock_photos_status","summary":"Whether the stock photo search is available","tags":["Templates"],"description":"{configured, source}: whether the photo bank has its key (the tab says it is not set up otherwise).","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/suppressions":{"get":{"operationId":"suppressions_list","summary":"List suppressed addresses","tags":["Contacts"],"description":"Suppression list (addresses never mailed) with reason.","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":"reason","in":"query","required":false,"schema":{"type":"string"},"description":"Reason filter (manual, unsubscribed, hard_bounce, complaint...)."}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_suppressions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string","description":"manual, unsubscribe, bounce, complaint ..."},"source":{"type":"string"},"detail":{"type":"string"},"blacklisted":{"type":"boolean"},"createdAt":{"type":"string"}},"description":"routes_contacts.suppression_json"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}}},"examples":{"contacts-suppressions":{"summary":"docs/api-examples/contacts.json suppressions","value":{"items":[{"email":"jana.novakova@example.cz","reason":"unsubscribed","source":"admin","detail":"","blacklisted":false,"createdAt":"2026-10-01T08:00:00.000Z"}],"total":1,"page":1,"pageSize":25}}}}}},"400":{"description":"`validation` (message: q)","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":"suppressions_add","summary":"Suppress an address","tags":["Contacts"],"description":"Adds an address to the suppression list (manual blacklist), also when it is not a contact.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Address."},"detail":{"type":"string","description":"Note."}},"required":["email"]}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-tool":"add_suppression","responses":{"201":{"description":"Created (200 when it already existed or nothing changed)","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string","description":"manual, unsubscribe, bounce, complaint ..."},"source":{"type":"string"},"detail":{"type":"string"},"blacklisted":{"type":"boolean"},"createdAt":{"type":"string"},"created":{"type":"boolean"}},"description":"routes_contacts.suppression_json"}}}},"200":{"description":"OK: it already existed or nothing changed","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string","description":"manual, unsubscribe, bounce, complaint ..."},"source":{"type":"string"},"detail":{"type":"string"},"blacklisted":{"type":"boolean"},"createdAt":{"type":"string"},"created":{"type":"boolean"}},"description":"routes_contacts.suppression_json"}}}},"400":{"description":"`validation` (message: detail, email)","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}/suppressions/blacklist-import":{"post":{"operationId":"suppressions_blacklist_import","summary":"Import addresses to the blacklist","tags":["Contacts"],"description":"SmartEmailing's blacklist on the tenant's blacklist (core/blacklist.py, migration 0180): body {contacts: the SmartEmailing backup list (blacklisted.json) or {emails: [addresses]}, apply: true to write (default: a dry run that writes nothing)}. Idempotent; nothing is sent, no automation starts, no other suppression or contact changes. 200 with the counts (never an address).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"apply":{},"contacts":{},"emails":{}}}}}},"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Counts (never addresses), notBlacklisted, applied."}}}},"400":{"description":"`validation` (message: apply, contacts)","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}/suppressions/{email}":{"delete":{"operationId":"suppressions_remove","summary":"Remove one suppression","tags":["Contacts"],"description":"Removes a manual suppression of an address (other reasons are locked).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"email","in":"path","required":true,"description":"E-mail address (URL encoded).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"remove_suppression","responses":{"204":{"description":"No content"},"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":"`suppression_locked`","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}/surveys":{"get":{"operationId":"surveys_index","summary":"List surveys","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/sort"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SurveySummary"}}},"required":["items"]}}}},"400":{"description":"`validation` (message: sort)","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":"surveys_create","summary":"Create a survey","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean","description":"An inactive survey answers 404."},"title":{"type":"string"},"intro":{"type":"string"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/SurveyPage"}},"thanksHtml":{"type":"string"},"afterUrl":{"type":"string","description":"Address after the last page instead of the thank-you text."},"oneResponse":{"type":"boolean","description":"One contact answers once (the recipient's link)."}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"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}/surveys/{survey_id}":{"delete":{"operationId":"surveys_delete","summary":"Delete a survey","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"survey_id","in":"path","required":true,"description":"Id of the survey (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"surveys_show","summary":"Get a survey","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"survey_id","in":"path","required":true,"description":"Id of the survey (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"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":"surveys_update","summary":"Update a survey","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"survey_id","in":"path","required":true,"description":"Id of the survey (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean","description":"An inactive survey answers 404."},"title":{"type":"string"},"intro":{"type":"string"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/SurveyPage"}},"thanksHtml":{"type":"string"},"afterUrl":{"type":"string","description":"Address after the last page instead of the thank-you text."},"oneResponse":{"type":"boolean","description":"One contact answers once (the recipient's link)."}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"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}/surveys/{survey_id}/copy":{"post":{"operationId":"surveys_copy","summary":"Copy a survey","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"survey_id","in":"path","required":true,"description":"Id of the survey (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"suffix":{"type":"string"}},"required":["suffix"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"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}/surveys/{survey_id}/responses":{"get":{"operationId":"surveys_responses","summary":"List responses of a survey","tags":["Templates"],"description":"?page=, ?pageSize= (at most 100): {items: [{id, contactId, email, answers, submittedAt}], total, page, pageSize}, newest first; email '' for an anonymous answer.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"survey_id","in":"path","required":true,"description":"Id of the survey (string of digits).","schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SurveyResponse"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: page)","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}/surveys/{survey_id}/results":{"get":{"operationId":"surveys_results","summary":"Summary results of a survey","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"survey_id","in":"path","required":true,"description":"Id of the survey (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyResults"}}}},"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}/templates":{"get":{"operationId":"templates_index","summary":"List templates","tags":["Templates"],"description":"E-mail templates (status active, archived or all) with size, usage and the stored content check.\n\n?status=active (default), archived or all.\n\nContract notes (cs):\n\n`?status=active` (výchozí), `archived` nebo `all` (jiná hodnota 400 `status`). `{ \"items\": [TemplateSummary] }`, naposledy upravené první.\n`TemplateSummary` = `{ \"id\", \"name\", \"subject\", \"preheader\", \"editor\", \"createdAt\", \"updatedAt\", \"tags\", \"size\", \"archived\", \"archivedAt\", \"readOnly\", \"usage\": { \"campaigns\", \"automations\" }, \"lastUsedAt\", \"check\": { \"errors\", \"warnings\", \"checkedAt\" } }` (krok F1-C):\n• `size` = velikost HTML v bajtech. `usage` = kampaně vytvořené ze šablony a uzly Odeslat e-mail automatizací, které ji posílají; `lastUsedAt` = nejnovější taková kampaň nebo e-mail automatizace (null = zatím nepoužitá).\n• `check` = kódy kontroly obsahu s pravidly tenanta, uložené při každém uložení obsahu, předmětu a preheaderu (stejná pravidla jako `POST /content/lint`; `image_too_large` jen v UI).\n• `archived`: šablona v archivu se nenabízí pro nové kampaně (kampaň s ní vrátí 400 `templateId`), jde ji duplikovat a obnovit. `readOnly`: archivní kopie originálu převzatého ze SmartEmailingu (tag `archiv-se:<id>`); obsah, název ani štítky se nemění, nejde ji smazat ani obnovit (409 `read_only`).\n• Aktivní šablona nikdy neodkazuje na `cdn-smartemailing.cz` ani `via.placeholder.com` (kód `banned_host`): vytvoření, duplikace a uložení obsahu aktivní šablony vrátí 400 `validation` s `message` `lint` a `params` `{ \"codes\": [\"banned_host\"], \"hosts\": [...] }`.\n• Šablona, kterou posílá aktivní automatizace, musí projít tvrdou kontrolou (David 1. 10.): emoji, když je tenant zakazuje, zakázaný host, HTML nad 102 000 B a chybějící `{{unsubscribe}}`. Od vlny šablon (migrace 0231) se kontroluje při publikaci konceptu (níže), jinak 400 `validation` / `lint` s `params.codes` (`emoji`, `banned_host`, `html_too_large`, `no_unsubscribe`). Automatizaci se šablonou, která kontrolou neprojde, nejde zapnout (problém `lint` u uzlu).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived","all"]},"description":"Status filter."}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_templates","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSummary"}}},"required":["items"]}}}},"400":{"description":"`validation` (message: status)","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":"templates_create","summary":"Create a template","tags":["Templates"],"description":"Creates a template with content {editor: html|visual, html, design}.\n\nBody {name, subject, preheader, tags, content, saveKind?}: 201 with the template; its first content goes to the save history with saveKind (default auto).\n\nContract notes (cs):\n\nTělo `{ \"name\", \"subject\", \"preheader\", \"content\": { \"editor\", \"html\", \"design\" } }`, odpověď `TemplateDetail` s `content.version` 1. Takhle vzniká šablona ze vzorové šablony, z kampaně („Uložit jako šablonu“) i kopie jiné šablony. `name` 1 až 150 znaků a v tenantu jedinečný bez ohledu na velikost písmen (409 `name`), `subject` a `preheader` do 200 znaků.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateInput"},"examples":{"abandoned-cart-template":{"summary":"docs/api-examples/abandoned-cart.json template","value":{"name":"Opuštěný košík","subject":"{{df_name|default('Dobrý den', true)}}, něco jste nechali v košíku","preheader":"Váš košík na vás počká ještě pár dní","content":{"editor":"html","design":null,"html":"<!doctype html><html><body><p>Dobrý den, {{df_salution|default('vážený zákazníku', true)}},</p><p>ve vašem košíku zůstalo {{ metadata.event.attributes.itemCount }} ks zboží za {{ metadata.event.attributes.total }} {{ metadata.event.attributes.currency }}.</p><p><a href=\"https://www.example.cz/kosik/\">Dokončit objednávku</a></p><p style=\"font-size:12px\">{{cl_company}}, {{cl_address}}. <a href=\"{{unsubscribe}}\">Odhlásit odběr</a></p></body></html>"}}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-tool":"create_template","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"},"examples":{"abandoned-cart-template":{"summary":"docs/api-examples/abandoned-cart.json template","value":{"id":"301","name":"Opuštěný košík","subject":"{{df_name|default('Dobrý den', true)}}, něco jste nechali v košíku","preheader":"Váš košík na vás počká ještě pár dní","editor":"html","createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z","tags":[],"size":465,"archived":false,"archivedAt":null,"readOnly":false,"usage":{"campaigns":0,"automations":0},"lastUsedAt":null,"check":{"errors":[],"warnings":["subject_long"],"checkedAt":"2026-10-01T08:00:00.000Z"},"content":{"editor":"html","html":"<!doctype html><html><body><p>Dobrý den, {{df_salution|default('vážený zákazníku', true)}},</p><p>ve vašem košíku zůstalo {{ metadata.event.attributes.itemCount }} ks zboží za {{ metadata.event.attributes.total }} {{ metadata.event.attributes.currency }}.</p><p><a href=\"https://www.example.cz/kosik/\">Dokončit objednávku</a></p><p style=\"font-size:12px\">{{cl_company}}, {{cl_address}}. <a href=\"{{unsubscribe}}\">Odhlásit odběr</a></p></body></html>","design":null,"version":1,"updatedAt":"2026-10-01T08:00:00.000Z"},"settings":{"linkParams":[],"headers":[],"unsubscribePageId":null,"footerId":null},"draft":{"pending":false,"savedAt":null,"publishedAt":null},"activeUses":{"automations":0,"emails":0,"campaigns":0},"publicUrl":"https://links.example.cz/template/1/72cf576a-85b2-474e-86e2-bfdbd1f4d38f"}}}}}},"400":{"description":"`validation` (message: saveKind)","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}/templates/tags":{"post":{"operationId":"templates_tags","summary":"Change labels of templates","tags":["Templates"],"description":"Štítky of e-mail templates (SE ⋮ \"Nastavit štítky\", bulk \"Přiřadit štítky\").","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":"content","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}/templates/{template_id}":{"delete":{"operationId":"templates_delete","summary":"Delete a template","tags":["Templates"],"description":"Deletes a template (campaigns keep their own copy of the content).\n\nContract notes (cs):\n\n204. Kampaně si obsah nechají, jen jejich `templateId` je null.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","x-mcp-tool":"delete_template","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"templates_show","summary":"Get a template with its content","tags":["Templates"],"description":"One template with its content (editor, html, design, version).\n\nContract notes (cs):\n\n`TemplateDetail` = položka a `content`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"x-mcp-tool":"get_template","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"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":"templates_update","summary":"Update template settings (name, subject, preheader ...)","tags":["Templates"],"description":"Changes name, subject, preheader or tags.\n\nContract notes (cs):\n\nTělo s libovolnou částí `{ \"name\", \"subject\", \"preheader\", \"tags\" }`, odpověď `TemplateDetail`. `tags` = nejvýš 20 štítků po 1 až 50 znacích (opakované se sloučí, 400 `tags`).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePatch"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"trigger","x-mcp-tool":"update_template","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"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}/templates/{template_id}/archive":{"post":{"operationId":"templates_archive","summary":"Archive a template","tags":["Templates"],"description":"Archives a template.\n\nContract notes (cs):\n\nOdpověď `TemplateDetail`. Obnova z archivu: 409 `read_only` pro originál, 409 `conflict` s `message` `lint` a `params` `{ \"codes\", \"hosts\" }`, když obsah odkazuje na zakázaný host.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-tool":"archive_template","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"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}/templates/{template_id}/content":{"put":{"operationId":"templates_save_content","summary":"Save the content of a template","tags":["Templates"],"description":"Saves the HTML or MJML content of a template. baseVersion = the version you read (conflict when someone saved since).\n\nContract notes (cs):\n\nTělo `{ \"editor\", \"html\", \"design\", \"baseVersion\", \"saveKind\"? }`, odpověď `EmailContent` (uložená verze). `saveKind` = `auto` (výchozí, automatické ukládání), `manual` (uživatel uložil) nebo `restore` (obnova starší verze); jiná hodnota 400 `saveKind` a nic se neuloží. Každé uložení zapíše snímek nového obsahu do historie (Historie uložení, níže). `POST /templates` bere `saveKind` taky a první obsah šablony jde do historie.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailContentInput"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"trigger","x-mcp-tool":"save_template_content","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailContent"}}}},"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}/templates/{template_id}/convert-to-visual":{"post":{"operationId":"templates_convert_to_visual","summary":"Convert an HTML template to the visual editor","tags":["Templates"],"description":"Creates a NEW visual (block) template converted from an HTML template; the original stays. Answers the template and conversion {quality: clean|partial|raw, stats}.\n\nBody {name} (optional, default \"<name> (vizuální)\"): a NEW visual template converted from an HTML template (core/html_to_mjml.py), 201 with the template and conversion {quality, stats}; the original stays as it is. 409 editor (not an HTML template), 409 content (nothing to convert), 409 name, 400 lint (banned hosts).\n\nContract notes (cs):\n\nPřevod HTML šablony na vizuální (blokovou) šablonu (`core/html_to_mjml.py`). Tělo `{ \"name\"? }` (bez jména „Název (vizuální)“; slovenské UI posílá „Názov (vizuálna)“), odpověď 201 `TemplateDetail` nové šablony a `conversion` `{ \"quality\", \"stats\" }`. Původní šablona se nemění. Nová šablona má předmět, preheader a štítky originálu (bez `se:` a `archiv-se:`), `content.editor` `visual`, `design` s MJML a `html` prázdné: zkompiluje a uloží ho editor při prvním otevření (stejně jako návrh ze vzoru).\n• `quality`: `clean` (jen upravitelné bloky), `partial` (část zůstala jako surové HTML v `mj-raw`), `raw` (nic upravitelného). `stats` = počty `text`, `heading`, `image`, `button`, `columns`, `sections`, `raw`, `hidden` (skrytý preheader), `statements` (kód šablony mezi bloky), `table_text` (vnořená tabulka v textu), `width` (změřená šířka obsahu v px).\n• Chyby: 404, 409 `editor` (šablona není HTML), 409 `content` (HTML bez obsahu k převodu), 409 `name`, 400 `lint` (odkaz na zakázaný host). Oprávnění jako duplikace (modul `content`, plný přístup; klíč API s plným rozsahem smí).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-tool":"convert_template_to_visual","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertedTemplate"}}}},"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}/templates/{template_id}/draft":{"delete":{"operationId":"templates_discard_draft","summary":"Discard the unpublished draft of a template","tags":["Templates"],"description":"Zahodit změny: the draft goes, the published content stays (409 draft without one). Answers the template.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"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}/templates/{template_id}/duplicate":{"post":{"operationId":"templates_duplicate","summary":"Duplicate a template","tags":["Templates"],"description":"Copies a template under a new name.\n\nBody {name}: the copy (active, writable), 201.\n\nContract notes (cs):\n\nTělo `{ \"name\", \"editor\"? }` (UI navrhne „Název (kopie)“), odpověď 201 `TemplateDetail`: aktivní a zapisovatelná kopie s předmětem, preheaderem, štítky (bez `se:` a `archiv-se:`), nastavením a obsahem (koncept, když ho šablona má). `\"editor\": \"html\"` udělá z vizuální šablony HTML šablonu se zkompilovaným HTML (SE „Kopírovat a upravit HTML“). Chyby jako u vytvoření (409 `name`, 400 `lint`).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"editor":{"type":"string","const":"html"}},"required":["name","editor"]},{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-tool":"duplicate_template","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"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}/templates/{template_id}/publish":{"post":{"operationId":"templates_publish","summary":"Publish the draft of a template used by an active automation","tags":["Templates"],"description":"Body {password} (a person with a password) or {confirm: <template name>} (Google sign-in, API key): the draft of a template becomes the content its e-mails send (SE \"Uložit a publikovat změny\", a dangerous action that asks for the password). 401 invalid_credentials (wrong password, counted like a sign-in), 429 after too many, 400 confirm, 409 draft (nothing to publish), 400 lint (hard checks). Answers the template.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePublishInput"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"400":{"description":"`validation` (message: confirm)","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}/templates/{template_id}/test":{"post":{"operationId":"templates_test","summary":"Send a test e-mail of a template","tags":["Templates"],"description":"Sends a test e-mail of a template to the account's test addresses only (list_test_recipients), with [TEST] in the subject.\n\nBody {shopId, to}: the shop gives the sender and the footer.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shopId":{"type":"string"},"to":{"type":"string"}},"required":["shopId","to"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-tool":"send_template_test","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendResult"}}}},"400":{"description":"`validation`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`unavailable` (message: mail)","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}/templates/{template_id}/unarchive":{"post":{"operationId":"templates_unarchive","summary":"Restore an archived template","tags":["Templates"],"description":"409 read_only for archive copies of imported originals, 409 lint (codes, hosts) for banned addresses.\n\nContract notes (cs):\n\nOdpověď `TemplateDetail`. Obnova z archivu: 409 `read_only` pro originál, 409 `conflict` s `message` `lint` a `params` `{ \"codes\", \"hosts\" }`, když obsah odkazuje na zakázaný host.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"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}/templates/{template_id}/versions":{"get":{"operationId":"templates_versions","summary":"List saved content versions of a template","tags":["Templates"],"description":"?before=<snapshot id>&limit=1..100 (default 50): {items: [{id, version, kind, createdAt, createdBy}], more}, newest first; createdBy = the saver's name or e-mail, null when not known.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}},{"name":"before","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentVersionList"}}}},"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}/templates/{template_id}/versions/{version_id}":{"get":{"operationId":"templates_version","summary":"Get one content version of a template","tags":["Templates"],"description":"One snapshot with content {editor, html, design}.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"template_id","in":"path","required":true,"description":"Id of the template (string of digits).","schema":{"type":"string"}},{"name":"version_id","in":"path","required":true,"description":"Id of the version (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentVersionDetail"}}}},"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}/test-recipients":{"get":{"operationId":"test_recipients","summary":"List the test addresses of the company","tags":["Templates"],"description":"Addresses that may receive test e-mails.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"x-mcp-tool":"list_test_recipients","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"test_recipients_update","summary":"Replace the test addresses of the company","tags":["Templates"],"description":"Body {items: [e-mail, ...]} (at most 20): the addresses test e-mails may go to (Nastavení › Odesílání).","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]}}},"description":"Required by the server: items."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]}}}},"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}/unsubscribe-pages":{"get":{"operationId":"unsubscribe_pages_index","summary":"List unsubscribe pages","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/UnsubscribePage"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"unsubscribe_pages_create","summary":"Create an unsubscribe page","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean","description":"Active pages may be the default; an active page cannot be deleted."},"mode":{"type":"string","enum":["page","redirect"],"description":"page = Zobrazit odhlašovací stránku; redirect = skip it, unsubscribe and go to redirectUrl."},"redirectUrl":{"type":"string"},"logoUrl":{"type":"string"},"videoUrl":{"type":"string","description":"YouTube only."},"language":{"type":"string","enum":["cs","sk","auto","en","pl","de","hu","it","ro","uk"]},"customHtml":{"type":"string"},"questionEnabled":{"type":"boolean"},"question":{"type":"string"},"answers":{"type":"array","items":{"type":"string"}},"afterUrl":{"type":"string","description":"Přesměrování po odhlášení ('' = the thank-you page); merge tags of the contact allowed."}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribePage"}}}},"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}/unsubscribe-pages/preview":{"post":{"operationId":"unsubscribe_pages_preview","summary":"Render an unsubscribe page preview","tags":["Templates"],"description":"The page of unsaved settings ({name, ... as a create}) as HTML with sample values.","parameters":[{"$ref":"#/components/parameters/tenant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean","description":"Active pages may be the default; an active page cannot be deleted."},"mode":{"type":"string","enum":["page","redirect"],"description":"page = Zobrazit odhlašovací stránku; redirect = skip it, unsubscribe and go to redirectUrl."},"redirectUrl":{"type":"string"},"logoUrl":{"type":"string"},"videoUrl":{"type":"string","description":"YouTube only."},"language":{"type":"string","enum":["cs","sk","auto","en","pl","de","hu","it","ro","uk"]},"customHtml":{"type":"string"},"questionEnabled":{"type":"boolean"},"question":{"type":"string"},"answers":{"type":"array","items":{"type":"string"}},"afterUrl":{"type":"string","description":"Přesměrování po odhlášení ('' = the thank-you page); merge tags of the contact allowed."}}}}}},"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string"}},"required":["html"]}}}},"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}/unsubscribe-pages/{unsub_page_id}":{"delete":{"operationId":"unsubscribe_pages_delete","summary":"Delete an unsubscribe page","tags":["Templates"],"description":"204; 409 active for an active page (deactivate it first).","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"unsub_page_id","in":"path","required":true,"description":"Id of the unsub page (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"204":{"description":"No content"},"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"}}},"get":{"operationId":"unsubscribe_pages_show","summary":"Get an unsubscribe page","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"unsub_page_id","in":"path","required":true,"description":"Id of the unsub page (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribePage"}}}},"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":"unsubscribe_pages_update","summary":"Update an unsubscribe page","tags":["Templates"],"description":"409 default when the default page would stop being active.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"unsub_page_id","in":"path","required":true,"description":"Id of the unsub page (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean","description":"Active pages may be the default; an active page cannot be deleted."},"mode":{"type":"string","enum":["page","redirect"],"description":"page = Zobrazit odhlašovací stránku; redirect = skip it, unsubscribe and go to redirectUrl."},"redirectUrl":{"type":"string"},"logoUrl":{"type":"string"},"videoUrl":{"type":"string","description":"YouTube only."},"language":{"type":"string","enum":["cs","sk","auto","en","pl","de","hu","it","ro","uk"]},"customHtml":{"type":"string"},"questionEnabled":{"type":"boolean"},"question":{"type":"string"},"answers":{"type":"array","items":{"type":"string"}},"afterUrl":{"type":"string","description":"Přesměrování po odhlášení ('' = the thank-you page); merge tags of the contact allowed."}}}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribePage"}}}},"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}/unsubscribe-pages/{unsub_page_id}/copy":{"post":{"operationId":"unsubscribe_pages_copy","summary":"Copy an unsubscribe page","tags":["Templates"],"description":"An inactive copy; body {suffix} (default 'kopie').","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"unsub_page_id","in":"path","required":true,"description":"Id of the unsub page (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"suffix":{"type":"string"}},"required":["suffix"]}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribePage"}}}},"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}/unsubscribe-pages/{unsub_page_id}/default":{"delete":{"operationId":"unsubscribe_pages_default_off","summary":"Stop using an unsubscribe page as the default","tags":["Templates"],"parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"unsub_page_id","in":"path","required":true,"description":"Id of the unsub page (string of digits).","schema":{"type":"string"}}],"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"x-mcp-confirm":"delete","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribePage"}}}},"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"}}},"post":{"operationId":"unsubscribe_pages_default","summary":"Make an unsubscribe page the default","tags":["Templates"],"description":"409 active for an inactive page.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"unsub_page_id","in":"path","required":true,"description":"Id of the unsub page (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"x-postarna-permission":{"module":"content","level":"full","keyScope":"full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribePage"}}}},"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}/web-tracking":{"get":{"operationId":"web_tracking_index","summary":"Web tracking state of every shop","tags":["Account"],"description":"Shops with the Používat switch, whether a scenario listens to their carts, and the script address.\n\nContract notes (cs):\n\nSE Datové zdroje › Webtracking (migrace 0151). GET (modul `settings`) `{ \"items\": [ { \"shopId\", \"code\", \"name\", \"domain\", \"enabled\", \"listening\", \"scriptUrl\" } ] }`: `enabled` = přepínač Používat (výchozí zapnuto), `listening` = v e-shopu běží scénář se spouštěčem Změna v košíku, `scriptUrl` = adresa `cart.js` pro řádek do patičky. PATCH (plný přístup `settings`) `{enabled: bool}` → 204; vypnutý e-shop košíky z webu neukládá (`web_tracking.record_cart` → `off`). `events` (modul `contacts`, jen čtení): události `cart`, `visit`, `custom` kontaktů tenanta od nejnovější (filtr `type` přijímá i `identification`, typ SE Identifikace; Poštárna ho zatím nezapisuje), `type`, `q` (e-mail), `shopId`, stránkování (max 100); položka `{ \"id\", \"type\", \"data\", \"at\", \"shopId\", \"source\", \"contactId\", \"email\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"}],"x-postarna-permission":{"module":"settings","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebTrackingShop"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tenants/{tenant}/web-tracking/events":{"get":{"operationId":"web_tracking_events","summary":"List web tracking events","tags":["Account"],"description":"SE grid Identifikováni: ?type=visit|identification|cart|custom, ?q= (e-mail), ?shopId=, paging.\n\nContract notes (cs):\n\nSE Datové zdroje › Webtracking (migrace 0151). GET (modul `settings`) `{ \"items\": [ { \"shopId\", \"code\", \"name\", \"domain\", \"enabled\", \"listening\", \"scriptUrl\" } ] }`: `enabled` = přepínač Používat (výchozí zapnuto), `listening` = v e-shopu běží scénář se spouštěčem Změna v košíku, `scriptUrl` = adresa `cart.js` pro řádek do patičky. PATCH (plný přístup `settings`) `{enabled: bool}` → 204; vypnutý e-shop košíky z webu neukládá (`web_tracking.record_cart` → `off`). `events` (modul `contacts`, jen čtení): události `cart`, `visit`, `custom` kontaktů tenanta od nejnovější (filtr `type` přijímá i `identification`, typ SE Identifikace; Poštárna ho zatím nezapisuje), `type`, `q` (e-mail), `shopId`, stránkování (max 100); položka `{ \"id\", \"type\", \"data\", \"at\", \"shopId\", \"source\", \"contactId\", \"email\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/q"},{"name":"shopId","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string"}}],"x-postarna-permission":{"module":"contacts","level":"read","keyScope":"read or full"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebTrackingEvent"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["items","total","page","pageSize"]}}}},"400":{"description":"`validation` (message: q, type)","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}/web-tracking/{shop_id}":{"patch":{"operationId":"web_tracking_switch","summary":"Switch web tracking of a shop","tags":["Account"],"description":"Contract notes (cs):\n\nSE Datové zdroje › Webtracking (migrace 0151). GET (modul `settings`) `{ \"items\": [ { \"shopId\", \"code\", \"name\", \"domain\", \"enabled\", \"listening\", \"scriptUrl\" } ] }`: `enabled` = přepínač Používat (výchozí zapnuto), `listening` = v e-shopu běží scénář se spouštěčem Změna v košíku, `scriptUrl` = adresa `cart.js` pro řádek do patičky. PATCH (plný přístup `settings`) `{enabled: bool}` → 204; vypnutý e-shop košíky z webu neukládá (`web_tracking.record_cart` → `off`). `events` (modul `contacts`, jen čtení): události `cart`, `visit`, `custom` kontaktů tenanta od nejnovější (filtr `type` přijímá i `identification`, typ SE Identifikace; Poštárna ho zatím nezapisuje), `type`, `q` (e-mail), `shopId`, stránkování (max 100); položka `{ \"id\", \"type\", \"data\", \"at\", \"shopId\", \"source\", \"contactId\", \"email\" }`.","parameters":[{"$ref":"#/components/parameters/tenant"},{"name":"shop_id","in":"path","required":true,"description":"Id of the shop (string of digits).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}},"description":"Required by the server: enabled."},"x-postarna-permission":{"module":"settings","level":"full","keyScope":"full"},"responses":{"204":{"description":"No content"},"400":{"description":"`validation` (message: enabled)","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/v3/account-info":{"get":{"operationId":"se_v3_account_info","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Account info (guid = tenant id for API v1)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"data":{"type":"object","properties":{"account_id":{"type":"integer"},"guid":{"type":"string","format":"uuid","description":"The {tenant} of API v1 paths."},"username":{"type":"string"},"firstname":{"type":["string","null"]},"surname":{"type":["string","null"]},"company":{"type":"string"},"phone":{"type":["string","null"]}}}},"required":["status","meta"]},"examples":{"getting-started-account-info":{"summary":"docs/api-examples/getting-started.json account-info","value":{"status":"ok","meta":[],"data":{"account_id":4,"guid":"3f6c2a1e-8b7d-4c5e-9f10-2a3b4c5d6e7f","username":"admin@example.cz","firstname":null,"surname":null,"company":"Example s.r.o.","phone":null}}}}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/check-credentials":{"get":{"operationId":"se_v3_check_credentials","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Check the credentials","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"message":{"type":"string"},"account_id":{"type":"integer"}},"required":["status","meta"]},"example":{"status":"ok","meta":[],"message":"Hi there! Your credentials are valid!","account_id":1}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}},"post":{"operationId":"se_v3_check_credentials_post","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Check the credentials","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"message":{"type":"string"},"account_id":{"type":"integer"}},"required":["status","meta"]},"example":{"status":"ok","meta":[],"message":"Hi there! Your credentials are valid!","account_id":1}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/contactlists":{"get":{"operationId":"se_v3_contactlists","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"List contact lists","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":500}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"select","in":"query","description":"Comma separated properties to return.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Comma separated properties, \"-\" = descending.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"object","properties":{"total_count":{"type":"integer"},"displayed_count":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/SeContactList"}}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/contactlists/{list_id}":{"get":{"operationId":"se_v3_contactlist","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Get a contact list","parameters":[{"name":"list_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"data":{"$ref":"#/components/schemas/SeContactList"}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/contacts":{"get":{"operationId":"se_v3_contacts","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"List contacts","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":500}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"select","in":"query","description":"Comma separated properties to return.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Comma separated properties, \"-\" = descending.","schema":{"type":"string"}},{"name":"emailaddress","in":"query","schema":{"type":"string"},"description":"Exact e-mail."},{"name":"id","in":"query","schema":{"type":"integer"}},{"name":"blacklisted","in":"query","schema":{"type":"integer","enum":[0,1]}},{"name":"hardbounced","in":"query","schema":{"type":"integer","enum":[0,1]}},{"name":"expand","in":"query","schema":{"type":"string","enum":["customfields"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"object","properties":{"total_count":{"type":"integer"},"displayed_count":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/SeContact"}}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/contacts/{contact_id}":{"get":{"operationId":"se_v3_contact","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Get a contact","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"expand","in":"query","schema":{"type":"string","enum":["customfields"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"data":{"$ref":"#/components/schemas/SeContact"}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/customfields":{"get":{"operationId":"se_v3_customfields","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"List custom fields","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":500}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"select","in":"query","description":"Comma separated properties to return.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Comma separated properties, \"-\" = descending.","schema":{"type":"string"}},{"name":"expand","in":"query","schema":{"type":"string","enum":["customfield_options"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"object","properties":{"total_count":{"type":"integer"},"displayed_count":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/SeCustomField"}}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/ping":{"get":{"operationId":"se_v3_ping","tags":["SmartEmailing v3"],"security":[],"summary":"Ping (no authentication)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"message":{"type":"string"}},"required":["status","meta"]},"example":{"status":"ok","meta":[],"message":"Hi there! API version 3 here!"}}}}}}},"/api/v3/web-hooks":{"get":{"operationId":"se_v3_webhooks","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"List account webhooks","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":500}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"select","in":"query","description":"Comma separated properties to return.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Comma separated properties, \"-\" = descending.","schema":{"type":"string"}},{"name":"id","in":"query","schema":{"type":"string"}},{"name":"event","in":"query","schema":{"type":"string"}},{"name":"url","in":"query","schema":{"type":"string"}},{"name":"active","in":"query","schema":{"type":"string"}},{"name":"method","in":"query","schema":{"type":"string"}},{"name":"timeout","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"object","properties":{"total_count":{"type":"integer"},"displayed_count":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/SeWebhook"}}},"required":["status","meta"]},"examples":{"webhook-consumer-list":{"summary":"docs/api-examples/webhook-consumer.json list","value":{"status":"ok","meta":{"total_count":2,"displayed_count":2,"offset":0,"limit":500},"data":[{"id":7,"url":"https://crm.example.cz/postarna/webhook","method":"POST","event":"new_contact","active":1,"timeout":30,"last_response_code":null,"last_call_time":null,"errors_in_row":0,"basic_auth":{"login":"***","password":"***"}},{"id":8,"url":"https://crm.example.cz/postarna/webhook","method":"POST","event":"unsubscribed_contact","active":1,"timeout":30,"last_response_code":null,"last_call_time":null,"errors_in_row":0,"basic_auth":{"login":"***","password":"***"}}]}}}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}},"post":{"operationId":"se_v3_webhook_create_post","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Register an account webhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["target_url","event"],"properties":{"target_url":{"type":"string","description":"http(s) URL, at most 1 000 characters; public addresses only."},"event":{"type":"string","enum":["new_contact","updated_contact","unsubscribed_contact","email_delivery_started","delivery_status","sent_email","email_open","email_click","scoring_result_changed","engagement_level_changed","sms_delivery_status"],"description":"Fired: new_contact, updated_contact, unsubscribed_contact, delivery_status, sent_email, email_open, email_click. Accepted but never fired yet: email_delivery_started, scoring_result_changed, engagement_level_changed, sms_delivery_status."},"basic_auth":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}},"description":"Optional HTTP Basic the calls send (login 1 to 200 without \":\", password 1 to 500)."}}},"example":{"target_url":"https://crm.example.cz/postarna","event":"unsubscribed_contact"},"examples":{"webhook-consumer-register-new":{"summary":"docs/api-examples/webhook-consumer.json register-new","value":{"target_url":"https://crm.example.cz/postarna/webhook","event":"new_contact","basic_auth":{"login":"postarna","password":"example-webhook-password"}}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"id":{"type":"integer"}},"required":["status","meta"]},"example":{"status":"created","meta":[],"id":7}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"409":{"description":"Already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"},"examples":{"webhook-consumer-duplicate":{"summary":"docs/api-examples/webhook-consumer.json duplicate","value":{"status":"error","meta":[],"message":"Already exists"}}}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/web-hooks/{webhook_id}":{"delete":{"operationId":"se_v3_webhook_delete_delete","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Delete an account webhook","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/mcp":{"post":{"operationId":"mcp","tags":["MCP"],"summary":"MCP JSON-RPC endpoint (Streamable HTTP, stateless)","description":"Model Context Protocol 2025-11-25 (also 2025-06-18 and 2025-03-26). Methods initialize, ping, tools/list, tools/call, resources/list, resources/read, resources/templates/list, prompts/list, logging/setLevel. A batch (array) of at most 20 messages. Without a valid token 401 with WWW-Authenticate: Bearer resource_metadata=\".../.well-known/oauth-protected-resource/mcp\". 300 messages a minute per token. Tools wrap API v1 routes (x-mcp-tool on each operation); routes marked x-mcp-confirm answer a preview with a confirm token first.","security":[{"oauth2":["read"]},{"oauth2":["full"]},{"bearerAuth":[]}],"parameters":[{"name":"MCP-Protocol-Version","in":"header","required":false,"schema":{"type":"string","enum":["2025-11-25","2025-06-18","2025-03-26"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/JsonRpcRequest"},{"type":"array","items":{"$ref":"#/components/schemas/JsonRpcRequest"},"maxItems":20}]},"example":{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_contacts","arguments":{"q":"novak@example.cz"}}}}}},"responses":{"200":{"description":"JSON-RPC result or error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"202":{"description":"Accepted (a notification or a client response)"},"400":{"description":"Bad JSON-RPC envelope or unsupported protocol version"},"401":{"description":"No or invalid token; WWW-Authenticate names the resource metadata"},"403":{"description":"Origin not allowed"},"429":{"description":"Over 300 messages a minute","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/oauth/authorize":{"get":{"operationId":"oauth_authorize","tags":["OAuth"],"security":[],"summary":"Authorization (browser redirect to the consent page)","parameters":[{"name":"response_type","in":"query","required":true,"schema":{"type":"string"}},{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","required":true,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"resource","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"302":{"description":"To /connect (consent) or back to the client with an error"}}}},"/oauth/register":{"post":{"operationId":"oauth_register","tags":["OAuth"],"security":[],"summary":"Dynamic client registration (RFC 7591, at most 20 an hour per address)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["redirect_uris"],"properties":{"redirect_uris":{"type":"array","items":{"type":"string"},"description":"https; http only on loopback; custom schemes only of known native clients."},"client_name":{"type":"string"},"token_endpoint_auth_method":{"type":"string","enum":["none","client_secret_post","client_secret_basic"]}}}}}},"responses":{"201":{"description":"client_id (and client_secret)","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"invalid_redirect_uri or invalid_client_metadata"}}}},"/oauth/revoke":{"post":{"operationId":"oauth_revoke","tags":["OAuth"],"security":[],"summary":"Revoke a token (RFC 7009)","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"token":{"type":"string"},"token_type_hint":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"Revoked (also for an unknown token)"}}}},"/oauth/token":{"post":{"operationId":"oauth_token","tags":["OAuth"],"security":[],"summary":"Tokens: authorization_code or refresh_token (access pso_... 1 hour, refresh psr_... 30 days, rotated)","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string"},"code":{"type":"string"},"redirect_uri":{"type":"string"},"code_verifier":{"type":"string"},"refresh_token":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"resource":{"type":"string"}},"required":["grant_type"]}}}},"responses":{"200":{"description":"access_token, token_type Bearer, expires_in, refresh_token, scope","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"invalid_grant, invalid_request ..."}}}}},"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."},"q":{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Search text (case and diacritics insensitive)."},"shop":{"name":"shop","in":"query","required":false,"schema":{"type":"string"},"description":"Only objects of this shop (shop id)."},"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":{"AccountCompany":{"type":"object","properties":{"name":{"type":"string"},"companyId":{"type":"string"},"vatId":{"type":"string"}},"required":["name","companyId","vatId"],"description":"The company holding the account (GET /tenants/{t}/company)."},"AccountWebhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"event":{"type":"string","enum":["new_contact","updated_contact","unsubscribed_contact","email_delivery_started","delivery_status","sent_email","email_open","email_click","scoring_result_changed","engagement_level_changed","sms_delivery_status"]},"active":{"type":"boolean","description":"false = switched off (by hand, or by itself after errorsLimit errors in a row)."},"silent":{"type":"boolean","description":"Accepted for compatibility, never fires yet."},"timeoutS":{"type":"number"},"basicLogin":{"type":["string","null"],"description":"HTTP Basic user name; the password is never answered."},"lastResponseCode":{"type":["number","null"]},"lastCallAt":{"type":["string","null"]},"errorsInRow":{"type":"number"},"errorsLimit":{"type":"number"},"viaApi":{"type":"boolean","description":"Registered with an API key (API v3)."},"createdAt":{"type":"string"}},"required":["id","url","event","active","silent","timeoutS","basicLogin","lastResponseCode","lastCallAt","errorsInRow","errorsLimit","viaApi","createdAt"],"description":"An account webhook (Nastavení › Datové zdroje › Webhooky; the same rows as API v3 /web-hooks)."},"AccountWebhookInput":{"type":"object","properties":{"url":{"type":"string"},"event":{"type":"string","enum":["new_contact","updated_contact","unsubscribed_contact","email_delivery_started","delivery_status","sent_email","email_open","email_click","scoring_result_changed","engagement_level_changed","sms_delivery_status"]},"active":{"type":"boolean"},"basicAuth":{"type":["object","null"],"properties":{"login":{"type":"string"},"password":{"type":"string"}},"required":["login","password"],"description":"null removes the credentials; password '' keeps the stored password (edit only)."}}},"AccountWebhookTest":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":["number","null"]},"ms":{"type":["number","null"]},"error":{"type":"string"}},"required":["ok","status","ms","error"],"description":"Result of Otestovat: error scheme | dns | address | deadline | network | status ('' when ok)."},"AccountWebhooks":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AccountWebhook"}},"events":{"type":"array","items":{"type":"string","enum":["new_contact","updated_contact","unsubscribed_contact","email_delivery_started","delivery_status","sent_email","email_open","email_click","scoring_result_changed","engagement_level_changed","sms_delivery_status"]}},"silentEvents":{"type":"array","items":{"type":"string","enum":["new_contact","updated_contact","unsubscribed_contact","email_delivery_started","delivery_status","sent_email","email_open","email_click","scoring_result_changed","engagement_level_changed","sms_delivery_status"]}},"limit":{"type":"number"}},"required":["items","events","silentEvents","limit"]},"Activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/ActivityType"},"at":{"type":"string"},"title":{"type":"string","description":"Campaign, form or order name; tenant data, shown as is."}},"required":["id","type","at","title"]},"ActivityDetail":{"type":"object","properties":{"email":{"type":["string","null"]},"messageKind":{"type":["string","null"],"enum":["campaign","automation",null]},"campaignId":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"automationId":{"type":["string","null"]},"automationName":{"type":["string","null"]},"templateId":{"type":["string","null"]},"templateName":{"type":["string","null"]},"source":{"type":["string","null"]},"orderId":{"type":["string","null"]}},"required":["email","messageKind","campaignId","campaignName","automationId","automationName","templateId","templateName","source","orderId"],"description":"What the expanded activity card shows (SE: E-mail, Newsletter or Automatizace, Šablona, Zdroj); null = none."},"ActivityType":{"type":"string","enum":["other","unsubscribed","bounced","form","sent","opened","clicked","doi","order","status_change","web_tracking","note","call","deal"]},"AddMembersResult":{"type":"object","properties":{"added":{"type":"number"},"alreadyMember":{"type":"number","description":"Already confirmed or unconfirmed in the list."},"skipped":{"type":"number","description":"Unsubscribed from the list, unsubscribed, bounced, complained or suppressed: never re-subscribed by hand."}},"required":["added","alreadyMember","skipped"]},"AiConnection":{"type":"object","properties":{"id":{"type":"string"},"clientName":{"type":"string","description":"Name the app registered with (ChatGPT, Claude...)."},"redirectHost":{"type":"string","description":"Where the app took the member back after the consent: the app's host (or its app scheme)."},"scope":{"$ref":"#/components/schemas/ConnectorScope"},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":["string","null"]}},"required":["id","email"],"description":"The member who approved it; the app works with this member's current roles."},"createdAt":{"type":"string"},"approvedAt":{"type":"string"},"lastUsedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]}},"required":["id","clientName","redirectHost","scope","user","createdAt","approvedAt","lastUsedAt","revokedAt"],"description":"An AI app connected to the account over OAuth (MCP connector, docs/mcp.md)."},"AiConnections":{"type":"object","properties":{"serverUrl":{"type":"string","description":"The MCP server address to paste into an AI app."},"items":{"type":"array","items":{"$ref":"#/components/schemas/AiConnection"}},"canManageAll":{"type":"boolean","description":"true = every member's apps are listed (module api_keys), false = the member's own."}},"required":["serverUrl","items","canManageAll"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","description":"The first 8 characters of the key (pst_ and 4) to recognise it."},"roles":{"type":"array","items":{"type":"string","enum":["account_admin","marketing_manager","content_manager","data_analyst","developer","finance"]}},"scope":{"$ref":"#/components/schemas/ConnectorScope"},"status":{"$ref":"#/components/schemas/ApiKeyStatus"},"createdBy":{"type":["object","null"],"properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"]},"createdAt":{"type":"string"},"expiresAt":{"type":["string","null"],"description":"The end of the last valid day; null = the key never expires (it still goes idle after 180 days without use)."},"lastUsedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]}},"required":["id","name","prefix","roles","scope","status","createdBy","createdAt","expiresAt","lastUsedAt","revokedAt"]},"ApiKeyCreated":{"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiKey"},"key":{"type":"string","description":"The secret (pst_ and 43 characters): shown this once."}},"required":["apiKey","key"]},"ApiKeyInput":{"type":"object","properties":{"name":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["account_admin","marketing_manager","content_manager","data_analyst","developer","finance"]}},"expiresAt":{"type":["string","null"],"description":"The last valid calendar day of the tenant (YYYY-MM-DD), tomorrow to API_KEY_MAX_DAYS ahead; null or left out =\nthe key never expires (Neomezeně)."},"scope":{"type":"string","enum":["read","full"],"description":"Default full (as keys made before scopes)."}},"required":["name","roles"]},"ApiKeyStatus":{"type":"string","enum":["active","expired","revoked","idle"]},"AppNotification":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/NotificationType"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]},"description":"Values for the placeholders of notifications.type.<type>; numbers are formatted by the UI."},"important":{"type":"boolean"},"read":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","type","params","important","read","createdAt"]},"ApproveInput":{"type":"object","properties":{"sendAt":{"type":["string","null"],"description":"null = send now; otherwise at least 5 minutes and at most 365 days ahead."},"expectedRecipients":{"type":"number","description":"The number the user confirmed; the server refuses (409 recipients) when the audience drifted more than 5 %."}},"required":["sendAt","expectedRecipients"]},"AresCompany":{"type":"object","properties":{"companyName":{"type":"string"},"companyId":{"type":"string"},"vatId":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"}},"required":["companyName","companyId","vatId","street","city","zip","country"]},"AudienceCount":{"type":"object","properties":{"matched":{"type":"number","description":"Unique contacts in the chosen lists and segments."},"recipients":{"type":"number","description":"Who would receive the campaign now."},"excluded":{"type":"object","properties":{"unconfirmed":{"type":"number"},"not_mailable":{"type":"number"},"weak_consent":{"type":"number"},"exception_expired":{"type":"number"},"no_purpose":{"type":"number"},"excluded_list":{"type":"number"},"excluded_manual":{"type":"number"},"inactive":{"type":"number"}},"required":["unconfirmed","not_mailable","weak_consent","exception_expired","no_purpose","excluded_list","excluded_manual","inactive"]}},"required":["matched","recipients","excluded"]},"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"]},"AutomationBranch":{"type":"string","enum":["next","yes","no","v1","v2","v3","v4","v5","v6","v7","v8","v9","v10"]},"AutomationConfig":{"type":"object","additionalProperties":{},"description":"Settings of a node: JSON values as in API-CONTRACT.md (numbers, \"HH:MM\", \"YYYY-MM-DDTHH:MM\", ids as strings)."},"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)."},"BankDetails":{"type":"object","properties":{"account":{"type":"string"},"iban":{"type":"string"}},"required":["account","iban"]},"BillingBlock":{"type":"string","enum":["","free_limit","unpaid"]},"BillingCurrency":{"type":"string","enum":["CZK","EUR"]},"BillingOverview":{"type":"object","properties":{"subscription":{"$ref":"#/components/schemas/Subscription"},"priceList":{"$ref":"#/components/schemas/PriceList"},"profile":{"$ref":"#/components/schemas/BillingProfile"},"bank":{"type":"object","properties":{"CZK":{"anyOf":[{"$ref":"#/components/schemas/BankDetails"},{"type":"null"}]},"EUR":{"anyOf":[{"$ref":"#/components/schemas/BankDetails"},{"type":"null"}]}},"required":["CZK","EUR"],"description":"null = the platform has not set that account yet (\"nenastaveno\")."},"cardPayment":{"type":"string","const":"soon"},"support":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"}},"required":["email","phone"]}},"required":["subscription","priceList","profile","bank","cardPayment","support"]},"BillingPeriod":{"type":"string","enum":["monthly","annual"]},"BillingProfile":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"billingEmail":{"type":"string"},"phone":{"type":"string"},"isCompany":{"type":"boolean"},"country":{"type":"string"},"companyName":{"type":"string"},"companyId":{"type":"string"},"vatId":{"type":"string"},"vatPayer":{"type":"boolean"},"street":{"type":"string"},"city":{"type":"string"},"zip":{"type":"string"},"currency":{"$ref":"#/components/schemas/BillingCurrency"},"saved":{"type":"boolean"},"complete":{"type":"boolean"},"vatCheck":{"allOf":[{"$ref":"#/components/schemas/VatCheck"}],"description":"The VIES check of the VAT ID (server only; never sent back on save)."}},"required":["firstName","lastName","billingEmail","phone","isCompany","country","companyName","companyId","vatId","vatPayer","street","city","zip","currency"]},"BillingQuote":{"type":"object","properties":{"tier":{"$ref":"#/components/schemas/PriceTier"},"currency":{"$ref":"#/components/schemas/BillingCurrency"},"period":{"$ref":"#/components/schemas/BillingPeriod"},"monthly":{"type":"string"},"net":{"type":"string"},"vatRate":{"type":"string"},"vat":{"type":"string"},"total":{"type":"string"},"reverseCharge":{"type":"boolean"},"annualSaving":{"type":"string"},"beforeDiscount":{"type":["string","null"]},"upgradeNet":{"type":["string","null"]},"change":{"type":"string","enum":["new","upgrade","downgrade","same"],"description":"new = a new subscription (first invoice below), upgrade now, downgrade from the next period, same tier."},"contacts":{"type":"number"},"fits":{"type":"boolean","description":"The contacts fit the tier now (a downgrade is refused otherwise)."},"firstStart":{"type":["string","null"]},"firstEnd":{"type":["string","null"]},"firstNet":{"type":["string","null"]},"firstVat":{"type":["string","null"]},"firstTotal":{"type":["string","null"]}},"required":["tier","currency","period","monthly","net","vatRate","vat","total","reverseCharge","annualSaving","beforeDiscount","upgradeNet","change","contacts","fits","firstStart","firstEnd","firstNet","firstVat","firstTotal"]},"BillingSlice":{"type":"object","properties":{"on":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"},"net":{"type":"string"}},"required":["on","start","end","net"],"description":"A period and its net price."},"BlacklistResult":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string","enum":["invalid","manual","unsubscribed","hard_bounce","complaint","soft_bounce_limit"]},"source":{"type":"string"},"detail":{"type":"string","description":"The note why (empty when none was given)."},"createdAt":{"type":"string"},"created":{"type":"boolean","description":"False when the contact was already on the blacklist (its note stays)."}},"required":["email","reason","source","detail","createdAt","created"],"description":"A blacklist entry made from the contact card (POST /contacts/{id}/blacklist)."},"BoxPadding":{"type":"object","properties":{"top":{"type":"number"},"right":{"type":"number"},"bottom":{"type":"number"},"left":{"type":"number"}},"required":["top","right","bottom","left"]},"CampaignAudience":{"type":"object","properties":{"listIds":{"type":"array","items":{"type":"string"}},"segmentIds":{"type":"array","items":{"type":"string"},"description":"Segments of the campaign shop."},"excludeListIds":{"type":"array","items":{"type":"string"},"description":"Members of these lists are left out."},"excludeInactive":{"type":"boolean","description":"Leave out engagement E and the excluded state (long inactive); recommended."},"excludeEmails":{"type":"array","items":{"type":"string"},"description":"Addresses left out by hand (at most 1000)."},"onlyWithPurpose":{"type":"boolean","description":"Only contacts with a valid consent for one of purposeIds (any purpose when empty)."},"purposeIds":{"type":"array","items":{"type":"string"}}},"required":["listIds","segmentIds","excludeListIds","excludeInactive","excludeEmails","onlyWithPurpose","purposeIds"]},"CampaignDetail":{"type":"object","properties":{"preheader":{"type":"string"},"senderId":{"type":["string","null"]},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"templateId":{"type":["string","null"],"description":"Template the content was copied from (information only; later template edits do not change the campaign)."},"hasContent":{"type":"boolean","description":"The campaign has its own content (GET …/content); without it the approval answers 400 content."},"audience":{"$ref":"#/components/schemas/CampaignAudience"},"pausedReason":{"type":["string","null"],"enum":["manual","bounce_rate","complaint_rate","unsubscribe_rate","recipient_drift","template_error",null]},"approvedAt":{"type":["string","null"],"description":"SE's Aktivováno: when the campaign was approved for sending (null for drafts)."},"trackOpens":{"type":"boolean","description":"Advanced step: tracking (on by default as in SE), UTM on links of the campaign's e-shop, own X- headers."},"trackClicks":{"type":"boolean"},"utm":{"anyOf":[{"$ref":"#/components/schemas/CampaignUtm"},{"type":"null"}]},"headers":{"type":"array","items":{"$ref":"#/components/schemas/CampaignHeader"}},"timing":{"allOf":[{"$ref":"#/components/schemas/SendTiming"}],"description":"Send time chosen in step 1 of the draft; the approval still takes the time explicitly."},"plannedAt":{"type":["string","null"]},"linkParams":{"type":"array","items":{"$ref":"#/components/schemas/CampaignLinkParam"},"description":"Step 3 \"Sledování odkazů\" (SE): free name / value pairs added to links of the campaign's e-shop."},"preferTime":{"type":"boolean","description":"Step 3 \"Ideální čas odeslání\": each contact at the hour of his or her usual opens, within 24 hours."},"replyToOptions":{"type":"array","items":{"type":"string"},"description":"Addresses that may receive replies (the shop's sender addresses and their reply-to)."},"unsubscribePageId":{"type":["string","null"],"description":"Step 3 Odhlašovací stránka (SE, migration 0391): the campaign's own page; null = the template's or the default."},"footerId":{"type":["string","null"],"description":"Vybraná patička / Patička emailu (PA-01, migration 0410): a published footer; null = the template's or the\ndefault one."},"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"subject":{"type":"string"},"status":{"type":"string","enum":["cancelled","completed","draft","scheduled","sending","paused"]},"recipients":{"type":["number","null"],"description":"Recipients frozen at approval (expected_recipients); null for drafts."},"scheduledAt":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"publicUrl":{"type":"string","description":"Odkaz ke sdílení: the campaign's public preview (merge tags unfilled); absent from older servers."},"stats":{"anyOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}],"description":"null until sending starts."},"variantGroupId":{"type":["string","null"],"description":"Language variants sent together (Kampaně › Varianty): the group's id, null or absent for a single campaign."},"variantLabel":{"type":"string","description":"Short name of the variant (CZ, SK ...); '' for a single campaign."},"variantPosition":{"type":"number","description":"Order in the group: a contact in several variants' audiences receives only the first one."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (Štítky, set from the grid's ⋮ menu or as a bulk action); absent from older servers."}},"required":["preheader","senderId","fromName","fromEmail","replyTo","templateId","hasContent","audience","pausedReason","approvedAt","trackOpens","trackClicks","utm","headers","timing","plannedAt","linkParams","preferTime","replyToOptions","id","name","shopId","subject","status","recipients","scheduledAt","startedAt","completedAt","createdAt","updatedAt","stats"]},"CampaignHeader":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"CampaignInput":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":"string"},"senderId":{"type":["string","null"],"description":"A sender address of the campaign shop; it must be verified for approval."},"fromName":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"templateId":{"type":["string","null"],"description":"Template the content was copied from; the content itself is saved with saveCampaignContent."},"audience":{"$ref":"#/components/schemas/CampaignAudience"},"trackOpens":{"type":"boolean"},"trackClicks":{"type":"boolean"},"utm":{"anyOf":[{"$ref":"#/components/schemas/CampaignUtm"},{"type":"null"}]},"headers":{"type":"array","items":{"$ref":"#/components/schemas/CampaignHeader"}},"timing":{"type":"string","enum":["now","schedule","later"]},"plannedAt":{"type":["string","null"]},"replyTo":{"type":"string","description":"One of replyToOptions; '' = the sender's own reply-to."},"linkParams":{"type":"array","items":{"$ref":"#/components/schemas/CampaignLinkParam"}},"preferTime":{"type":"boolean"},"unsubscribePageId":{"type":["string","null"],"description":"An active unsubscribe page of the tenant, null = the template's or the default; left out on a new draft made\nfrom a template = the template's page."},"footerId":{"type":["string","null"],"description":"A published footer of the tenant, null = the template's or the default; left out on a new draft made from a\ntemplate = the template's footer."}},"required":["name","shopId","senderId","fromName","subject","preheader","templateId","audience"]},"CampaignLinkParam":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"CampaignListItem":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"subject":{"type":"string"},"status":{"type":"string","enum":["cancelled","completed","draft","scheduled","sending","paused"]},"recipients":{"type":["number","null"],"description":"Recipients frozen at approval (expected_recipients); null for drafts."},"scheduledAt":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"approvedAt":{"type":["string","null"],"description":"SE's Aktivováno: when the campaign was approved for sending (null for drafts)."},"publicUrl":{"type":"string","description":"Odkaz ke sdílení: the campaign's public preview (merge tags unfilled); absent from older servers."},"stats":{"anyOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}],"description":"null until sending starts."},"variantGroupId":{"type":["string","null"],"description":"Language variants sent together (Kampaně › Varianty): the group's id, null or absent for a single campaign."},"variantLabel":{"type":"string","description":"Short name of the variant (CZ, SK ...); '' for a single campaign."},"variantPosition":{"type":"number","description":"Order in the group: a contact in several variants' audiences receives only the first one."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (Štítky, set from the grid's ⋮ menu or as a bulk action); absent from older servers."}},"required":["id","name","shopId","subject","status","recipients","scheduledAt","startedAt","completedAt","createdAt","updatedAt","stats"]},"CampaignPreview":{"type":"object","properties":{"subject":{"type":"string"},"preheader":{"type":"string"},"html":{"type":"string"}},"required":["subject","preheader","html"],"description":"The e-mail as one contact would get it (POST /campaigns/{id}/preview): every merge tag filled, sample links."},"CampaignRule":{"type":"object","properties":{"type":{"type":"string","const":"campaign"},"operator":{"type":"string","enum":["opened","clicked","received","not_received","not_opened","not_clicked"]},"campaignId":{"type":["string","null"],"description":"null = any campaign (only with received, SE \"Byl odeslán e-mail...\" without a campaign)."},"linkUrl":{"type":["string","null"]},"days":{"type":["string","null"]}},"required":["type","operator","campaignId","days"],"description":"received/opened/clicked of that campaign's message to the contact; with linkUrl (clicked/not_clicked only) a\nspecific link of it instead of any click. not_* also covers a contact the campaign never reached."},"CampaignStats":{"type":"object","properties":{"sent":{"type":"number"},"delivered":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"unsubscribed":{"type":"number"}},"required":["sent","delivered","opened","clicked","bounced","complained","unsubscribed"],"description":"Unique contacts per event type."},"CampaignUtm":{"type":"object","properties":{"source":{"type":"string"},"medium":{"type":"string"},"campaign":{"type":"string"},"term":{"type":"string"},"content":{"type":"string"}},"required":["source","medium","campaign"]},"CampaignVariant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"shopId":{"type":"string"},"shopCode":{"type":"string"},"currency":{"$ref":"#/components/schemas/Currency"},"language":{"$ref":"#/components/schemas/Lang"},"subject":{"type":"string"},"preheader":{"type":"string"},"status":{"type":"string","enum":["cancelled","completed","draft","scheduled","sending","paused"]},"senderId":{"type":["string","null"]},"fromName":{"type":"string"},"hasContent":{"type":"boolean"},"listIds":{"type":"array","items":{"type":"string"}},"segmentIds":{"type":"array","items":{"type":"string"}},"recipients":{"type":["number","null"],"description":"Final number frozen at the approval; null for drafts."},"scheduledAt":{"type":["string","null"]},"pausedReason":{"type":["string","null"],"enum":["manual","bounce_rate","complaint_rate","unsubscribe_rate","recipient_drift","template_error",null]},"stats":{"anyOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}]}},"required":["id","name","label","position","shopId","shopCode","currency","language","subject","preheader","status","senderId","fromName","hasContent","listIds","segmentIds","recipients","scheduledAt","pausedReason","stats"],"description":"One variant: a whole campaign of its own shop (content, subject, sender, feeds) with an audience chosen by hand."},"CampaignVariantGroup":{"type":"object","properties":{"groupId":{"type":["string","null"],"description":"null = a single campaign (no variants yet)."},"variants":{"type":"array","items":{"$ref":"#/components/schemas/CampaignVariant"},"description":"In their order."},"created":{"type":"string","description":"Id of the variant just created by addCampaignVariant."}},"required":["groupId","variants"]},"CancelInfo":{"type":"object","properties":{"blockers":{"type":"array","items":{"type":"string","enum":["trial","unpaid","profile","not_active","already"]}},"reasons":{"type":"array","items":{"$ref":"#/components/schemas/CancelReason"}}},"required":["blockers","reasons"]},"CancelReason":{"type":"string","enum":["not_needed","complex","missing_features","bugs","price","communication","other_tool","other"]},"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"}]},"ConnectConsent":{"type":"object","properties":{"client":{"type":"object","properties":{"name":{"type":"string"},"clientUri":{"type":["string","null"]},"redirectHost":{"type":"string"},"verified":{"type":"boolean"}},"required":["name","clientUri","redirectHost","verified"],"description":"verified: false for every app that registered itself (nobody checked who is behind it)."},"scope":{"type":["string","null"],"enum":["read","full",null],"description":"Scope the app asked for, null = it did not say."},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["account_admin","marketing_manager","content_manager","data_analyst","developer","finance"]}}},"required":["id","name","roles"]},"description":"Accounts (tenants) of the member."},"serverUrl":{"type":"string"}},"required":["client","scope","accounts","serverUrl"],"description":"The consent page of an AI app (/connect?request=...)."},"ConnectDecision":{"type":"object","properties":{"request":{"type":"string"},"approve":{"type":"boolean"},"tenantId":{"type":"string"},"scope":{"type":"string","enum":["read","full"]}},"required":["request","approve"]},"ConnectorScope":{"type":"string","enum":["read","full"]},"ConsentBasis":{"type":"string","enum":["none","soft_opt_in_customer","double_opt_in","imported"]},"ConsentSettings":{"type":"object","properties":{"shopId":{"type":"string"},"code":{"type":"string"},"language":{"$ref":"#/components/schemas/Lang"},"months":{"type":["number","null"]},"isDefault":{"type":"boolean"}},"required":["shopId","code","language","months","isDefault"],"description":"The customer exception (soft opt-in) of one e-shop (GET /tenants/{t}/consent-settings): how many months after a\ncontact's last completed order the shop may still mail it without another consent basis. months null = off.\nisDefault true = the shop's own law default (12 months for a Slovak shop, off otherwise, SK zákon č. 452/2021\nZ. z. § 116 odst. 16), not a choice the tenant made; false = the tenant's own number (including an explicit 0)."},"ContactActivity":{"type":"object","properties":{"body":{"type":"string","description":"Text of a custom activity, '' for the others."},"detail":{"allOf":[{"$ref":"#/components/schemas/ActivityDetail"}],"description":"References of the activity (missing from older servers)."},"id":{"type":"string"},"type":{"$ref":"#/components/schemas/ActivityType"},"at":{"type":"string"},"title":{"type":"string","description":"Campaign, form or order name; tenant data, shown as is."}},"required":["body","id","type","at","title"]},"ContactAutomationRun":{"type":"object","properties":{"automation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/AutomationStatus"}},"required":["id","name","status"]},"nodes":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"}},"required":["type","name"]},"description":"The nodes of the automation by key: type and name (the name may be empty)."},"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":["automation","nodes","id","contact","status","node","entryKey","enteredAt","dueAt","finishedAt","exitReason","steps"],"description":"A run of one contact with its automation (contact card, tab Automatizace)."},"ContactConsent":{"type":"object","properties":{"id":{"type":"string"},"purposeId":{"type":"string"},"name":{"type":"string"},"legalBasis":{"type":"string","enum":["consent","contract","legal_obligation","legitimate_interest","vital_interest","public_interest"]},"validFrom":{"type":"string"},"validUntil":{"type":["string","null"]},"withdrawnAt":{"type":["string","null"]},"source":{"type":"string"},"state":{"type":"string","enum":["expired","valid","future","withdrawn"]}},"required":["id","purposeId","name","legalBasis","validFrom","validUntil","withdrawnAt","source","state"]},"ContactCoupon":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"$ref":"#/components/schemas/CouponStatus"},"assignedAt":{"type":["string","null"]},"usedAt":{"type":["string","null"]},"stackId":{"type":"string"},"stackName":{"type":"string"},"shopId":{"type":"string"}},"required":["id","code","status","assignedAt","usedAt","stackId","stackName","shopId"]},"ContactCreateInput":{"type":"object","properties":{"email":{"type":"string"},"shopId":{"type":"string"},"purposeId":{"type":"string"},"consentConfirmed":{"type":"boolean"},"listIds":{"type":"array","items":{"type":"string"}},"validFrom":{"type":"string","description":"SE's \"Od kdy účel platí\" (KK-17): a day (YYYY-MM-DD) or an ISO date-time; default now."},"firstName":{"type":"string"},"lastName":{"type":"string"},"titleBefore":{"type":"string"},"titleAfter":{"type":"string"},"salutation":{"type":"string"},"salutationFormal":{"type":"string"},"vocativeFirstName":{"type":"string"},"vocativeLastName":{"type":"string"},"gender":{"type":["string","null"],"enum":["f","m",null]},"language":{"type":"string"},"company":{"type":"string"},"companyId":{"type":"string"},"phone":{"type":"string"},"mobile":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":["string","null"]},"birthday":{"type":["string","null"]},"nameDay":{"type":["string","null"]},"note":{"type":"string"},"affiliateId":{"type":"string"},"customFields":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},"required":["email","shopId","purposeId","consentConfirmed"],"description":"A contact added by hand: like a one-row import (purpose and confirmation required)."},"ContactDetail":{"type":"object","properties":{"guid":{"type":["string","null"],"description":"SE's contact GUID (32 hex characters): the grid search finds it as #GUID (KG-07)."},"sources":{"type":"array","items":{"$ref":"#/components/schemas/ContactSourceRecord"},"description":"Source records (CSV import, Shoptet, SmartEmailing ...); the contact's own state is the most restrictive one."},"editedFields":{"type":"array","items":{"type":"string"},"description":"Fields a person edited in Poštárna: imports and syncs never overwrite them."},"phone":{"type":"string"},"mobile":{"type":"string"},"titleBefore":{"type":"string"},"titleAfter":{"type":"string"},"salutation":{"type":"string"},"salutationFormal":{"type":"string"},"vocativeFirstName":{"type":"string"},"vocativeLastName":{"type":"string"},"gender":{"type":["string","null"],"enum":["f","m",null]},"language":{"type":"string"},"company":{"type":"string"},"companyId":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":["string","null"]},"birthday":{"type":["string","null"]},"nameDay":{"type":["string","null"],"description":"MM-DD"},"note":{"type":"string"},"affiliateId":{"type":"string"},"source":{"$ref":"#/components/schemas/ContactSource"},"consentBasis":{"$ref":"#/components/schemas/ConsentBasis"},"consentWeak":{"type":"boolean"},"statusAt":{"type":"string","description":"When the current status (ContactListItem.status) started; always set."},"consentAt":{"type":["string","null"],"description":"When the current consent was given; null without one (e.g. weak consent)."},"softBounces":{"type":"number"},"lastSentAt":{"type":["string","null"]},"lastOpenAt":{"type":["string","null"]},"lastClickAt":{"type":["string","null"]},"suppressedAt":{"type":["string","null"]},"suppressionNote":{"type":["string","null"],"description":"Note given when the address was put on the blacklist by hand (suppressionReason 'manual'), else null."},"stats90d":{"$ref":"#/components/schemas/ContactStats"},"lists":{"type":"array","items":{"$ref":"#/components/schemas/ContactListMembership"}},"recentActivities":{"type":"array","items":{"$ref":"#/components/schemas/Activity"},"description":"Newest first, at most 20."},"orders":{"type":"array","items":{"$ref":"#/components/schemas/ContactOrder"},"description":"Newest first, at most 20."},"orderTotals":{"type":"array","items":{"$ref":"#/components/schemas/OrderTotal"}},"engagementAt":{"type":["string","null"],"description":"When the engagement grade last changed (weekly recomputation)."},"customFields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Values of custom fields by field id."},"updatedAt":{"type":"string"},"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"status":{"type":"string","enum":["pending","subscribed","unsubscribed","bounced","complained","customer"]},"engagement":{"type":"string","enum":["A","B","C","D","E","N"]},"excluded":{"type":"boolean","description":"SE \"Vyloučené\": long inactive yet mailed often (recomputed weekly with the engagement)."},"shopId":{"type":["string","null"],"description":"Main e-shop (contacts.shop_id), null when unknown."},"suppressionReason":{"type":["string","null"],"enum":["invalid","manual","unsubscribed","hard_bounce","complaint","soft_bounce_limit",null],"description":"Set when the address is on the tenant suppression list."},"blacklisted":{"type":"boolean","description":"On the tenant's blacklist (\"Na blacklistu\"): a manual entry, or an entry of SmartEmailing's blacklist that keeps\nits own reason (migration 0180). Older servers leave it out: then suppressionReason 'manual' decides."},"blacklistedAt":{"type":["string","null"],"description":"When the address went on the blacklist (the suppression's time), null when it is not on it (\"Přidán na blacklist\")."},"state":{"type":"string","enum":["active","bounced","blacklisted"],"description":"SmartEmailing's 3-value contact state; older servers leave it out (contactState derives it)."},"createdAt":{"type":"string"},"extra":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"null"}]},"description":"Values of the extra columns asked for (ContactQuery.fields): dates as YYYY-MM-DD, times as ISO."}},"required":["phone","mobile","titleBefore","titleAfter","salutation","salutationFormal","vocativeFirstName","vocativeLastName","gender","language","company","companyId","street","city","postalCode","country","birthday","nameDay","note","affiliateId","source","consentBasis","consentWeak","statusAt","consentAt","softBounces","lastSentAt","lastOpenAt","lastClickAt","suppressedAt","suppressionNote","stats90d","lists","recentActivities","orders","orderTotals","engagementAt","customFields","updatedAt","id","email","firstName","lastName","status","engagement","excluded","shopId","suppressionReason","createdAt"]},"ContactListDetail":{"type":"object","properties":{"notifyOnUnsubscribe":{"type":"boolean"},"notifyOnAdd":{"type":"boolean"},"note":{"type":"string","description":"Private note for the team."},"signatureHtml":{"type":"string","description":"SE's Podpis v e-mailu pro tento seznam kontaktů (HTML), sanitized: {{cl_signature}} of e-mails to the list."},"senderEmail":{"type":"string","description":"SE's e-mail odesílatele of the list (lower case, '' = none): the signature goes into every e-mail sent from this\naddress, and the list's e-mail notices go to the account's user with this address."},"id":{"type":"string"},"name":{"type":"string"},"publicName":{"type":"string","description":"Name shown on the unsubscribe page; empty = the name is used."},"shopId":{"type":["string","null"],"description":"null = list of the whole tenant, not bound to one e-shop."},"systemKind":{"type":["string","null"],"enum":["form","shop_contacts","shop_newsletter","shop_unsubscribed",null]},"locked":{"type":"boolean","description":"System lists cannot be deleted."},"manualMembers":{"type":"boolean","description":"False for lists filled by an e-shop connection: members are not added or removed by hand (409)."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (štítky), at most 20."},"counts":{"$ref":"#/components/schemas/ListCounts"},"createdAt":{"type":"string"}},"required":["notifyOnUnsubscribe","notifyOnAdd","note","signatureHtml","senderEmail","id","name","publicName","shopId","systemKind","locked","manualMembers","tags","counts","createdAt"]},"ContactListItem":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"status":{"type":"string","enum":["pending","subscribed","unsubscribed","bounced","complained","customer"]},"engagement":{"type":"string","enum":["A","B","C","D","E","N"]},"excluded":{"type":"boolean","description":"SE \"Vyloučené\": long inactive yet mailed often (recomputed weekly with the engagement)."},"shopId":{"type":["string","null"],"description":"Main e-shop (contacts.shop_id), null when unknown."},"suppressionReason":{"type":["string","null"],"enum":["invalid","manual","unsubscribed","hard_bounce","complaint","soft_bounce_limit",null],"description":"Set when the address is on the tenant suppression list."},"blacklisted":{"type":"boolean","description":"On the tenant's blacklist (\"Na blacklistu\"): a manual entry, or an entry of SmartEmailing's blacklist that keeps\nits own reason (migration 0180). Older servers leave it out: then suppressionReason 'manual' decides."},"blacklistedAt":{"type":["string","null"],"description":"When the address went on the blacklist (the suppression's time), null when it is not on it (\"Přidán na blacklist\")."},"state":{"type":"string","enum":["active","bounced","blacklisted"],"description":"SmartEmailing's 3-value contact state; older servers leave it out (contactState derives it)."},"createdAt":{"type":"string"},"extra":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"null"}]},"description":"Values of the extra columns asked for (ContactQuery.fields): dates as YYYY-MM-DD, times as ISO."}},"required":["id","email","firstName","lastName","status","engagement","excluded","shopId","suppressionReason","createdAt"]},"ContactListMembership":{"type":"object","properties":{"listId":{"type":"string"},"name":{"type":"string"},"state":{"$ref":"#/components/schemas/ListMembershipState"},"changedAt":{"type":"string"},"listSize":{"type":"number"}},"required":["listId","name","state","changedAt","listSize"]},"ContactListSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"publicName":{"type":"string","description":"Name shown on the unsubscribe page; empty = the name is used."},"shopId":{"type":["string","null"],"description":"null = list of the whole tenant, not bound to one e-shop."},"systemKind":{"type":["string","null"],"enum":["form","shop_contacts","shop_newsletter","shop_unsubscribed",null]},"locked":{"type":"boolean","description":"System lists cannot be deleted."},"manualMembers":{"type":"boolean","description":"False for lists filled by an e-shop connection: members are not added or removed by hand (409)."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (štítky), at most 20."},"counts":{"$ref":"#/components/schemas/ListCounts"},"createdAt":{"type":"string"}},"required":["id","name","publicName","shopId","systemKind","locked","manualMembers","tags","counts","createdAt"]},"ContactNeighbors":{"type":"object","properties":{"prevId":{"type":["string","null"]},"nextId":{"type":["string","null"]}},"required":["prevId","nextId"]},"ContactOrder":{"type":"object","properties":{"id":{"type":"string"},"shopId":{"type":"string"},"code":{"type":"string"},"status":{"$ref":"#/components/schemas/OrderStatus"},"sourceStatus":{"type":"string","description":"State name in the e-shop"},"currency":{"$ref":"#/components/schemas/Currency"},"totalWithVat":{"type":["string","null"],"description":"Decimal string with VAT in the order currency, as sent by the e-shop."},"orderedAt":{"type":"string"},"paidAt":{"type":["string","null"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemPreview"},"description":"First items only; itemCount is the full number of lines."},"itemCount":{"type":"number"}},"required":["id","shopId","code","status","sourceStatus","currency","totalWithVat","orderedAt","paidAt","items","itemCount"]},"ContactPatch":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"titleBefore":{"type":"string"},"titleAfter":{"type":"string"},"salutation":{"type":"string"},"salutationFormal":{"type":"string"},"vocativeFirstName":{"type":"string"},"vocativeLastName":{"type":"string"},"gender":{"type":["string","null"],"enum":["f","m",null]},"language":{"type":"string"},"company":{"type":"string"},"companyId":{"type":"string"},"phone":{"type":"string"},"mobile":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":["string","null"]},"birthday":{"type":["string","null"]},"nameDay":{"type":["string","null"]},"note":{"type":"string"},"affiliateId":{"type":"string"},"customFields":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},"description":"Profile changes; the address, state and consent never change here. A null custom field value removes it."},"ContactSegment":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"refresh":{"type":"string","enum":["static","daily"]},"computedAt":{"type":["string","null"]},"updatedAt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"description":"The segment's labels (SE's column Štítky)."},"active":{"type":"number","description":"Contacts of the segment that can be e-mailed (SE's Aktivní kontakty)."}},"required":["id","name","shopId","refresh","computedAt","updatedAt","tags","active"]},"ContactSource":{"type":"string","enum":["manual","shoptet","smartemailing","api","erp_order","signup_form","import"]},"ContactSourceRecord":{"type":"object","properties":{"source":{"type":"string","enum":["manual","shoptet","csv","smartemailing","api","form","erp"]},"consent":{"type":"string","enum":["unsubscribed","hard_bounce","blacklisted","opt_in","none"]},"consentAt":{"type":["string","null"]},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"}},"required":["source","consent","consentAt","firstSeenAt","lastSeenAt"],"description":"One source record of a contact (provenance): what that source says about consent."},"ContactStats":{"type":"object","properties":{"received":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bestHour":{"type":["number","null"],"description":"Hour of day (0 to 23, tenant time zone) with the most opens, null without data."},"preferredDeliveryTime":{"type":["string","null"],"description":"SE's preferredDeliveryTime 'HH:MM' (KK-20): the same ideal time the automations' Individuální čas and the\ncampaigns' Ideální čas odeslání use; null without an open."}},"required":["received","opened","clicked","bestHour"]},"ContactSummary":{"type":"object","properties":{"total":{"type":"number"},"byStatus":{"type":"object","properties":{"pending":{"type":"number"},"subscribed":{"type":"number"},"unsubscribed":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"customer":{"type":"number"}},"required":["pending","subscribed","unsubscribed","bounced","complained","customer"]},"blacklisted":{"type":"number"}},"required":["total","byStatus","blacklisted"]},"ContactsBulkRequest":{"type":"object","properties":{"action":{"type":"string","enum":["blacklist","add_to_list","delete"]},"contactIds":{"type":"array","items":{"type":"string"},"description":"The ticked contacts; or all: every contact matching the grid query (no cap)."},"all":{"type":"boolean"},"listIds":{"type":"array","items":{"type":"string"},"description":"add_to_list: the manual lists."}},"required":["action"]},"ContactsBulkStarted":{"type":"object","properties":{"jobId":{"type":"string"},"count":{"type":"number","description":"Contacts the action will go over (blacklisted ones left out)."}},"required":["jobId","count"]},"ContentVersion":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"},"kind":{"type":"string","enum":["manual","auto","restore"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"],"description":"Name or e-mail of the user; null for the API or unknown."}},"required":["id","version","kind","createdAt","createdBy"],"description":"One entry of the content history (Historie uložení)."},"ContentVersionDetail":{"type":"object","properties":{"content":{"type":"object","properties":{"editor":{"type":"string","enum":["visual","html"]},"html":{"type":"string"},"design":{"anyOf":[{"$ref":"#/components/schemas/EmailDesign"},{"type":"null"}]}},"required":["editor","html","design"]},"id":{"type":"string"},"version":{"type":"number"},"kind":{"type":"string","enum":["manual","auto","restore"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"],"description":"Name or e-mail of the user; null for the API or unknown."}},"required":["content","id","version","kind","createdAt","createdBy"]},"ContentVersionList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContentVersion"}},"more":{"type":"boolean"}},"required":["items","more"]},"ConversionCurrency":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"direct":{"$ref":"#/components/schemas/ConversionPart"},"assisted":{"$ref":"#/components/schemas/ConversionPart"}},"required":["currency","direct","assisted"],"description":"One currency: CZK and EUR are never added up or converted."},"ConversionOrder":{"type":"object","properties":{"orderId":{"type":"string"},"code":{"type":"string"},"contactId":{"type":["string","null"]},"email":{"type":["string","null"]},"kind":{"type":"string","enum":["direct","assisted"]},"clickedAt":{"type":"string"},"orderedAt":{"type":"string"},"currency":{"$ref":"#/components/schemas/Currency"},"totalWithVat":{"type":["string","null"]},"totalWithoutVat":{"type":["string","null"]}},"required":["orderId","code","contactId","email","kind","clickedAt","orderedAt","currency","totalWithVat","totalWithoutVat"]},"ConversionPart":{"type":"object","properties":{"orders":{"type":"number"},"revenue":{"type":["string","null"]},"revenueWithoutVat":{"type":["string","null"]}},"required":["orders","revenue","revenueWithoutVat"]},"ConvertedTemplate":{"type":"object","properties":{"conversion":{"type":"object","properties":{"quality":{"type":"string","enum":["partial","clean","raw"]},"stats":{"type":"object","additionalProperties":{"type":"number"}}},"required":["quality","stats"]},"content":{"allOf":[{"$ref":"#/components/schemas/EmailContent"}],"description":"What the editor opens: the draft of a template in use, else the published content."},"settings":{"$ref":"#/components/schemas/TemplateSettings"},"draft":{"type":"object","properties":{"pending":{"type":"boolean"},"savedAt":{"type":["string","null"]},"publishedAt":{"type":["string","null"]}},"required":["pending","savedAt","publishedAt"],"description":"A template that active automations send keeps its published content; the editor saves a draft until it is\npublished with the password (POST /templates/{id}/publish) or thrown away (DELETE /templates/{id}/draft)."},"activeUses":{"$ref":"#/components/schemas/TemplateActiveUses"},"publicUrl":{"type":"string","description":"Veřejný náhled: a public page with the content (merge tags unfilled)."},"id":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"editor":{"type":"string","enum":["visual","html"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"size":{"type":"number","description":"Size of the HTML in bytes (Gmail clips messages over 102 kB)."},"archived":{"type":"boolean","description":"Archived templates are not offered for new campaigns; they can be duplicated or restored."},"archivedAt":{"type":["string","null"]},"readOnly":{"type":"boolean","description":"Archive copy of an imported SmartEmailing original: content, name and tags never change, no delete or restore."},"usage":{"type":"object","properties":{"campaigns":{"type":"number"},"automations":{"type":"number"}},"required":["campaigns","automations"],"description":"Campaigns made from the template and e-mail nodes of automations naming it."},"lastUsedAt":{"type":["string","null"],"description":"Newest such campaign or automation e-mail."},"check":{"$ref":"#/components/schemas/TemplateCheck"}},"required":["conversion","content","settings","draft","activeUses","publicUrl","id","name","subject","preheader","editor","createdAt","updatedAt","tags","size","archived","archivedAt","readOnly","usage","lastUsedAt","check"],"description":"Result of POST /templates/{id}/convert-to-visual: the new template and how much of it became blocks."},"CouponCounts":{"type":"object","properties":{"total":{"type":"number"},"free":{"type":"number"},"assigned":{"type":"number"},"used":{"type":"number"}},"required":["total","free","assigned","used"]},"CouponImportResult":{"type":"object","properties":{"counts":{"type":"object","properties":{"added":{"type":"number"},"duplicate":{"type":"number"},"invalid":{"type":"number"},"total":{"type":"number"}},"required":["added","duplicate","invalid","total"]},"stack":{"$ref":"#/components/schemas/CouponStack"}},"required":["counts","stack"]},"CouponStack":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"mergeKey":{"type":"string"},"tag":{"type":"string"},"note":{"type":"string"},"counts":{"$ref":"#/components/schemas/CouponCounts"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","shopId","mergeKey","tag","note","counts","createdAt","updatedAt"],"description":"A stack of discount codes of one e-shop (se-spec 06 §4.6); tag is the e-mail merge tag {{coupon_<mergeKey>}}."},"CouponStackInput":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":"string"},"mergeKey":{"type":"string"},"note":{"type":"string"}},"required":["name","shopId","mergeKey"]},"CouponStatus":{"type":"string","enum":["free","assigned","used"]},"CouponUsedResult":{"type":"object","properties":{"marked":{"type":"number"},"already":{"type":"number"},"unknown":{"type":"number"},"stack":{"$ref":"#/components/schemas/CouponStack"}},"required":["marked","already","unknown","stack"]},"Currency":{"type":"string","enum":["CZK","EUR"]},"CustomActivityInput":{"type":"object","properties":{"kind":{"type":"string","enum":["other","note","call","deal"]},"title":{"type":"string"},"body":{"type":"string"},"at":{"type":"string","description":"ISO time; default now."}},"required":["kind","title"]},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["number","text","date","checkbox","textarea","select","multi_checkbox","radio"],"description":"Fixed once created."},"options":{"type":"array","items":{"type":"string"}},"used":{"type":"number","description":"Contacts with a value."},"createdAt":{"type":"string"}},"required":["id","name","type","options","used","createdAt"]},"CustomFieldInput":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["number","text","date","checkbox","textarea","select","multi_checkbox","radio"]},"options":{"type":"array","items":{"type":"string"}}},"required":["name","type"]},"CustomFieldRule":{"type":"object","properties":{"type":{"type":"string","const":"custom_field"},"fieldId":{"type":"string"},"kind":{"type":"string","enum":["number","text","date","bool","choice","multi_choice"]},"operator":{"type":"string"},"value":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["type","fieldId","kind","operator"]},"CustomFieldValue":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]},"DashboardData":{"type":"object","properties":{"days":{"type":"number"},"contacts":{"type":["object","null"],"properties":{"total":{"type":"number"},"subscribed":{"type":"number"},"added":{"type":"number"},"lost":{"type":"number"},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"added":{"type":"number"},"lost":{"type":"number"}},"required":["date","added","lost"]}}},"required":["total","subscribed","added","lost","trend"],"description":"null when the member's roles cannot read contacts."},"lastContact":{"type":["object","null"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"source":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","email","source","createdAt"]},"emails":{"type":["object","null"],"properties":{"current":{"$ref":"#/components/schemas/EmailMetrics"},"previous":{"$ref":"#/components/schemas/EmailMetrics"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"sent":{"type":"number"},"unsubscribed":{"type":"number"}},"required":["date","sent","unsubscribed"]}}},"required":["current","previous","daily"],"description":"null when the member's roles cannot read campaigns."},"lastEmail":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["campaign","automation"]},"campaignId":{"type":["string","null"]},"automationId":{"type":["string","null"]},"nodeKey":{"type":["string","null"]},"name":{"type":"string"},"nodeName":{"type":"string"},"sentAt":{"type":"string"}},"required":["kind","campaignId","automationId","nodeKey","name","nodeName","sentAt"]}},"required":["days","contacts","lastContact","emails","lastEmail"]},"DmarcReport":{"type":"object","properties":{"totals":{"type":"object","properties":{"messages":{"type":"number"},"dmarcPass":{"type":"number"},"dkimPass":{"type":"number"},"spfPass":{"type":"number"},"reports":{"type":"number"}},"required":["messages","dmarcPass","dkimPass","spfPass","reports"]},"domains":{"type":"array","items":{"type":"object","properties":{"messages":{"type":"number"},"dmarcPass":{"type":"number"},"dkimPass":{"type":"number"},"spfPass":{"type":"number"},"domain":{"type":"string"}},"required":["messages","dmarcPass","dkimPass","spfPass","domain"]}},"days":{"type":"array","items":{"type":"object","properties":{"messages":{"type":"number"},"dmarcPass":{"type":"number"},"dkimPass":{"type":"number"},"spfPass":{"type":"number"},"date":{"type":"string"},"reports":{"type":"number"}},"required":["messages","dmarcPass","dkimPass","spfPass","date","reports"]}},"ips":{"type":"array","items":{"type":"object","properties":{"messages":{"type":"number"},"dmarcPass":{"type":"number"},"dkimPass":{"type":"number"},"spfPass":{"type":"number"},"ip":{"type":"string"},"version":{"type":"string","enum":["ipv4","ipv6"]}},"required":["messages","dmarcPass","dkimPass","spfPass","ip","version"]}},"ipVersions":{"type":"object","properties":{"ipv4":{"type":"number"},"ipv6":{"type":"number"}},"required":["ipv4","ipv6"]},"reporters":{"type":"array","items":{"type":"object","properties":{"messages":{"type":"number"},"dmarcPass":{"type":"number"},"dkimPass":{"type":"number"},"spfPass":{"type":"number"},"org":{"type":"string"}},"required":["messages","dmarcPass","dkimPass","spfPass","org"]}},"dispositions":{"type":"array","items":{"type":"object","properties":{"disposition":{"type":"string"},"messages":{"type":"number"}},"required":["disposition","messages"]}},"cases":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"org":{"type":"string"},"at":{"type":"string"},"ip":{"type":"string"},"dkim":{"type":"boolean"},"spf":{"type":"boolean"},"dmarc":{"type":"boolean"},"disposition":{"type":"string"},"messages":{"type":"number"}},"required":["domain","org","at","ip","dkim","spf","dmarc","disposition","messages"]}},"reporterChoices":{"type":"array","items":{"type":"string"}},"domainChoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"]}}},"required":["totals","domains","days","ips","ipVersions","reporters","dispositions","cases","reporterChoices","domainChoices"]},"DmarcSummary":{"type":"object","properties":{"days":{"type":"number"},"domains":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"reports":{"type":"number"},"messages":{"type":"number"},"dmarcPass":{"type":"number"},"dkimPass":{"type":"number"},"spfPass":{"type":"number"},"passRate":{"type":"number"},"lastReport":{"type":["string","null"]}},"required":["id","domain","reports","messages","dmarcPass","dkimPass","spfPass","passRate","lastReport"]}},"sources":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"sourceIp":{"type":"string"},"messages":{"type":"number"},"failed":{"type":"number"}},"required":["domain","sourceIp","messages","failed"]}},"reports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"orgName":{"type":"string"},"reportId":{"type":"string"},"beginAt":{"type":"string"},"endAt":{"type":"string"},"messages":{"type":"number"},"dmarcPass":{"type":"number"},"receivedAt":{"type":"string"}},"required":["id","domain","orgName","reportId","beginAt","endAt","messages","dmarcPass","receivedAt"]}},"complaints":{"type":"object","properties":{"total":{"type":"number"},"bySource":{"type":"object","additionalProperties":{"type":"number"}},"recent":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"source":{"type":"string"},"kind":{"type":["string","null"],"enum":["campaign","automation",null]},"campaignId":{"type":["string","null"]},"automationId":{"type":["string","null"]},"name":{"type":"string"}},"required":["at","source","kind","campaignId","automationId","name"]}}},"required":["total","bySource","recent"]}},"required":["days","domains","sources","reports","complaints"]},"DoiTemplate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"An e-mail template with {{confirmlink}} a form may send as its double opt-in."},"DuplicateGroup":{"type":"object","properties":{"kind":{"type":"string","enum":["phone","name_company"]},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"status":{"type":"string","enum":["pending","subscribed","unsubscribed","bounced","complained","customer"]},"createdAt":{"type":"string"}},"required":["id","email","firstName","lastName","company","phone","status","createdAt"]}}},"required":["kind","contacts"],"description":"Possible duplicates: contacts with the same phone or the same name and company (a report, nothing is merged)."},"DuplicateReport":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/DuplicateGroup"}},"truncated":{"type":"boolean","description":"More groups exist than the report shows (200)."}},"required":["groups","truncated"]},"EditorElement":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"kind":{"$ref":"#/components/schemas/EditorElementKind"},"mjml":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","category","kind","mjml","createdAt","updatedAt"]},"EditorElementInput":{"type":"object","properties":{"name":{"type":"string"},"category":{"type":"string"},"kind":{"$ref":"#/components/schemas/EditorElementKind"},"mjml":{"type":"string"}},"required":["name","kind","mjml"]},"EditorElementKind":{"type":"string","enum":["text","image","button","row","feed","logo","video","divider","spacer","section"]},"EmailContent":{"type":"object","properties":{"editor":{"type":"string","enum":["visual","html"]},"html":{"type":"string","description":"HTML with merge tags left in place (compiled from the design, or written by hand); the core personalises and sends it."},"design":{"anyOf":[{"$ref":"#/components/schemas/EmailDesign"},{"type":"null"}],"description":"Visual editor only."},"version":{"type":"number","description":"0 = no content yet; every save adds one."},"updatedAt":{"type":["string","null"]}},"required":["editor","html","design","version","updatedAt"],"description":"E-mail content of a template or a campaign."},"EmailContentInput":{"type":"object","properties":{"editor":{"type":"string","enum":["visual","html"]},"html":{"type":"string"},"design":{"anyOf":[{"$ref":"#/components/schemas/EmailDesign"},{"type":"null"}]},"baseVersion":{"type":"number","description":"The version the editor started from; a newer one on the server answers 409 version (saved elsewhere meanwhile)."},"saveKind":{"type":"string","enum":["manual","auto","restore"],"description":"History entry kind: auto (autosave, journaled), manual (Uložit), restore (a version taken back). Default auto."}},"required":["editor","html","design","baseVersion"]},"EmailConversions":{"type":"object","properties":{"available":{"type":"boolean","description":"false = no conversion provider yet (the tab says so instead of showing zeros)."},"directHours":{"type":"number"},"assistedDays":{"type":"number"},"currencies":{"type":"array","items":{"$ref":"#/components/schemas/ConversionCurrency"}},"orders":{"type":"array","items":{"$ref":"#/components/schemas/ConversionOrder"}}},"required":["available","directHours","assistedDays","currencies","orders"]},"EmailDesign":{"type":"object","properties":{"format":{"type":"string","const":"mjml-1","description":"Format version; a later editor migrates older designs."},"mjml":{"type":"string"},"styles":{"$ref":"#/components/schemas/EmailStyles"}},"required":["format","mjml","styles"],"description":"Source of a visual design: MJML plus the global styles, so the editor reopens it exactly."},"EmailHeatmap":{"type":"object","properties":{"html":{"type":"string"},"links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"clicks":{"type":"number"},"uniqueClicks":{"type":"number"}},"required":["url","clicks","uniqueClicks"]}}},"required":["html","links"],"description":"SE \"Heatmapa prokliků\": the e-mail's HTML and the clicks of every link."},"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."},"EmailStatsDetail":{"type":"object","properties":{"kind":{"type":"string","enum":["campaign","automation"]},"campaignId":{"type":["string","null"]},"automationId":{"type":["string","null"]},"nodeKey":{"type":["string","null"]},"name":{"type":"string"},"subject":{"type":"string"},"shopId":{"type":"string"},"status":{"type":"string"},"sentAt":{"type":["string","null"]},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"]}},"totals":{"$ref":"#/components/schemas/EmailMetrics"},"providers":{"type":"array","items":{"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"},"provider":{"type":"string"}},"required":["sent","delivered","undelivered","bounced","softBounced","opens","uniqueOpens","repeatedOpens","machineOpens","clicks","uniqueClicks","unsubscribed","complained","queued","failed","skipped","openRate","ctr","ctor","unsubscribeRate","bounceRate","complaintRate","deliveryRate","provider"]}},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/StatsDay"}},"links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"clicks":{"type":"number"},"uniqueClicks":{"type":"number"}},"required":["url","clicks","uniqueClicks"]}}},"required":["kind","campaignId","automationId","nodeKey","name","subject","shopId","status","sentAt","nodes","totals","providers","timeline","links"]},"EmailStatsItem":{"type":"object","properties":{"id":{"type":"string","description":"c<campaign id> or a<automation id>:<node key>"},"kind":{"type":"string","enum":["campaign","automation"]},"campaignId":{"type":["string","null"]},"automationId":{"type":["string","null"]},"nodeKey":{"type":["string","null"]},"name":{"type":"string"},"nodeName":{"type":"string"},"subject":{"type":"string"},"shopId":{"type":"string"},"status":{"type":"string"},"sentAt":{"type":["string","null"]},"stats":{"$ref":"#/components/schemas/EmailMetrics"}},"required":["id","kind","campaignId","automationId","nodeKey","name","nodeName","subject","shopId","status","sentAt","stats"]},"EmailStatsPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EmailStatsItem"}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"},"totals":{"$ref":"#/components/schemas/EmailMetrics"}},"required":["items","total","page","pageSize"],"description":"A page of the statistics grid; totals = every e-mail of the asked automations together (query.automationIds)."},"EmailStatsReport":{"type":"object","properties":{"kind":{"type":"string","enum":["campaign","automation"]},"campaignId":{"type":["string","null"]},"automationId":{"type":["string","null"]},"nodeKey":{"type":["string","null"]},"name":{"type":"string"},"status":{"type":"string"},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"shopId":{"type":"string"},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"]}},"filters":{"type":"object","properties":{"engagement":{"type":"array","items":{"type":"string"}},"humans":{"type":"boolean"},"vat":{"type":"boolean"}},"required":["engagement","humans","vat"]},"firstSentAt":{"type":["string","null"]},"lastSentAt":{"type":["string","null"]},"totals":{"$ref":"#/components/schemas/ReportMetrics"},"baseline":{"anyOf":[{"$ref":"#/components/schemas/ReportBaseline"},{"type":"null"}]},"days":{"type":"array","items":{"$ref":"#/components/schemas/ReportDay"}},"domains":{"type":"object","properties":{"sent":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"opened":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"clicked":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"unsubscribed":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"bounced":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"buyers":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}}},"required":["sent","opened","clicked","unsubscribed","bounced","buyers"]},"clients":{"type":"object","properties":{"opened":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"clicked":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}}},"required":["opened","clicked"]},"systems":{"type":"object","properties":{"opened":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"clicked":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}}},"required":["opened","clicked"]},"links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"clicks":{"type":"number"},"uniqueClicks":{"type":"number"},"share":{"type":"number"}},"required":["url","clicks","uniqueClicks","share"]}},"unsubscribeReasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string","enum":["other","custom","none","redirect","too_often","not_relevant","annoying","not_signed_up","spam_report","misc"]},"count":{"type":"number"}},"required":["reason","count"]}},"bounceReasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string","enum":["other","suppressed","mailbox_full","delayed","spam_filter","marked_spam","no_address","relay_error","transfer_error","confirmation_timeout","flooded_mailbox","spam_rate_limit","temporary","server_error","mx_error","greylisted"]},"count":{"type":"number"}},"required":["reason","count"]}},"bounceSplit":{"type":"object","properties":{"hard":{"type":"number"},"soft":{"type":"number"}},"required":["hard","soft"]},"revenue":{"type":"array","items":{"$ref":"#/components/schemas/ReportRevenue"}},"revenueDays":{"type":"array","items":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"orders":{"type":"number"},"directOrders":{"type":"number"},"assistedOrders":{"type":"number"},"total":{"type":"string"},"direct":{"type":"string"},"assisted":{"type":"string"}},"required":["date","orders","directOrders","assistedOrders","total","direct","assisted"]}}},"required":["currency","days"]}},"conversionLinks":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"},"description":"Orders per clicked link (SE \"Nejúspěšnější odkazy\")."},"products":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"'' = the rest (SE \"Ostatní\")."},"count":{"type":"number"},"image":{"type":"string"}},"required":["name","count","image"]},"description":"Items sold (quantity) with a picture."},"engagementSpend":{"type":"array","items":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"grades":{"type":"array","items":{"type":"object","properties":{"grade":{"type":"string"},"orders":{"type":"number"},"total":{"type":"string"}},"required":["grade","orders","total"]}}},"required":["currency","grades"]}},"topSpenders":{"type":"array","items":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"items":{"type":"array","items":{"type":"object","properties":{"contactId":{"type":["string","null"]},"email":{"type":"string"},"orders":{"type":"number"},"total":{"type":"string"}},"required":["contactId","email","orders","total"]}}},"required":["currency","items"]}}},"required":["kind","campaignId","automationId","nodeKey","name","status","startedAt","completedAt","shopId","nodes","filters","firstSentAt","lastSentAt","totals","baseline","days","domains","clients","systems","links","unsubscribeReasons","bounceReasons","bounceSplit","revenue","revenueDays","conversionLinks","products","engagementSpend","topSpenders"]},"EmailStyles":{"type":"object","properties":{"fontFamily":{"type":"string","description":"One of EMAIL_FONTS (web-safe stacks; recipients' clients have no web fonts by default)."},"headingFontFamily":{"type":"string"},"fontSize":{"type":"number","description":"Base text size in px (12 to 20)."},"textColor":{"type":"string"},"headingColor":{"type":"string"},"linkColor":{"type":"string"},"buttonColor":{"type":"string"},"buttonTextColor":{"type":"string"},"backgroundColor":{"type":"string","description":"Around the e-mail."},"contentColor":{"type":"string","description":"Body of the e-mail."},"width":{"type":"number","description":"Width of the e-mail in px (480 to 800)."},"magic":{"allOf":[{"$ref":"#/components/schemas/MagicStyles"}],"description":"Settings of the Magic editor (e-mail paddings, text styles, dark mode, element defaults); the server keeps the\nobject as it is (bounded JSON, API-CONTRACT.md). Absent in designs saved before it."}},"required":["fontFamily","headingFontFamily","fontSize","textColor","headingColor","linkColor","buttonColor","buttonTextColor","backgroundColor","contentColor","width"],"description":"Global look of a visual design. The editor writes it as MJML attributes; every element can override it."},"EngagementRule":{"type":"object","properties":{"type":{"type":"string","const":"engagement"},"operator":{"type":"string","enum":["in","not_in"]},"values":{"type":"array","items":{"type":"string","enum":["A","B","C","D","E","N"]}}},"required":["type","operator","values"]},"EraseResult":{"type":"object","properties":{"erased":{"type":"boolean"},"consentLogRows":{"type":"number","description":"Consent log rows whose address and evidence were blanked."}},"required":["erased","consentLogRows"]},"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}}}]},"ExportField":{"type":"object","properties":{"id":{"type":"string","description":"df_* system field or cf_<id> custom field."},"kind":{"type":"string","enum":["custom","contact"]},"name":{"type":"string","description":"Custom fields: their name (tenant data); system fields are named by the UI."},"type":{"type":"string"}},"required":["id","kind","name","type"]},"ExportInput":{"type":"object","properties":{"name":{"type":"string"},"selection":{"type":"string","enum":["bounced","blacklisted","all","lists"]},"listIds":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"purposeIds":{"type":"array","items":{"type":"string"}},"encoding":{"type":"string","enum":["utf-8","windows-1250"]}},"required":["name","selection","fields","encoding"]},"ExportStatus":{"type":"string","enum":["queued","running","finished","failed"]},"ExportSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/ExportStatus"},"selection":{"type":"string","enum":["bounced","blacklisted","all","lists"]},"listIds":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"purposeIds":{"type":"array","items":{"type":"string"}},"encoding":{"type":"string","enum":["utf-8","windows-1250"]},"rowCount":{"type":["number","null"]},"fileName":{"type":["string","null"]},"downloadable":{"type":"boolean","description":"The file exists and its link has not expired."},"downloads":{"type":"number"},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"listNames":{"type":"array","items":{"type":"string"},"description":"Names of the chosen lists in their order (SE's column Seznamy); older servers leave it out."}},"required":["id","name","status","selection","listIds","fields","purposeIds","encoding","rowCount","fileName","downloadable","downloads","createdAt","finishedAt","expiresAt"]},"Feed":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"kind":{"$ref":"#/components/schemas/FeedKind"},"format":{"$ref":"#/components/schemas/FeedFormat"},"currency":{"allOf":[{"$ref":"#/components/schemas/Currency"}],"description":"The shop's currency, read only."},"url":{"type":"string"},"autoRefresh":{"type":"boolean"},"pairing":{"type":"array","items":{"$ref":"#/components/schemas/FeedPairing"}},"itemCount":{"type":"number"},"version":{"type":"number"},"importedAt":{"type":["string","null"]},"refreshedAt":{"type":["string","null"],"description":"Last scheduled download (auto refresh) and its failure ('' = imported)."},"refreshError":{"type":"string"},"refreshReason":{"type":"string","description":"refreshError as a code for the UI (too_large, wrong_kind, not_google_products, not_customers,\nunsupported_format, invalid, doctype, http_404, network ...; '' = none) and what the document looked like."},"refreshDetected":{"type":"string"},"maxBytes":{"type":"number","description":"Largest document the feed accepts (20 MB products, 100 MB customers, 200 MB orders)."},"historyAt":{"type":["string","null"],"description":"Order feeds (migration 0097): when the first import (the order history, which starts no automation) finished;\nnull = not yet, the next import is the history. Other kinds: null."},"lastCounts":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"unchanged":{"type":"number"},"removed":{"type":"number"},"skipped":{"type":"number"},"total":{"type":"number"},"invalid":{"type":"number"},"wrongCurrency":{"type":"number"},"events":{"type":"number"},"history":{"type":"boolean"},"partial":{"type":"boolean","description":"An order feed's recent download (the last days only, between two whole downloads)."}},"description":"Counts of the last import ({} before the first one)."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","shopId","kind","format","currency","url","autoRefresh","pairing","itemCount","version","importedAt","refreshedAt","refreshError","refreshReason","refreshDetected","maxBytes","historyAt","lastCounts","createdAt","updatedAt"]},"FeedArticle":{"type":"object","properties":{"id":{"type":"string"},"feedId":{"type":"string"},"shopId":{"type":"string"},"itemId":{"type":"string","description":"guid / id of the article, else its link: what the editor stores to refresh it."},"title":{"type":"string"},"url":{"type":"string"},"perex":{"type":"string","description":"Plain text, at most 500 characters."},"imageUrl":{"type":"string"},"publishedAt":{"type":["string","null"]},"inFeed":{"type":"boolean"}},"required":["id","feedId","shopId","itemId","title","url","perex","imageUrl","publishedAt","inFeed"],"description":"An article of an article feed (GET /feed-articles, Články FEED of the Magic editor)."},"FeedArticleList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedArticle"}},"total":{"type":"number"},"feeds":{"type":"array","items":{"$ref":"#/components/schemas/FeedProductFeed"}}},"required":["items","total","feeds"]},"FeedFormat":{"type":"string","enum":["google","heureka","zbozi"]},"FeedFormatter":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/FeedFormatterType"},"text":{"type":"string","description":"append, prepend"},"separator":{"type":"string","description":"split_join: split by separator, the parts from offset (negative from the end) to offset + length (0 = all)"},"offset":{"type":"number"},"length":{"type":"number"},"format":{"type":"string","description":"date: PHP-style format (d j m n Y y H G i s D N w)"},"decimals":{"type":"number","description":"number (0 to 6)"},"decimalSeparator":{"type":"string"},"thousandsSeparator":{"type":"string"},"currency":{"type":"string","enum":["CZK","EUR","feed","USD"],"description":"currency: 'feed' = the feed's shop currency"},"search":{"type":"string","description":"replace"},"replace":{"type":"string"}},"required":["type"]},"FeedFormatterType":{"type":"string","enum":["number","currency","date","append","prepend","strip_tags","split_join","replace","lower","upper"]},"FeedImportResult":{"type":"object","properties":{"counts":{"type":"object","properties":{"skipped":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"unchanged":{"type":"number"},"total":{"type":"number"},"removed":{"type":"number"},"invalid":{"type":"number"},"wrongCurrency":{"type":"number"},"events":{"type":"number"},"history":{"type":"boolean"},"partial":{"type":"boolean","description":"An order feed's recent download (the last days only, between two whole downloads)."}},"required":["skipped","created","updated","unchanged","total"]},"feed":{"$ref":"#/components/schemas/Feed"}},"required":["counts","feed"]},"FeedInput":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":"string"},"kind":{"type":"string","enum":["google_products","shop_customers","shop_orders","articles"]},"format":{"type":"string","enum":["google","heureka","zbozi"],"description":"Only with kind google_products; fixed once the feed exists."},"url":{"type":"string"},"autoRefresh":{"type":"boolean"},"pairing":{"type":"array","items":{"$ref":"#/components/schemas/FeedPairing"}}},"required":["name","shopId"]},"FeedItem":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"type":"string"},"code":{"type":"string"},"data":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FeedValue"}},"values":{"type":"object","additionalProperties":{"type":"string"},"description":"Paired parameters after their formatters (product feeds)."},"updatedAt":{"type":"string"}},"required":["id","itemId","code","data","values","updatedAt"],"description":"An item of a product or article feed (GET .../feeds/{id}/items, Položky feedu)."},"FeedKind":{"type":"string","enum":["google_products","shop_customers","shop_orders","articles"]},"FeedList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Feed"}},"defaultPairing":{"type":"array","items":{"$ref":"#/components/schemas/FeedPairing"}}},"required":["items","defaultPairing"]},"FeedPairing":{"type":"object","properties":{"name":{"type":"string","description":"Own parameter name (se-id, se-product ...); se-id pairs order items by product code."},"field":{"type":"string","description":"Field of the feed item (g:id, title ...)."},"format":{"type":"array","items":{"$ref":"#/components/schemas/FeedFormatter"},"description":"Formatters applied in order to the value (core/feed_format.py); absent = none. Never change the product code."}},"required":["name","field"]},"FeedPreview":{"type":"object","properties":{"index":{"type":"number"},"total":{"type":"number"},"item":{"type":["object","null"],"additionalProperties":{"$ref":"#/components/schemas/FeedValue"}},"values":{"type":"object","additionalProperties":{"type":"string"},"description":"Paired values of the item by parameter name."},"fields":{"type":"array","items":{"type":"string"}}},"required":["index","total","item","values","fields"]},"FeedProduct":{"type":"object","properties":{"id":{"type":"string"},"feedId":{"type":"string"},"shopId":{"type":"string"},"itemId":{"type":"string","description":"g:id: the id the editor stores to refresh the product later (Párovat feed)."},"code":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"imageUrl":{"type":"string"},"price":{"type":["number","null"],"description":"With VAT, in the shop's currency (never converted); sale price when the feed has one."},"regularPrice":{"type":["number","null"],"description":"The price before the sale; null without a sale."},"currency":{"$ref":"#/components/schemas/Currency"},"priceText":{"type":"string"},"priceCurrencyMismatch":{"type":"boolean"},"availability":{"type":"string","enum":["","in_stock","out_of_stock","preorder","backorder"]},"brand":{"type":"string"},"shortDescription":{"type":"string","description":"The feed description as a short plain text (about 160 characters) for the product's text in an e-mail."},"values":{"type":"object","additionalProperties":{"type":"string"},"description":"The feed's paired parameters of the product after their formatters (Párování feedu: se-title, se-price, own\nnames); a part of a feed item may show one of them (ED-19)."},"inFeed":{"type":"boolean"},"updatedAt":{"type":"string"}},"required":["id","feedId","shopId","itemId","code","name","url","imageUrl","price","regularPrice","currency","priceText","availability","brand","inFeed","updatedAt"],"description":"A product of a shop's product feed for the editor's product picker (GET .../feed-products)."},"FeedProductFeed":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"currency":{"$ref":"#/components/schemas/Currency"},"itemCount":{"type":"number"},"refreshedAt":{"type":["string","null"]},"importedAt":{"type":["string","null"]},"refreshError":{"type":"string"}},"required":["id","name","shopId","currency","itemCount","refreshedAt","importedAt","refreshError"]},"FeedProductList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedProduct"}},"total":{"type":"number"},"feeds":{"type":"array","items":{"$ref":"#/components/schemas/FeedProductFeed"}}},"required":["items","total","feeds"]},"FeedRefreshResult":{"type":"object","properties":{"state":{"type":"string","enum":["queued","running"]},"feed":{"$ref":"#/components/schemas/Feed"}},"required":["state","feed"],"description":"POST .../feeds/{id}/refresh: a download queued now, or one already running."},"FeedValue":{"anyOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/FeedValue"}},{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FeedValue"}}]},"FieldOperator":{"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"]},"FieldRule":{"type":"object","properties":{"type":{"type":"string","const":"field"},"field":{"$ref":"#/components/schemas/SegmentField"},"operator":{"$ref":"#/components/schemas/FieldOperator"},"value":{"type":"string"}},"required":["type","field","operator","value"],"description":"Condition values are strings as typed (integer \"90\", amount \"1500.00\", date \"2026-09-30\") and are validated on\nthe server. Order conditions count only completed orders; shopId and currency narrow them, null = any."},"FileFolder":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"parentId":{"type":["string","null"],"description":"null = the root."},"files":{"type":"number","description":"Files directly in the folder."},"createdAt":{"type":"string"}},"required":["id","name","parentId","files","createdAt"]},"FileSource":{"type":"object","properties":{"name":{"type":"string"},"author":{"type":"string"},"authorUrl":{"type":"string"},"pageUrl":{"type":"string"}},"required":["name","author","authorUrl","pageUrl"]},"FooterDetail":{"type":"object","properties":{"content":{"$ref":"#/components/schemas/EmailContent"},"publishedHtml":{"type":"string","description":"The copy e-mails end with ('' before the first Publikovat); the Magic editor shows it (PA-01)."},"id":{"type":"string"},"name":{"type":"string"},"editor":{"type":"string","enum":["visual","html"],"description":"visual = Magic Editor list, html = Smart Editor list."},"isDefault":{"type":"boolean","description":"E-mails of this editor end with it (instead of the e-shop's standard footer); at most one per editor."},"published":{"type":"boolean","description":"E-mails use only the published copy (Publikovat)."},"publishedAt":{"type":["string","null"]},"unpublishedChanges":{"type":"boolean","description":"The draft differs from the published copy (or was never published)."},"gaps":{"type":"array","items":{"$ref":"#/components/schemas/FooterGap"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"contentUpdatedAt":{"type":["string","null"]},"publicUrl":{"type":"string","description":"Public preview of the draft (Zkopírovat veřejný odkaz)."}},"required":["content","publishedHtml","id","name","editor","isDefault","published","publishedAt","unpublishedChanges","gaps","createdAt","updatedAt","contentUpdatedAt","publicUrl"]},"FooterGap":{"type":"string","enum":["link","sender","loop","empty"]},"FooterInput":{"type":"object","properties":{"name":{"type":"string"},"editor":{"type":"string","enum":["visual","html"]},"html":{"type":"string"},"design":{"anyOf":[{"$ref":"#/components/schemas/EmailDesign"},{"type":"null"}]}},"required":["name","editor","html","design"]},"FooterSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"editor":{"type":"string","enum":["visual","html"],"description":"visual = Magic Editor list, html = Smart Editor list."},"isDefault":{"type":"boolean","description":"E-mails of this editor end with it (instead of the e-shop's standard footer); at most one per editor."},"published":{"type":"boolean","description":"E-mails use only the published copy (Publikovat)."},"publishedAt":{"type":["string","null"]},"unpublishedChanges":{"type":"boolean","description":"The draft differs from the published copy (or was never published)."},"gaps":{"type":"array","items":{"$ref":"#/components/schemas/FooterGap"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"contentUpdatedAt":{"type":["string","null"]},"publicUrl":{"type":"string","description":"Public preview of the draft (Zkopírovat veřejný odkaz)."}},"required":["id","name","editor","isDefault","published","publishedAt","unpublishedChanges","gaps","createdAt","updatedAt","contentUpdatedAt","publicUrl"]},"FormDesign":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/FormTemplate"},"style":{"type":"string","description":"<category>-<colour> of formStyles.json."},"width":{"type":"number"},"image":{"type":"string","description":"https address of the picture, '' = none."},"imagePosition":{"type":"string","enum":["top","aside"]},"showTitle":{"type":"boolean"},"showText":{"type":"boolean"},"titleColor":{"type":"string","description":"#rrggbb or '' (the style's colour)."},"textColor":{"type":"string"},"buttonColor":{"type":"string"},"buttonTextColor":{"type":"string"},"font":{"allOf":[{"$ref":"#/components/schemas/FormFont"}],"description":"Písmo (core/form_builder.FONTS): fonts every device has."},"titleSize":{"type":"number","description":"px, 14 to 48 / 12 to 28 (core/form_builder.SIZE_LIMITS)."},"textSize":{"type":"number"}},"required":["template","style","width","image","imagePosition","showTitle","showText","titleColor","textColor","buttonColor","buttonTextColor","font","titleSize","textSize"],"description":"Vzhled (step 2): core/form_builder.py DESIGN_DEFAULTS."},"FormDetail":{"type":"object","properties":{"popup":{"anyOf":[{"$ref":"#/components/schemas/PopupSettings"},{"type":"null"}],"description":"Pop-up and slide-in forms only."},"scriptUrl":{"type":["string","null"],"description":"<hostedUrl>/popup.js for a pop-up or slide-in, else null."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FormField"},"description":"The e-mail address is always there, first and required."},"consentText":{"type":"string","description":"The operator's text next to the required check box (consentMode checkbox)."},"consentVersion":{"type":"number","description":"Grows with every change of the consent text; each sign-up records the exact text and version."},"title":{"type":"string"},"description":{"type":"string"},"submitLabel":{"type":"string","description":"Empty = the default label in the shop's language."},"successUrl":{"type":"string","description":"https:// or empty (the thank-you page)."},"confirmedUrl":{"type":"string"},"captcha":{"type":"boolean","description":"Only with a verifier of the platform (none yet: 400 captcha)."},"hostedUrl":{"type":"string","description":"https://<link domain of the shop>/f/<tenant id>/<publicId>"},"design":{"$ref":"#/components/schemas/FormDesign"},"settings":{"$ref":"#/components/schemas/FormSettings"},"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"status":{"type":"string","enum":["active","inactive"],"description":"inactive = the form takes no sign-ups (its page answers 410)."},"listIds":{"type":"array","items":{"type":"string"}},"purposeId":{"type":["string","null"],"description":"null = Bez účelu zpracování."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"kind":{"allOf":[{"$ref":"#/components/schemas/FormKind"}],"description":"classic = in the page; popup = a dialog of popup.js; slide = Vyjíždějící (a button of popup.js opens it)."},"tags":{"type":"array","items":{"type":"string"}},"fills":{"type":"number","description":"Number of sign-ups (Historie vyplnění)."},"publicId":{"type":"string"},"previewUrl":{"type":"string","description":"hostedUrl?preview=1: Náhled webového formuláře (works for an inactive form too)."}},"required":["popup","scriptUrl","fields","consentText","consentVersion","title","description","submitLabel","successUrl","confirmedUrl","captcha","hostedUrl","design","settings","id","name","shopId","status","listIds","purposeId","createdAt","updatedAt","kind","tags","fills","publicId","previewUrl"]},"FormEmbed":{"type":"object","properties":{"html":{"type":"string","description":"Minimální HTML: inputs only, no style and no script."},"styled":{"type":"string","description":"HTML: the styled form (step 2) with its CSS; re-paste after a change."},"url":{"type":"string","description":"Odkaz na webový formulář."},"script":{"type":"string","description":"JavaScript: popup.js of a pop-up or slide-in, form.js of a classic form (always current)."}},"required":["html","styled","url","script"]},"FormExtraPurpose":{"type":"object","properties":{"purposeId":{"type":"string"},"label":{"type":"string"},"linkText":{"type":"string"},"linkUrl":{"type":"string"}},"required":["purposeId","label","linkText","linkUrl"]},"FormField":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/FormFieldName"},"required":{"type":"boolean"},"label":{"type":"string","description":"Empty = the default label (catalogue or custom field name)."},"error":{"type":"string","description":"Empty = the default message."},"placeholder":{"type":"string","description":"Předvyplněný text (placeholder)."}},"required":["field","required"]},"FormFieldName":{"type":"string"},"FormFill":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":["string","null"]},"email":{"type":"string"},"filledAt":{"type":"string"},"pageUrl":{"type":"string"},"affiliate":{"type":"string"}},"required":["id","contactId","email","filledAt","pageUrl","affiliate"],"description":"A sign-up of Historie vyplnění."},"FormFont":{"type":"string","enum":["arial","verdana","tahoma","trebuchet","georgia","times","courier"]},"FormInput":{"type":"object","properties":{"name":{"type":"string"},"shopId":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FormField"}},"listIds":{"type":"array","items":{"type":"string"}},"purposeId":{"type":["string","null"]},"consentText":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"submitLabel":{"type":"string"},"successUrl":{"type":"string"},"confirmedUrl":{"type":"string"},"captcha":{"type":"boolean"},"kind":{"type":"string","enum":["classic","popup","slide"]},"popup":{"type":["object","null"],"properties":{"trigger":{"type":"string","enum":["load","delay","scroll"]},"delaySeconds":{"type":"number","description":"delay: 1 to 600 seconds after the page is ready."},"scrollUnit":{"type":"string","enum":["percent","pixels"],"description":"scroll in % of the page (10 to 100) or in pixels from the top (1 to 20000, SmartEmailing)."},"scrollPercent":{"type":"number"},"scrollPixels":{"type":"number"},"repeat":{"type":"string","enum":["days","session","browser"],"description":"session = after closing hidden for the browser session, never after a sign-up; browser = again in the next\nsession, a sign-up too; days = hidden for repeatDays (1 to 365) after closing."},"repeatDays":{"type":"number"},"after":{"type":"string","enum":["redirect","thanks","close"],"description":"thanks = Děkovací okno (the thank-you message in the same dialog, closes itself after closeSeconds); close = Bez\nděkovací stránky (the dialog closes at once, \"Hotovo\" shows for 2 s); redirect needs successUrl (the whole page goes\nthere after the sign-up)."},"closeSeconds":{"type":"number","description":"Děkovací okno closes itself after 0 to 60 seconds, 0 = stays open until the visitor closes it."},"delayScope":{"type":"string","enum":["page","site"],"description":"site = the delay counts time on the whole e-shop across page views; page = each page starts again."},"mobile":{"type":"string","enum":["off","sheet"],"description":"sheet = a bottom sheet on phones and tablets; off = never there (SmartEmailing's recommended default)."},"side":{"type":"string","enum":["left","right"],"description":"Slide-in: the button at the bottom right or left."},"skipLoggedIn":{"type":"boolean","description":"Never for a signed-in Shoptet customer (dataLayer)."},"skipFromEmail":{"type":"boolean","description":"Never for visitors from a Poštárna e-mail (marker parameter emailParam or utm_source in emailSources), 365 days."},"emailParam":{"type":"string"},"emailSources":{"type":"array","items":{"type":"string"}},"skipAfterOrder":{"type":"boolean","description":"Never after an order (thank-you page address contains one of orderPatterns), 365 days."},"orderPatterns":{"type":"array","items":{"type":"string"}},"excludePatterns":{"type":"array","items":{"type":"string"},"description":"Never on addresses containing one of these (cart, checkout)."}},"description":"Pop-up settings, completed with POPUP_DEFAULTS; ignored for a classic form."},"design":{"type":"object","properties":{"template":{"type":"string","enum":["classic","popup","slide","popup-image","popup-image-aside","slide-image"]},"style":{"type":"string","description":"<category>-<colour> of formStyles.json."},"width":{"type":"number"},"image":{"type":"string","description":"https address of the picture, '' = none."},"imagePosition":{"type":"string","enum":["top","aside"]},"showTitle":{"type":"boolean"},"showText":{"type":"boolean"},"titleColor":{"type":"string","description":"#rrggbb or '' (the style's colour)."},"textColor":{"type":"string"},"buttonColor":{"type":"string"},"buttonTextColor":{"type":"string"},"font":{"type":"string","enum":["arial","verdana","tahoma","trebuchet","georgia","times","courier"],"description":"Písmo (core/form_builder.FONTS): fonts every device has."},"titleSize":{"type":"number","description":"px, 14 to 48 / 12 to 28 (core/form_builder.SIZE_LIMITS)."},"textSize":{"type":"number"}}},"settings":{"type":"object","properties":{"existingMode":{"type":"string","enum":["error","update","keep"]},"errorUrl":{"type":"string"},"notify":{"type":"array","items":{"type":"string"}},"newTab":{"type":"boolean"},"keepParams":{"type":"boolean"},"affiliateParam":{"type":"string"},"thanksHtml":{"type":"string"},"typoCheck":{"type":"boolean"},"doi":{"type":"boolean"},"doiTemplateId":{"type":["string","null"]},"senderName":{"type":"string"},"senderEmail":{"type":"string"},"replyTo":{"type":"string"},"doiAfter":{"type":"string","enum":["redirect","thanks"]},"doiThanksHtml":{"type":"string"},"consentMode":{"type":"string","enum":["text","checkbox"],"description":"checkbox = a required check box with consentText; text = SmartEmailing's information text with a link."},"consentLabel":{"type":"string"},"consentLinkText":{"type":"string"},"consentLinkUrl":{"type":"string"},"extraPurposes":{"type":"array","items":{"$ref":"#/components/schemas/FormExtraPurpose"}}}},"tags":{"type":"array","items":{"type":"string"}}},"required":["name","shopId","listIds","purposeId","consentText"]},"FormKind":{"type":"string","enum":["classic","popup","slide"]},"FormSettings":{"type":"object","properties":{"existingMode":{"type":"string","enum":["error","update","keep"]},"errorUrl":{"type":"string"},"notify":{"type":"array","items":{"type":"string"}},"newTab":{"type":"boolean"},"keepParams":{"type":"boolean"},"affiliateParam":{"type":"string"},"thanksHtml":{"type":"string"},"typoCheck":{"type":"boolean"},"doi":{"type":"boolean"},"doiTemplateId":{"type":["string","null"]},"senderName":{"type":"string"},"senderEmail":{"type":"string"},"replyTo":{"type":"string"},"doiAfter":{"type":"string","enum":["redirect","thanks"]},"doiThanksHtml":{"type":"string"},"consentMode":{"type":"string","enum":["text","checkbox"],"description":"checkbox = a required check box with consentText; text = SmartEmailing's information text with a link."},"consentLabel":{"type":"string"},"consentLinkText":{"type":"string"},"consentLinkUrl":{"type":"string"},"extraPurposes":{"type":"array","items":{"$ref":"#/components/schemas/FormExtraPurpose"}}},"required":["existingMode","errorUrl","notify","newTab","keepParams","affiliateParam","thanksHtml","typoCheck","doi","doiTemplateId","senderName","senderEmail","replyTo","doiAfter","doiThanksHtml","consentMode","consentLabel","consentLinkText","consentLinkUrl","extraPurposes"],"description":"Nastavení (step 3) and Přiřadit účely zpracování: core/form_builder.py SETTINGS_DEFAULTS."},"FormSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shopId":{"type":"string"},"status":{"type":"string","enum":["active","inactive"],"description":"inactive = the form takes no sign-ups (its page answers 410)."},"listIds":{"type":"array","items":{"type":"string"}},"purposeId":{"type":["string","null"],"description":"null = Bez účelu zpracování."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"kind":{"allOf":[{"$ref":"#/components/schemas/FormKind"}],"description":"classic = in the page; popup = a dialog of popup.js; slide = Vyjíždějící (a button of popup.js opens it)."},"tags":{"type":"array","items":{"type":"string"}},"fills":{"type":"number","description":"Number of sign-ups (Historie vyplnění)."},"publicId":{"type":"string"},"previewUrl":{"type":"string","description":"hostedUrl?preview=1: Náhled webového formuláře (works for an inactive form too)."}},"required":["id","name","shopId","status","listIds","purposeId","createdAt","updatedAt","kind","tags","fills","publicId","previewUrl"]},"FormTemplate":{"type":"string","enum":["classic","popup","slide","popup-image","popup-image-aside","slide-image"]},"FormWelcome":{"type":"object","properties":{"enabled":{"type":"boolean","description":"The own automation runs."},"automation":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/AutomationStatus"},"custom":{"type":"boolean"}},"required":["id","name","status","custom"],"description":"custom = changed in the automation editor (more nodes): shown only, edited there."},"templateId":{"type":["string","null"]},"senderId":{"type":["string","null"]},"senderName":{"type":"string"},"replyTo":{"type":"string"},"template":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"couponKeys":{"type":"array","items":{"type":"string"}}},"required":["id","name","couponKeys"],"description":"The template asked for (?templateId=) or the automation's one, with the coupon keys it carries."},"couponStackId":{"type":["string","null"],"description":"The stack whose tag the template carries."},"stacks":{"type":"array","items":{"$ref":"#/components/schemas/FormWelcomeStack"}},"others":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/AutomationStatus"}},"required":["id","name","status"]},"description":"Other automations started by this form."}},"required":["enabled","automation","templateId","senderId","senderName","replyTo","template","couponStackId","stacks","others"],"description":"E-mail po přihlášení (core/form_welcome.py): the form's own automation (trigger form_submitted of the form, each\ncontact once, one send_email node)."},"FormWelcomeInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"templateId":{"type":["string","null"]},"senderId":{"type":["string","null"]},"senderName":{"type":"string"},"replyTo":{"type":"string"},"couponStackId":{"type":["string","null"]}},"required":["enabled"]},"FormWelcomeStack":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mergeKey":{"type":"string"},"tag":{"type":"string","description":"{{coupon_<mergeKey>}}"},"free":{"type":"number"},"low":{"type":"boolean","description":"50 or fewer free codes."}},"required":["id","name","mergeKey","tag","free","low"],"description":"A coupon stack offered for E-mail po přihlášení (its tag in the template gives every subscriber one code)."},"GridLayoutPrefs":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string"}},"hidden":{"type":"array","items":{"type":"string"}},"pins":{"type":"object","additionalProperties":{"type":"string","enum":["left","right"]}},"widths":{"type":"object","additionalProperties":{"type":"number"},"description":"Column widths in px (40 to 1200) the user dragged."},"multiSort":{"type":"boolean"},"locks":{"type":"array","items":{"type":"string"},"description":"Columns locked to their side (SE's zámek)."},"advancedFilters":{"type":"boolean","description":"SE's \"Pokročilé operátory filtrů\"."}},"description":"Column settings of one grid saved for the signed-in user (the SPA's ColumnLayout without defaults)."},"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."},"ImportCounts":{"type":"object","properties":{"rows":{"type":"number"},"create":{"type":"number"},"update":{"type":"number"},"skipSuppressed":{"type":"number","description":"Unsubscribed, bounced, complained or suppressed: never re-subscribed and not changed."},"skipMissing":{"type":"number","description":"update_only and the address is not a contact."},"invalid":{"type":"number"},"duplicate":{"type":"number","description":"Same address earlier in the file."},"unsubscribe":{"type":"number","description":"Opt-out modes: unsubscribed from the lists, removed from them, put on the blacklist."},"remove":{"type":"number"},"blacklist":{"type":"number"}},"required":["rows","create","update","skipSuppressed","skipMissing","invalid","duplicate","unsubscribe","remove","blacklist"]},"ImportDetail":{"type":"object","properties":{"source":{"type":"string"},"purposeId":{"type":"string"},"addedToLists":{"type":"number","description":"New list memberships."},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ImportRowProblem"},"description":"First 50 invalid rows."},"report":{"anyOf":[{"$ref":"#/components/schemas/ImportReport"},{"type":"null"}],"description":"null until finished."},"runAutomations":{"type":"boolean","description":"The import starts automations (ImportRequest.runAutomations); false by default."},"options":{"$ref":"#/components/schemas/ImportOptions"},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["queued","running","draft","finished","failed"]},"kind":{"type":"string","enum":["csv","shoptet_customers","shoptet_newsletter"]},"fileName":{"type":"string"},"shopId":{"type":"string"},"mode":{"type":"string","enum":["upsert","update_only","unsubscribe","remove","blacklist"]},"listIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"startedAt":{"type":["string","null"],"description":"When the run started (null while queued)."},"finishedAt":{"type":["string","null"]},"progress":{"type":"object","properties":{"processed":{"type":"number"},"total":{"type":"number"}},"required":["processed","total"],"description":"Rows the run has processed so far (it commits batch by batch)."},"counts":{"anyOf":[{"$ref":"#/components/schemas/ImportCounts"},{"type":"null"}],"description":"null until finished."},"listNames":{"type":"array","items":{"type":"string"},"description":"Names of the chosen lists in their order (SE's column Seznamy; the grid only)."}},"required":["source","purposeId","addedToLists","errors","report","id","name","status","kind","fileName","shopId","mode","listIds","createdAt","startedAt","finishedAt","progress","counts"]},"ImportDraft":{"type":"object","properties":{"source":{"type":"string"},"state":{"$ref":"#/components/schemas/ImportDraftState"},"file":{"anyOf":[{"$ref":"#/components/schemas/ImportFile"},{"type":"null"}]},"updatedAt":{"type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["queued","running","draft","finished","failed"]},"kind":{"type":"string","enum":["csv","shoptet_customers","shoptet_newsletter"]},"fileName":{"type":"string"},"shopId":{"type":"string"},"mode":{"type":"string","enum":["upsert","update_only","unsubscribe","remove","blacklist"]},"listIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"startedAt":{"type":["string","null"],"description":"When the run started (null while queued)."},"finishedAt":{"type":["string","null"]},"progress":{"type":"object","properties":{"processed":{"type":"number"},"total":{"type":"number"}},"required":["processed","total"],"description":"Rows the run has processed so far (it commits batch by batch)."},"counts":{"anyOf":[{"$ref":"#/components/schemas/ImportCounts"},{"type":"null"}],"description":"null until finished."},"listNames":{"type":"array","items":{"type":"string"},"description":"Names of the chosen lists in their order (SE's column Seznamy; the grid only)."}},"required":["source","state","file","updatedAt","id","name","status","kind","fileName","shopId","mode","listIds","createdAt","startedAt","finishedAt","progress","counts"],"description":"SE \"Rozpracováno\": the summary, the wizard's state and the stored file while it lasts (24 hours)."},"ImportDraftInput":{"type":"object","properties":{"name":{"type":"string"},"source":{"type":"string"},"step":{"type":"number"},"state":{"$ref":"#/components/schemas/ImportDraftState"},"fileId":{"type":["string","null"]},"shopId":{"type":["string","null"]}}},"ImportDraftState":{"type":"object","properties":{"step":{"type":"number"}},"additionalProperties":{},"description":"The wizard's own state of a draft import (opaque to the server, with the step)."},"ImportEncoding":{"type":"string","enum":["utf-8","windows-1250","utf-16"]},"ImportFile":{"type":"object","properties":{"fileId":{"type":"string"},"fileName":{"type":"string"},"size":{"type":"number","description":"Bytes of the file as uploaded."},"delimiter":{"type":"string","description":"; , tab or the one character the person chose."},"quote":{"type":"string","description":"Field enclosure (default \")."},"hasHeader":{"type":"boolean","description":"false = the first line is data and the columns have no names."},"encoding":{"allOf":[{"$ref":"#/components/schemas/ImportEncoding"}],"description":"What the server read the file as (detected)."},"columns":{"type":"array","items":{"type":"string"},"description":"Header row."},"rowCount":{"type":"number","description":"Data rows without the header."},"sample":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"First data rows as they are in the file."},"suggestedKind":{"type":"string","enum":["csv","shoptet_customers","shoptet_newsletter"],"description":"The server's suggestion from the header names (Czech, Slovak, English, Shoptet)."},"suggestedMapping":{"$ref":"#/components/schemas/ImportMapping"}},"required":["fileId","fileName","size","delimiter","encoding","columns","rowCount","sample","suggestedKind","suggestedMapping"]},"ImportMapping":{"type":"array","items":{"type":["string","null"]}},"ImportOptions":{"type":"object","properties":{"autofill":{"type":"object","properties":{"salutation":{"type":"boolean"},"gender":{"type":"boolean"},"nameday":{"type":"boolean"},"language":{"type":"boolean"},"calendar":{"type":"string","enum":["sk","cz"]}},"required":["salutation","gender","nameday","language","calendar"],"description":"Fill empty fields from the first name and the address (SE \"Automatické doplnění údajů ke kontaktu\")."},"consentFrom":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"now"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"date"},"date":{"type":"string"}},"required":["kind","date"]}],"description":"Start of the purpose consent: now, or one date for every row (a date column is the mapped newsletterConsentAt)."},"doi":{"type":"object","properties":{"target":{"type":"string","enum":["new","all"]},"senderId":{"type":"string"},"fromName":{"type":"string"},"replyTo":{"type":"string"},"thanksUrl":{"type":"string"},"templateId":{"type":["string","null"],"description":"SE's chosen double opt-in e-mail: a template with {{confirmlink}}; null = Poštárna's own e-mail (IM-06)."},"landingPageId":{"type":["string","null"],"description":"SE \"Vybrat z vašich landing pages\" as the thank-you page; only without thanksUrl."}},"required":["target","senderId","fromName","replyTo","thanksUrl"],"description":"Double opt-in e-mail instead of an immediate subscription (upsert and update_only)."}}},"ImportPlan":{"type":"object","properties":{"fileId":{"type":"string"},"mapping":{"$ref":"#/components/schemas/ImportMapping"},"mode":{"type":"string","enum":["upsert","update_only","unsubscribe","remove","blacklist"]},"kind":{"type":"string","enum":["csv","shoptet_customers","shoptet_newsletter"],"description":"Default csv."},"subscribersConfirmed":{"type":"boolean","description":"A Shoptet newsletter export without a consent column: the person confirmed that every row is an active\nsubscriber (required, 400 subscribers otherwise)."},"shopId":{"type":"string","description":"Main shop of new contacts; lists must belong to it or to the whole company."},"listIds":{"type":"array","items":{"type":"string"}}},"required":["fileId","mapping","mode","shopId","listIds"]},"ImportPreview":{"type":"object","properties":{"counts":{"$ref":"#/components/schemas/ImportCounts"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/ImportPreviewRow"},"description":"First 20 rows."},"report":{"$ref":"#/components/schemas/ImportReport"}},"required":["counts","rows","report"]},"ImportPreviewRow":{"type":"object","properties":{"row":{"type":"number","description":"Line in the file, the header is line 1."},"email":{"type":"string"},"action":{"type":"string","enum":["invalid","unsubscribe","remove","blacklist","create","update","skip_suppressed","skip_missing","duplicate"]},"error":{"type":["string","null"],"enum":["email_missing","email_invalid","value_invalid",null]},"field":{"type":["string","null"],"enum":["companyId","firstName","lastName","phone","country","street","city","language","note","email","company","mobile","postalCode","gender","fullName","titleBefore","titleAfter","birthday","newsletterConsent","newsletterConsentAt","registeredAt",null],"description":"The field with an invalid value."},"values":{"type":"object","properties":{"companyId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"country":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"language":{"type":"string"},"note":{"type":"string"},"email":{"type":"string"},"company":{"type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"gender":{"type":"string"},"fullName":{"type":"string"},"titleBefore":{"type":"string"},"titleAfter":{"type":"string"},"birthday":{"type":"string"},"newsletterConsent":{"type":"string"},"newsletterConsentAt":{"type":"string"},"registeredAt":{"type":"string"}},"description":"Normalized values that would be written."},"consent":{"type":["boolean","null"],"description":"Whether the row brings a newsletter consent (false = a customer only); null for invalid rows and opt-out modes."}},"required":["row","email","action","error","field","values","consent"]},"ImportReport":{"type":"object","properties":{"consent":{"type":"object","properties":{"optIn":{"type":"number"},"none":{"type":"number","description":"Rows without consent: customers only."},"keptUnsubscribed":{"type":"number","description":"The file says opt-in, the contact is unsubscribed or suppressed: it stays so (only a double opt-in lifts it)."}},"required":["optIn","none","keptUnsubscribed"]},"merge":{"type":"object","properties":{"existing":{"type":"number","description":"Rows that met an existing contact (one contact per address)."},"fromSources":{"type":"object","additionalProperties":{"type":"number"},"description":"Existing contacts per other source they came from (smartemailing, shoptet, csv, ...)."},"fieldsUpdated":{"type":"number"},"fieldsKeptEdited":{"type":"number","description":"Values not written because a person edited the field in Poštárna."}},"required":["existing","fromSources","fieldsUpdated","fieldsKeptEdited"]},"dropped":{"type":"object","properties":{"companyId":{"type":"number"},"firstName":{"type":"number"},"lastName":{"type":"number"},"phone":{"type":"number"},"country":{"type":"number"},"street":{"type":"number"},"city":{"type":"number"},"language":{"type":"number"},"note":{"type":"number"},"email":{"type":"number"},"company":{"type":"number"},"mobile":{"type":"number"},"postalCode":{"type":"number"},"gender":{"type":"number"},"fullName":{"type":"number"},"titleBefore":{"type":"number"},"titleAfter":{"type":"number"},"birthday":{"type":"number"},"newsletterConsent":{"type":"number"},"newsletterConsentAt":{"type":"number"},"registeredAt":{"type":"number"}},"description":"Values of Shoptet files that did not fit and were left out, per field."}},"required":["consent","merge","dropped"],"description":"Merge summary of an import: the consent of the rows, existing contacts and their other sources, values left out."},"ImportRequest":{"type":"object","properties":{"name":{"type":"string"},"source":{"type":"string","description":"Where the contacts come from (se-spec 01 §7.1), e.g. a trade fair."},"purposeId":{"type":"string","description":"Purpose of processing given to the imported contacts. Optional for OPT_OUT_MODES (the server stores the\ntenant's first purpose when omitted; those modes write no consent)."},"consentConfirmed":{"type":"boolean","description":"The user confirms a documented, valid purpose for every contact; must be true. Not required for OPT_OUT_MODES."},"runAutomations":{"type":"boolean","description":"Explicit opt-in: what the import writes starts automations (added to a list, subscribed, contact created ...).\nDefault false: an import is a bulk write that starts none."},"options":{"allOf":[{"$ref":"#/components/schemas/ImportOptions"}],"description":"Autofill, start of the purpose consent and the double opt-in e-mail (SE wizard)."},"draftId":{"type":"string","description":"The wizard's draft this import comes from (deleted when the import starts)."},"fileId":{"type":"string"},"mapping":{"$ref":"#/components/schemas/ImportMapping"},"mode":{"type":"string","enum":["upsert","update_only","unsubscribe","remove","blacklist"]},"kind":{"type":"string","enum":["csv","shoptet_customers","shoptet_newsletter"],"description":"Default csv."},"subscribersConfirmed":{"type":"boolean","description":"A Shoptet newsletter export without a consent column: the person confirmed that every row is an active\nsubscriber (required, 400 subscribers otherwise)."},"shopId":{"type":"string","description":"Main shop of new contacts; lists must belong to it or to the whole company."},"listIds":{"type":"array","items":{"type":"string"}}},"required":["name","source","fileId","mapping","mode","shopId","listIds"]},"ImportRowProblem":{"type":"object","properties":{"row":{"type":"number"},"error":{"type":"string","enum":["email_missing","email_invalid","value_invalid"]},"field":{"type":["string","null"],"enum":["companyId","firstName","lastName","phone","country","street","city","language","note","email","company","mobile","postalCode","gender","fullName","titleBefore","titleAfter","birthday","newsletterConsent","newsletterConsentAt","registeredAt",null]}},"required":["row","error","field"]},"ImportSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["queued","running","draft","finished","failed"]},"kind":{"type":"string","enum":["csv","shoptet_customers","shoptet_newsletter"]},"fileName":{"type":"string"},"shopId":{"type":"string"},"mode":{"type":"string","enum":["upsert","update_only","unsubscribe","remove","blacklist"]},"listIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"startedAt":{"type":["string","null"],"description":"When the run started (null while queued)."},"finishedAt":{"type":["string","null"]},"progress":{"type":"object","properties":{"processed":{"type":"number"},"total":{"type":"number"}},"required":["processed","total"],"description":"Rows the run has processed so far (it commits batch by batch)."},"counts":{"anyOf":[{"$ref":"#/components/schemas/ImportCounts"},{"type":"null"}],"description":"null until finished."},"listNames":{"type":"array","items":{"type":"string"},"description":"Names of the chosen lists in their order (SE's column Seznamy; the grid only)."}},"required":["id","name","status","kind","fileName","shopId","mode","listIds","createdAt","startedAt","finishedAt","progress","counts"]},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["account_admin","marketing_manager","content_manager","data_analyst","developer","finance"]}},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"createdAt":{"type":["string","null"]}},"required":["id","email","roles","expiresAt","expired","createdAt"]},"Invoice":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["invoice","credit_note"]},"purpose":{"type":"string","enum":["upgrade","subscription","overage","manual","credit"]},"currency":{"$ref":"#/components/schemas/BillingCurrency"},"net":{"type":"string"},"vat":{"type":"string"},"total":{"type":"string"},"vatRate":{"type":"string"},"reverseCharge":{"type":"boolean"},"paidAmount":{"type":"string"},"state":{"type":"string","enum":["cancelled","issued","paid"]},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"issueDate":{"type":"string"},"dueDate":{"type":"string"},"paidAt":{"type":["string","null"]},"sentAt":{"type":["string","null"]},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"days":{"type":"number","description":"Days after the due date (overdue) or until it (unpaid)."},"creditFor":{"type":["string","null"]},"reminders":{"type":"number"},"hasQr":{"type":"boolean"},"buyerName":{"type":"string"},"tenant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","number","kind","purpose","currency","net","vat","total","vatRate","reverseCharge","paidAmount","state","status","issueDate","dueDate","paidAt","sentAt","periodStart","periodEnd","days","creditFor","reminders","hasQr","buyerName"]},"InvoiceStatus":{"type":"string","enum":["cancelled","unpaid","credit","paid","partial","overdue","due_today"]},"JsonRpcRequest":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer"]},"method":{"type":"string"},"params":{"type":"object"}}},"JsonRpcResponse":{"type":"object","required":["jsonrpc"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer","null"]},"result":{},"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}}}}},"Label":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"used":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","name","color","used","createdAt"],"description":"SE Štítky: a label with its RGBA colour (#rrggbbaa) and how many records carry it."},"LabelTargets":{"type":"object","properties":{"lists":{"type":"array","items":{"type":"string"}},"segments":{"type":"array","items":{"type":"string"}},"campaigns":{"type":"array","items":{"type":"string"}},"automations":{"type":"array","items":{"type":"string"}}}},"LandingPage":{"type":"object","properties":{"html":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean","description":"An inactive page answers 404 on its address."},"url":{"type":"string","description":"The public address on the link domain."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["html","id","name","active","url","createdAt","updatedAt"]},"LandingPageInput":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"},"html":{"type":"string"}},"required":["name","active","html"]},"LandingPageSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean","description":"An inactive page answers 404 on its address."},"url":{"type":"string","description":"The public address on the link domain."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","active","url","createdAt","updatedAt"]},"Lang":{"type":"string","enum":["cs","sk"]},"LastOrderRule":{"type":"object","properties":{"type":{"type":"string","const":"last_order"},"operator":{"type":"string","enum":["in_last_days","before","after","older_than_days"]},"value":{"type":"string"},"shopId":{"type":["string","null"]},"currency":{"type":["string","null"],"enum":["CZK","EUR",null]}},"required":["type","operator","value","shopId","currency"]},"LintIssue":{"type":"object","properties":{"code":{"type":"string","enum":["subject_missing","subject_too_long","content_empty","unknown_tag","foreign_tag","script_tag","script_error","unsupported_filter","bad_fallback","emoji","forbidden_word","image_placeholder","image_data_uri","banned_host","html_too_large","no_unsubscribe","footer_incomplete","subject_long","img_without_alt","insecure_image","image_too_large","image_foreign_host","text_image_ratio"]},"severity":{"allOf":[{"$ref":"#/components/schemas/LintSeverity"}],"description":"Errors block the approval of a campaign; warnings do not."},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["code","severity","params"]},"LintRequest":{"type":"object","properties":{"html":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"}},"required":["html","subject","preheader"]},"LintSeverity":{"type":"string","enum":["error","warning"]},"ListAutofillResult":{"type":"object","properties":{"members":{"type":"number"},"contacts":{"type":"number"},"fields":{"type":"object","additionalProperties":{"type":"number"}}},"required":["members","contacts","fields"]},"ListCounts":{"type":"object","properties":{"total":{"type":"number","description":"Members without the removed state; the sum of byBucket."},"byBucket":{"type":"object","properties":{"active":{"type":"number"},"unsubscribed":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"blacklisted":{"type":"number"},"unconfirmed":{"type":"number"}},"required":["active","unsubscribed","bounced","complained","blacklisted","unconfirmed"]}},"required":["total","byBucket"]},"ListInput":{"type":"object","properties":{"name":{"type":"string"},"publicName":{"type":"string"},"shopId":{"type":["string","null"]},"notifyOnUnsubscribe":{"type":"boolean"},"notifyOnAdd":{"type":"boolean"},"note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"signatureHtml":{"type":"string"},"senderEmail":{"type":"string"},"senderName":{"type":"string","description":"SE's sendername and replyto of a list (API only in SE, SZ-04)."},"replyTo":{"type":"string"}},"required":["name","publicName","shopId","notifyOnUnsubscribe","notifyOnAdd","note"]},"ListJobQueued":{"type":"object","properties":{"jobId":{"type":["string","null"]},"queued":{"type":"boolean"}},"required":["jobId"],"description":"202 of a deletion with contacts or of a merge: the work runs in the background, a notification tells when done."},"ListLabelRule":{"type":"object","properties":{"type":{"type":"string","const":"list_label"},"operator":{"type":"string","const":"in"},"label":{"type":"string"}},"required":["type","operator","label"],"description":"SE \"Kontakt je v libovolném seznamu se štítkem...\": a confirmed or unconfirmed member of any list with the label."},"ListMember":{"type":"object","properties":{"listState":{"type":"string","enum":["unsubscribed","confirmed","unconfirmed"],"description":"State in this list; removed members are never returned."},"bucket":{"type":"string","enum":["active","unsubscribed","bounced","complained","blacklisted","unconfirmed"]},"addedAt":{"type":"string"},"changedAt":{"type":"string"},"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"status":{"type":"string","enum":["pending","subscribed","unsubscribed","bounced","complained","customer"]},"engagement":{"type":"string","enum":["A","B","C","D","E","N"]},"excluded":{"type":"boolean","description":"SE \"Vyloučené\": long inactive yet mailed often (recomputed weekly with the engagement)."},"shopId":{"type":["string","null"],"description":"Main e-shop (contacts.shop_id), null when unknown."},"suppressionReason":{"type":["string","null"],"enum":["invalid","manual","unsubscribed","hard_bounce","complaint","soft_bounce_limit",null],"description":"Set when the address is on the tenant suppression list."},"blacklisted":{"type":"boolean","description":"On the tenant's blacklist (\"Na blacklistu\"): a manual entry, or an entry of SmartEmailing's blacklist that keeps\nits own reason (migration 0180). Older servers leave it out: then suppressionReason 'manual' decides."},"blacklistedAt":{"type":["string","null"],"description":"When the address went on the blacklist (the suppression's time), null when it is not on it (\"Přidán na blacklist\")."},"state":{"type":"string","enum":["active","bounced","blacklisted"],"description":"SmartEmailing's 3-value contact state; older servers leave it out (contactState derives it)."},"createdAt":{"type":"string"},"extra":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"null"}]},"description":"Values of the extra columns asked for (ContactQuery.fields): dates as YYYY-MM-DD, times as ISO."}},"required":["listState","bucket","addedAt","changedAt","id","email","firstName","lastName","status","engagement","excluded","shopId","suppressionReason","createdAt"]},"ListMembershipState":{"type":"string","enum":["unsubscribed","confirmed","unconfirmed","removed"]},"ListMergeInput":{"type":"object","properties":{"listIds":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"deleteSources":{"type":"boolean"}},"required":["listIds","name","deleteSources"],"description":"Bulk action Sloučit seznamy kontaktů (SZ-07)."},"ListMergeResult":{"type":"object","properties":{"list":{"$ref":"#/components/schemas/ContactListDetail"},"jobId":{"type":["string","null"]}},"required":["list","jobId"]},"ListRule":{"type":"object","properties":{"type":{"type":"string","const":"list"},"operator":{"type":"string","enum":["in","not_in","added_before","added_after","status_is","longer_than_days","shorter_than_days"]},"listId":{"type":"string"},"value":{"type":["string","null"],"description":"A date (added_before/after), a ListStatus (status_is) or a number of days (longer/shorter_than_days); unused\nby in/not_in."}},"required":["type","operator","listId"]},"LoginResult":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"email_code_required"},"challengeId":{"type":"string"},"expiresAt":{"type":"string"}},"required":["status","challengeId","expiresAt"]},{"type":"object","properties":{"status":{"type":"string","const":"totp_required"},"challengeId":{"type":"string"},"expiresAt":{"type":"string"}},"required":["status","challengeId","expiresAt"]},{"type":"object","properties":{"status":{"type":"string","const":"ok"}},"required":["status"]}]},"MagicBackground":{"type":"object","properties":{"type":{"type":"string","enum":["color","gradient","image"]},"from":{"type":"string"},"to":{"type":"string"},"angle":{"type":"number","description":"Gradient direction in degrees (180 = top to bottom)."},"image":{"type":"string"},"fit":{"type":"string","enum":["cover","repeat","original"],"description":"Picture: cover the area, tile, or the original size once."}},"required":["type"],"description":"A background of the Magic editor: a plain colour, a linear gradient or a picture (https)."},"MagicStyles":{"type":"object","properties":{"padding":{"allOf":[{"$ref":"#/components/schemas/BoxPadding"}],"description":"Space around the e-mail body, desktop and mobile."},"paddingMobile":{"$ref":"#/components/schemas/BoxPadding"},"darkMode":{"type":"boolean","description":"Dark mode in the recipient's app (prefers-color-scheme) with its colours."},"darkBackgroundColor":{"type":"string"},"darkContentColor":{"type":"string"},"darkTextColor":{"type":"string"},"darkHeadingColor":{"type":"string"},"darkLinkColor":{"type":"string"},"darkButtonColor":{"type":"string","description":"Dark mode colours of the buttons and the divider (SE: every colour has its \"(tmavé schéma)\" variant)."},"darkButtonTextColor":{"type":"string"},"darkButton2Color":{"type":"string"},"darkButton2TextColor":{"type":"string"},"darkDividerColor":{"type":"string"},"background":{"allOf":[{"$ref":"#/components/schemas/MagicBackground"}],"description":"SE \"Typ pozadí\" of the e-mail (around the body) and of the body: a gradient or a picture over the colour\n(backgroundColor / contentColor stay the fallback of clients without head styles)."},"bodyBackground":{"$ref":"#/components/schemas/MagicBackground"},"button2Color":{"type":"string","description":"Secondary button and divider colours."},"button2TextColor":{"type":"string"},"button2BorderColor":{"type":"string"},"buttonBorderColor":{"type":"string"},"dividerColor":{"type":"string"},"footerDefault":{"type":"boolean","description":"System footer (SmartEmailing \"Patička\"): its own default look instead of the e-mail's, and no background."},"footerTransparent":{"type":"boolean"},"text":{"type":"object","properties":{"h1":{"type":"object","properties":{"fontFamily":{"type":"string","description":"'' = the e-mail's font (fontFamily, or headingFontFamily for headings)."},"fontSize":{"type":"number"},"lineHeight":{"type":"number","description":"Relative to the font size (0.8 to 2.0)."},"letterSpacing":{"type":"number","description":"px (0 to 15)."},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"strike":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right","justify"]},"color":{"type":"string","description":"'' = the e-mail's colour for the style."}}},"h2":{"type":"object","properties":{"fontFamily":{"type":"string","description":"'' = the e-mail's font (fontFamily, or headingFontFamily for headings)."},"fontSize":{"type":"number"},"lineHeight":{"type":"number","description":"Relative to the font size (0.8 to 2.0)."},"letterSpacing":{"type":"number","description":"px (0 to 15)."},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"strike":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right","justify"]},"color":{"type":"string","description":"'' = the e-mail's colour for the style."}}},"h3":{"type":"object","properties":{"fontFamily":{"type":"string","description":"'' = the e-mail's font (fontFamily, or headingFontFamily for headings)."},"fontSize":{"type":"number"},"lineHeight":{"type":"number","description":"Relative to the font size (0.8 to 2.0)."},"letterSpacing":{"type":"number","description":"px (0 to 15)."},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"strike":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right","justify"]},"color":{"type":"string","description":"'' = the e-mail's colour for the style."}}},"p":{"type":"object","properties":{"fontFamily":{"type":"string","description":"'' = the e-mail's font (fontFamily, or headingFontFamily for headings)."},"fontSize":{"type":"number"},"lineHeight":{"type":"number","description":"Relative to the font size (0.8 to 2.0)."},"letterSpacing":{"type":"number","description":"px (0 to 15)."},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"strike":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right","justify"]},"color":{"type":"string","description":"'' = the e-mail's colour for the style."}}},"link":{"type":"object","properties":{"fontFamily":{"type":"string","description":"'' = the e-mail's font (fontFamily, or headingFontFamily for headings)."},"fontSize":{"type":"number"},"lineHeight":{"type":"number","description":"Relative to the font size (0.8 to 2.0)."},"letterSpacing":{"type":"number","description":"px (0 to 15)."},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"strike":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right","justify"]},"color":{"type":"string","description":"'' = the e-mail's colour for the style."}}},"button":{"type":"object","properties":{"fontFamily":{"type":"string","description":"'' = the e-mail's font (fontFamily, or headingFontFamily for headings)."},"fontSize":{"type":"number"},"lineHeight":{"type":"number","description":"Relative to the font size (0.8 to 2.0)."},"letterSpacing":{"type":"number","description":"px (0 to 15)."},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"strike":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right","justify"]},"color":{"type":"string","description":"'' = the e-mail's colour for the style."}}},"button2":{"type":"object","properties":{"fontFamily":{"type":"string","description":"'' = the e-mail's font (fontFamily, or headingFontFamily for headings)."},"fontSize":{"type":"number"},"lineHeight":{"type":"number","description":"Relative to the font size (0.8 to 2.0)."},"letterSpacing":{"type":"number","description":"px (0 to 15)."},"bold":{"type":"boolean"},"italic":{"type":"boolean"},"underline":{"type":"boolean"},"strike":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right","justify"]},"color":{"type":"string","description":"'' = the e-mail's colour for the style."}}}},"description":"Text styles per kind; missing keys = defaults. Mobile values override desktop ones under 480 px."},"textMobile":{"type":"object","properties":{"h1":{"type":"object","properties":{"fontSize":{"type":"number"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"align":{"type":"string","enum":["left","center","right","justify"]}}},"h2":{"type":"object","properties":{"fontSize":{"type":"number"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"align":{"type":"string","enum":["left","center","right","justify"]}}},"h3":{"type":"object","properties":{"fontSize":{"type":"number"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"align":{"type":"string","enum":["left","center","right","justify"]}}},"p":{"type":"object","properties":{"fontSize":{"type":"number"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"align":{"type":"string","enum":["left","center","right","justify"]}}},"link":{"type":"object","properties":{"fontSize":{"type":"number"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"align":{"type":"string","enum":["left","center","right","justify"]}}},"button":{"type":"object","properties":{"fontSize":{"type":"number"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"align":{"type":"string","enum":["left","center","right","justify"]}}},"button2":{"type":"object","properties":{"fontSize":{"type":"number"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"align":{"type":"string","enum":["left","center","right","justify"]}}}}},"defaults":{"type":"object","properties":{"rowPadding":{"$ref":"#/components/schemas/BoxPadding"},"columnPadding":{"$ref":"#/components/schemas/BoxPadding"},"textPadding":{"$ref":"#/components/schemas/BoxPadding"},"imagePadding":{"$ref":"#/components/schemas/BoxPadding"},"buttonPadding":{"$ref":"#/components/schemas/BoxPadding"},"buttonInnerPadding":{"type":"object","properties":{"vertical":{"type":"number"},"horizontal":{"type":"number"}},"required":["vertical","horizontal"]},"buttonRadius":{"type":"number"},"buttonFullWidth":{"type":"boolean"},"dividerPadding":{"$ref":"#/components/schemas/BoxPadding"},"dividerWidth":{"type":"number"},"dividerStyle":{"type":"string","enum":["solid","dashed","dotted"]},"spacerHeight":{"type":"number"},"imageRadius":{"type":"number"}},"description":"Defaults of new elements (SmartEmailing \"Prvky\")."}}},"McpClient":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["email-statistics:read","automation-list:read","automation-detail:read","contactlists:read","contacts:read"]}},"redirectUris":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","expired","deactivated"]},"createdBy":{"type":["object","null"],"properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"]},"createdAt":{"type":"string"},"expiresAt":{"type":["string","null"]},"lastUsedAt":{"type":["string","null"]},"deactivatedAt":{"type":["string","null"]}},"required":["id","clientId","name","permissions","redirectUris","status","createdBy","createdAt","expiresAt","lastUsedAt","deactivatedAt"]},"McpClientCreated":{"type":"object","properties":{"client":{"$ref":"#/components/schemas/McpClient"},"clientId":{"type":"string"},"clientSecret":{"type":"string"}},"required":["client","clientId","clientSecret"],"description":"The answer of Vygenerovat MCP klíč: the secret is shown this once."},"McpClientInput":{"type":"object","properties":{"name":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["email-statistics:read","automation-list:read","automation-detail:read","contactlists:read","contacts:read"]}},"redirectUris":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":["string","null"]}},"required":["name","permissions","redirectUris"]},"McpClients":{"type":"object","properties":{"serverUrl":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["email-statistics:read","automation-list:read","automation-detail:read","contactlists:read","contacts:read"]}},"presets":{"type":"object","additionalProperties":{"type":"string"},"description":"Callback URLs of known AI apps by key (claude, chatgpt)."},"items":{"type":"array","items":{"$ref":"#/components/schemas/McpClient"}}},"required":["serverUrl","permissions","presets","items"]},"Me":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}},"platform":{"type":"object","properties":{"admin":{"type":"boolean"},"problem":{"type":"string","enum":["","totp_missing","totp_not_used"]}},"required":["admin","problem"],"description":"Only for an address of POSTARNA_PLATFORM_ADMINS: may it enter /admin now, or what is missing (TOTP)."}},"required":["user","memberships"]},"Member":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["account_admin","marketing_manager","content_manager","data_analyst","developer","finance"]}},"status":{"type":"string","enum":["active","disabled"]},"userStatus":{"type":"string"},"totpEnabled":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","email","firstName","lastName","roles","status","userStatus","totpEnabled","createdAt"],"description":"A user of the company (SE Nastavení › Firma › Uživatelé firmy)."},"Membership":{"type":"object","properties":{"tenant":{"$ref":"#/components/schemas/Tenant"},"roles":{"type":"array","items":{"type":"string","enum":["account_admin","marketing_manager","content_manager","data_analyst","developer","finance"]}},"support":{"type":"boolean","description":"A platform admin's read-only support view of this tenant (every change refused, every request audited)."},"supportUntil":{"type":"string"}},"required":["tenant","roles"]},"MySession":{"type":"object","properties":{"id":{"type":"string"},"authMethod":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"createdAt":{"type":"string"},"lastSeenAt":{"type":["string","null"]},"current":{"type":"boolean"}},"required":["id","authMethod","ip","userAgent","createdAt","lastSeenAt","current"],"description":"A signed-in session of the user (GET /me/sessions)."},"NamedCount":{"type":"object","properties":{"name":{"type":"string","description":"'' = the rest (SE \"Ostatní\")."},"count":{"type":"number"}},"required":["name","count"]},"NotificationList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AppNotification"}},"unread":{"type":"number"}},"required":["items","unread"]},"NotificationType":{"type":"string","enum":["import_finished","campaign_sent","domain_verified","bounce_warning","export_ready","automation_paused","list_contacts_added","list_unsubscribed","campaign_paused","automation_notice","se_sync_problem","import_waiting","purpose_assigned_list","engagement_computed","contacts_bulk_done","list_merged","list_deleted"]},"OnboardingPatch":{"type":"object","properties":{"step":{"type":"string","enum":["domain","shop","script","feeds","contacts","done"]},"shopId":{"type":"string"},"skip":{"type":"string","enum":["domain","shop","script","feeds","contacts","done"]},"unskip":{"type":"string","enum":["domain","shop","script","feeds","contacts","done"]},"complete":{"type":"boolean"},"dismiss":{"type":"boolean"}}},"OnboardingState":{"type":"object","properties":{"visible":{"type":"boolean","description":"Shown on the dashboard (not finished, not closed; a company without a row only while it has no contact)."},"step":{"type":"string","enum":["domain","shop","script","feeds","contacts","done"]},"skipped":{"type":"array","items":{"type":"string","enum":["domain","shop","script","feeds","contacts","done"]}},"completedAt":{"type":["string","null"]},"dismissedAt":{"type":["string","null"]},"shop":{"type":["object","null"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"domain":{"type":"string"},"webDisplay":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string","enum":["shoptet","woocommerce","prestashop","upgates","custom"]},"state":{"type":"string","enum":["live","quiet","waiting"]},"seenAt":{"type":["string","null"]},"seenHost":{"type":"string"}},"required":["id","code","domain","webDisplay","name","platform","state","seenAt","seenHost"]},"steps":{"type":"object","properties":{"domain":{"type":"boolean"},"shop":{"type":"boolean"},"script":{"type":"boolean"},"feeds":{"type":"boolean"},"contacts":{"type":"boolean"},"done":{"type":"boolean"}},"required":["domain","shop","script","feeds","contacts","done"],"description":"Done from the data itself."},"feeds":{"type":"object","properties":{"orders":{"type":"boolean"},"customers":{"type":"boolean"},"products":{"type":"boolean"}}},"contacts":{"type":"number"},"progress":{"type":"number","description":"Steps of the first five that are done or skipped."},"total":{"type":"number"}},"required":["visible","step","skipped","completedAt","dismissedAt","shop","steps","feeds","contacts","progress","total"]},"OpensRule":{"type":"object","properties":{"type":{"type":"string","const":"opens"},"operator":{"type":"string","enum":["gte","lte","eq","gt","lt"]},"value":{"type":"string"},"days":{"type":["string","null"]}},"required":["type","operator","value","days"],"description":"SE \"Kontakt otevřel e-mailů...\": the number of the contact's e-mails with an open (optionally in the last days)."},"Order":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"eshopCode":{"type":"string"},"eshopName":{"type":"string"},"shopId":{"type":"string"},"createdAt":{"type":"string"},"paidAt":{"type":["string","null"]},"email":{"type":["string","null"]},"contactId":{"type":["string","null"]},"state":{"type":"string","enum":["cancelled","unpaid","new","other","paid","processing","shipped","pickup","delivered","returned"]},"status":{"$ref":"#/components/schemas/OrderStatus"},"sourceStatus":{"type":"string"},"orderUrl":{"type":"string"},"currency":{"$ref":"#/components/schemas/Currency"},"totalWithVat":{"type":["string","null"]},"totalWithoutVat":{"type":["string","null"]},"itemCount":{"type":"number"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"},"description":"The list has the first three items, the detail all of them."},"conversion":{"anyOf":[{"$ref":"#/components/schemas/OrderConversion"},{"type":"null"}]}},"required":["id","externalId","eshopCode","eshopName","shopId","createdAt","paidAt","email","contactId","state","status","sourceStatus","orderUrl","currency","totalWithVat","totalWithoutVat","itemCount","items","conversion"]},"OrderAttributeRule":{"type":"object","properties":{"type":{"type":"string","const":"order_attribute"},"operator":{"type":"string","const":"is"},"scope":{"type":"string","enum":["order","item"],"description":"item (default) = an attribute of an ordered item, order = of the order (ORDER_LEVEL_ATTRIBUTES)."},"attribute":{"type":"string"},"value":{"type":"string"},"shopId":{"type":["string","null"]},"currency":{"type":["string","null"],"enum":["CZK","EUR",null]},"days":{"type":["string","null"]}},"required":["type","operator","attribute","value","shopId","currency","days"],"description":"An item of a completed order whose code or feed-derived attribute (as stored on the order item) matches."},"OrderConversion":{"type":"object","properties":{"kind":{"type":"string","enum":["direct","assisted"]},"campaignId":{"type":["string","null"]},"automationId":{"type":["string","null"]},"clickedAt":{"type":"string"}},"required":["kind","campaignId","automationId","clickedAt"]},"OrderCountRule":{"type":"object","properties":{"type":{"type":"string","const":"order_count"},"operator":{"type":"string","enum":["gte","lte","eq"]},"value":{"type":"string"},"shopId":{"type":["string","null"]},"currency":{"type":["string","null"],"enum":["CZK","EUR",null]},"days":{"type":["string","null"],"description":"Only orders of the last N days; null = all time."}},"required":["type","operator","value","shopId","currency","days"]},"OrderItem":{"type":"object","properties":{"id":{"type":"string"},"productCode":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"price":{"$ref":"#/components/schemas/OrderItemPrice"},"quantity":{"type":"number"},"unit":{"type":"string"},"url":{"type":"string"},"imageUrl":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"null"}]},"description":"ItemType, Brand, Category, g:condition, g:availability, g:brand of the paired feed product under the item's own."},"paired":{"type":"boolean","description":"True when the item met a product of the shop's feeds by its code."}},"required":["id","productCode","name","description","price","quantity","unit","url","imageUrl","attributes","paired"]},"OrderItemPreview":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"string","description":"decimal string, orders can have fractional quantities"},"priceWithVat":{"type":["string","null"]}},"required":["name","quantity","priceWithVat"]},"OrderItemPrice":{"type":"object","properties":{"withVat":{"type":["string","null"],"description":"Unit prices as decimal strings in the order currency."},"withoutVat":{"type":["string","null"]},"currency":{"$ref":"#/components/schemas/Currency"}},"required":["withVat","withoutVat","currency"]},"OrderStateRule":{"type":"object","properties":{"sourceStatus":{"type":"string","description":"State name of the e-shop, at most 80 characters."},"match":{"type":"string","enum":["exact","prefix"],"default":"exact"},"state":{"type":"string","enum":["new","unpaid","paid","processing","shipped","pickup","delivered","cancelled","returned","other"]}},"required":["sourceStatus","state"],"description":"orders.check_state_map: one rule of the state map"},"OrderStatus":{"type":"string","enum":["cancelled","other","pending","completed"]},"OrderTotal":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"count":{"type":"number"},"totalWithVat":{"type":"string"}},"required":["currency","count","totalWithVat"],"description":"One row per currency. CZK and EUR are never added together or converted."},"OrderValueRule":{"type":"object","properties":{"type":{"type":"string","const":"order_value"},"operator":{"type":"string","enum":["gte","lte"]},"amount":{"type":"string"},"currency":{"$ref":"#/components/schemas/Currency"},"shopId":{"type":["string","null"]},"days":{"type":["string","null"]}},"required":["type","operator","amount","currency","shopId","days"],"description":"Sum of completed orders with VAT in one currency: CZK and EUR are never added together."},"OverageDay":{"type":"object","properties":{"day":{"type":"string"},"contacts":{"type":"number"},"over":{"type":"number"},"fromMax":{"type":"number"},"toMax":{"type":"number"},"amount":{"type":"string"}},"required":["day","contacts","over","fromMax","toMax","amount"],"description":"One day over the tier: (price of the tier that fits - price of the tier) / days of the month."},"Payment":{"type":"object","properties":{"id":{"type":"string"},"invoiceId":{"type":"string"},"invoiceNumber":{"type":"string"},"amount":{"type":"string"},"currency":{"$ref":"#/components/schemas/BillingCurrency"},"paidOn":{"type":"string"},"method":{"type":"string","enum":["bank","card","credit_note","manual"]}},"required":["id","invoiceId","invoiceNumber","amount","currency","paidOn","method"]},"PopupAfter":{"type":"string","enum":["redirect","thanks","close"]},"PopupRepeat":{"type":"string","enum":["days","session","browser"]},"PopupSettings":{"type":"object","properties":{"trigger":{"$ref":"#/components/schemas/PopupTrigger"},"delaySeconds":{"type":"number","description":"delay: 1 to 600 seconds after the page is ready."},"scrollUnit":{"type":"string","enum":["percent","pixels"],"description":"scroll in % of the page (10 to 100) or in pixels from the top (1 to 20000, SmartEmailing)."},"scrollPercent":{"type":"number"},"scrollPixels":{"type":"number"},"repeat":{"allOf":[{"$ref":"#/components/schemas/PopupRepeat"}],"description":"session = after closing hidden for the browser session, never after a sign-up; browser = again in the next\nsession, a sign-up too; days = hidden for repeatDays (1 to 365) after closing."},"repeatDays":{"type":"number"},"after":{"allOf":[{"$ref":"#/components/schemas/PopupAfter"}],"description":"thanks = Děkovací okno (the thank-you message in the same dialog, closes itself after closeSeconds); close = Bez\nděkovací stránky (the dialog closes at once, \"Hotovo\" shows for 2 s); redirect needs successUrl (the whole page goes\nthere after the sign-up)."},"closeSeconds":{"type":"number","description":"Děkovací okno closes itself after 0 to 60 seconds, 0 = stays open until the visitor closes it."},"delayScope":{"type":"string","enum":["page","site"],"description":"site = the delay counts time on the whole e-shop across page views; page = each page starts again."},"mobile":{"type":"string","enum":["off","sheet"],"description":"sheet = a bottom sheet on phones and tablets; off = never there (SmartEmailing's recommended default)."},"side":{"type":"string","enum":["left","right"],"description":"Slide-in: the button at the bottom right or left."},"skipLoggedIn":{"type":"boolean","description":"Never for a signed-in Shoptet customer (dataLayer)."},"skipFromEmail":{"type":"boolean","description":"Never for visitors from a Poštárna e-mail (marker parameter emailParam or utm_source in emailSources), 365 days."},"emailParam":{"type":"string"},"emailSources":{"type":"array","items":{"type":"string"}},"skipAfterOrder":{"type":"boolean","description":"Never after an order (thank-you page address contains one of orderPatterns), 365 days."},"orderPatterns":{"type":"array","items":{"type":"string"}},"excludePatterns":{"type":"array","items":{"type":"string"},"description":"Never on addresses containing one of these (cart, checkout)."}},"required":["trigger","delaySeconds","scrollUnit","scrollPercent","scrollPixels","repeat","repeatDays","after","closeSeconds","delayScope","mobile","side","skipLoggedIn","skipFromEmail","emailParam","emailSources","skipAfterOrder","orderPatterns","excludePatterns"],"description":"Settings of a pop-up or slide-in form (core/form_popup.py)."},"PopupTrigger":{"type":"string","enum":["load","delay","scroll"]},"Preferences":{"type":"object","properties":{"locale":{"type":"string","enum":["cs","sk"]},"theme":{"type":"string","enum":["system","light","dark"]},"firstName":{"type":"string"},"lastName":{"type":"string"}}},"PriceList":{"type":"object","properties":{"tiers":{"type":"array","items":{"$ref":"#/components/schemas/PriceTier"}},"annualDiscountPct":{"type":"string"},"vatRate":{"type":"string"},"trialDays":{"type":"number"},"freeContacts":{"type":"number"},"freeEmailsMonth":{"type":"number"},"fairUseSends":{"type":"number"},"currencies":{"type":"array","items":{"$ref":"#/components/schemas/BillingCurrency"}}},"required":["tiers","annualDiscountPct","vatRate","trialDays","freeContacts","freeEmailsMonth","fairUseSends","currencies"]},"PriceTier":{"type":"object","properties":{"id":{"type":"string"},"maxContacts":{"type":"number"},"monthly":{"type":["string","null"],"description":"Net a month in the subscription's currency; null = individual price."},"monthlyCzk":{"type":["string","null"]},"monthlyEur":{"type":["string","null"]},"free":{"type":"boolean"},"active":{"type":"boolean"}},"required":["id","maxContacts","monthly","monthlyCzk","free","active"]},"ProductBoughtRule":{"type":"object","properties":{"type":{"type":"string","const":"product_bought"},"operator":{"type":"string","const":"is"},"value":{"type":"string"},"shopId":{"type":["string","null"]},"currency":{"type":["string","null"],"enum":["CZK","EUR",null]},"days":{"type":["string","null"]}},"required":["type","operator","value","shopId","currency","days"],"description":"SE \"Kontakt objednal produkt...\": a completed order item whose name contains the text or whose code equals it."},"Purpose":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"legalBasis":{"type":"string","enum":["consent","contract","legal_obligation","legitimate_interest","vital_interest","public_interest"]},"validityDays":{"type":["number","null"],"description":"How long a consent lasts in whole days; null = no fixed period."},"validity":{"anyOf":[{"$ref":"#/components/schemas/ValidityLength"},{"type":"null"}],"description":"The same length as entered (number and unit); null = no fixed period."},"notes":{"type":"string"},"consents":{"type":"number","description":"Active (not withdrawn) consents."},"createdAt":{"type":"string"}},"required":["id","name","legalBasis","validityDays","notes","consents","createdAt"]},"PurposeInput":{"type":"object","properties":{"name":{"type":"string"},"legalBasis":{"type":"string","enum":["consent","contract","legal_obligation","legitimate_interest","vital_interest","public_interest"]},"validityDays":{"type":["number","null"],"description":"Older callers send whole days; the purpose form sends validity."},"validity":{"anyOf":[{"$ref":"#/components/schemas/ValidityLength"},{"type":"null"}]},"notes":{"type":"string"}},"required":["name","legalBasis","notes"]},"PurposeRule":{"type":"object","properties":{"type":{"type":"string","const":"purpose"},"operator":{"type":"string","enum":["has","not_has"]},"purposeId":{"type":"string"}},"required":["type","operator","purposeId"],"description":"An active (not withdrawn, in its validity window) consent for the purpose."},"RegistrationInput":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"companyName":{"type":"string"},"webDomain":{"type":"string","description":"Address of the e-shop as typed (scheme, path and www are fine; the server normalizes it)."},"country":{"type":"string","enum":["CZ","SK"]},"acceptTerms":{"type":"boolean","description":"Must be true: the terms of service and the privacy policy were accepted."},"locale":{"type":"string","enum":["cs","sk"],"description":"Language of the code e-mail and of the new user (the UI language)."},"tariffMaxContacts":{"type":"number","description":"Výběr tarifu: the tier (its contact limit) meant after the trial; nothing is billed before an order."},"billingPeriod":{"type":"string","enum":["monthly","annual"]}},"required":["email","password","companyName","webDomain","country","acceptTerms"],"description":"POST /auth/register: a new company and its first account admin, created only after the code from the e-mail."},"RemoveMembersResult":{"type":"object","properties":{"removed":{"type":"number"}},"required":["removed"]},"ReportBaseline":{"type":"object","properties":{"sent":{"type":["number","null"]},"openRate":{"type":"number"},"ctr":{"type":"number"},"ctor":{"type":"number"},"complaintRate":{"type":"number"},"unsubscribeRate":{"type":"number"},"bounceRate":{"type":"number"},"deliveryRate":{"type":"number"},"orderRate":{"type":"number"}},"required":["sent","openRate","ctr","ctor","complaintRate","unsubscribeRate","bounceRate","deliveryRate","orderRate"],"description":"The account's e-mails of the 30 days before (trend \"oproti předchozím 30 dnům\"); sent = average one-time campaign."},"ReportDay":{"type":"object","properties":{"date":{"type":"string"},"opens":{"type":"number"},"clicks":{"type":"number"},"unsubscribed":{"type":"number"},"bounced":{"type":"number"}},"required":["date","opens","clicks","unsubscribed","bounced"]},"ReportMetrics":{"type":"object","properties":{"orders":{"type":"number"},"orderRate":{"type":"number"},"reopeners":{"type":"number","description":"E-mails opened more than once, and their share of the opened ones (SE \"Opakovaná otevření\")."},"reopenRate":{"type":"number"},"webVersionViews":{"type":"number","description":"SE's Online verze and Tisk (ST-04): views of the web version and prints, the e-mails with one, and their share\nof the opened e-mails."},"webVersionUnique":{"type":"number"},"webVersionRate":{"type":"number"},"printViews":{"type":"number"},"printUnique":{"type":"number"},"printRate":{"type":"number"},"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":["orders","orderRate","reopeners","reopenRate","webVersionViews","webVersionUnique","webVersionRate","printViews","printUnique","printRate","sent","delivered","undelivered","bounced","softBounced","opens","uniqueOpens","repeatedOpens","machineOpens","clicks","uniqueClicks","unsubscribed","complained","queued","failed","skipped","openRate","ctr","ctor","unsubscribeRate","bounceRate","complaintRate","deliveryRate"],"description":"Rates as SE computes them: openRate, unsubscribeRate and complaintRate over delivered, ctr and orderRate over sent."},"ReportRevenue":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"orders":{"type":"number"},"directOrders":{"type":"number"},"assistedOrders":{"type":"number"},"total":{"type":"string"},"direct":{"type":"string"},"assisted":{"type":"string"},"averageOrder":{"type":"string"},"directAverage":{"type":"string"},"assistedAverage":{"type":"string"},"eshopOrders":{"type":"number"},"eshopTotal":{"type":"string"},"share":{"type":"number"},"margin":{"type":["string","null"],"description":"SE's Marže and Průměrná marže without VAT (ST-03): from the purchase prices the e-shop sent with the order lines;\nnull when no order of the group has one. *MarginOrders = orders with a known margin."},"marginAverage":{"type":["string","null"]},"marginOrders":{"type":"number"},"directMargin":{"type":["string","null"]},"directMarginAverage":{"type":["string","null"]},"directMarginOrders":{"type":"number"},"assistedMargin":{"type":["string","null"]},"assistedMarginAverage":{"type":["string","null"]},"assistedMarginOrders":{"type":"number"}},"required":["currency","orders","directOrders","assistedOrders","total","direct","assisted","averageOrder","directAverage","assistedAverage","eshopOrders","eshopTotal","share"]},"RfmState":{"type":"object","properties":{"enabled":{"type":"boolean"},"requested":{"type":"boolean"},"requestedAt":{"type":["string","null"]}},"required":["enabled","requested","requestedAt"],"description":"RFM analysis (SE GET rfm-analysis/model): no model in Poštárna yet; whether the company asked for it."},"RunningAction":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["import_run","import_doi","export_run","feed_refresh","order_feed_refresh","se_discover","se_sync_suppressions","engagement_recompute","contacts_bulk","list_merge","list_delete"]},"status":{"type":"string","enum":["queued","running"]},"since":{"type":"string"}},"required":["id","kind","status","since"]},"ScriptTemplate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"content":{"type":"string"},"parses":{"type":"boolean","description":"The piece is a complete script by itself (half of a pair is allowed too)."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","content","parses","createdAt","updatedAt"],"description":"A script template (SmartEmailing \"Šablony skriptů\"): a reusable piece of template script."},"ScriptTemplateInput":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"SeConnection":{"type":"object","properties":{"login":{"type":"string"},"keyHint":{"type":"string","description":"First three characters of the key (the key itself is never returned)."},"accountId":{"type":["string","null"]},"verifiedAt":{"type":"string"},"lists":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SeListChoice"}},"options":{"type":"object","properties":{"purposes":{"type":"boolean"},"templates":{"type":"boolean"},"automations":{"type":"boolean"}}},"syncEnabled":{"type":"boolean","description":"Hourly sync of the parallel run."},"syncChangedAt":{"type":["string","null"]},"lastSyncAt":{"type":["string","null"]},"lastSync":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"syncStatus":{"type":"string","enum":["ok","failed","skipped","late"],"description":"ok, skipped (a switch run was queued or running), failed (syncProblem says why) or late (no sync for 3 hours)."},"syncProblem":{"type":"string","description":"credentials, unavailable, dataKey, error, migration_running or no_sync."},"syncProblemAt":{"type":["string","null"]}},"required":["login","keyHint","accountId","verifiedAt","lists","options","syncEnabled","syncChangedAt","lastSyncAt","lastSync"]},"SeContact":{"type":"object","description":"A contact in SmartEmailing's shape: times \"YYYY-MM-DD HH:MM:SS\" local, flags 0 / 1, gender M / F, language cs_CZ ...","properties":{"id":{"type":"integer"},"guid":{},"emailaddress":{"type":"string"},"name":{},"surname":{},"titlesbefore":{},"titlesafter":{},"salution":{},"company":{},"street":{},"town":{},"postalcode":{},"country":{},"cellphone":{},"phone":{},"language":{},"birthday":{},"nameday":{},"gender":{},"notes":{},"realname":{},"blacklisted":{"type":"integer"},"is_blacklisted":{},"hardbounced":{},"softbounced":{},"created":{},"updated":{},"created_at":{},"last_updated_at":{},"domain":{},"origin":{},"contactlists":{"type":"array","items":{"type":"object","properties":{"id":{},"contactlist_id":{},"contact_id":{},"status":{},"added":{},"updated":{}}}},"customfields":{"type":"array","description":"Only with expand=customfields.","items":{"type":"object"}},"customfields_url":{}}},"SeContactList":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"publicname":{},"sendername":{},"senderemail":{},"replyto":{},"signature":{},"notes":{},"category":{},"hidden":{},"created":{},"alertIn":{},"alertOut":{}}},"SeCustomField":{"type":"object","properties":{"id":{},"name":{},"type":{},"options_url":{},"customfield_options":{}}},"SeDiscovery":{"type":"object","properties":{"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"suggestedRole":{"type":"string","enum":["optin","member","unsub","skip"]},"suggestedShop":{"type":"string"},"role":{"type":["string","null"],"enum":["optin","member","unsub","skip",null]},"shop":{"type":["string","null"]},"confirmed":{"type":"number"},"unsubscribed":{"type":"number"},"unsubscribeList":{"type":"boolean"}},"required":["id","name","suggestedRole","suggestedShop","role","shop"]},"description":"confirmed and unsubscribed = contacts of the list; unsubscribeList = it holds unsubscribes only or its name says\nso: it is never skipped (its role is unsub)."},"customFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"]}},"purposes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"emails":{"type":"number"},"automations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"}},"required":["id","name","active"]}}},"required":["lists","customFields","purposes","emails","automations"]},"SeDiscoveryState":{"type":"object","properties":{"status":{"type":"string","enum":["","queued","running","done","failed"]},"read":{"type":["number","null"],"description":"Contacts read so far."},"failure":{"type":"string","description":"credentials, unavailable, dataKey or error."},"at":{"type":["string","null"]},"discovery":{"anyOf":[{"$ref":"#/components/schemas/SeDiscovery"},{"type":"null"}],"description":"The last finished discovery, null before the first one."}},"required":["status","read","failure","at","discovery"],"description":"The discovery runs in the worker (it reads every contact for the counts per list); the screen polls it."},"SeError":{"type":"object","properties":{"status":{"const":"error"},"meta":{"type":"array"},"message":{"type":"string"}},"required":["status","message"],"examples":[{"status":"error","meta":[],"message":"Authentication Failed"}]},"SeListChoice":{"type":"object","properties":{"role":{"type":"string","enum":["optin","member","unsub","skip"]},"shop":{"type":"string","description":"Shop code (cz, sk)."},"name":{"type":"string"}},"required":["role","shop","name"]},"SeMigration":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","finished","failed"]},"phase":{"type":"string","enum":["","contacts","purposes","templates","automations","fields","suppressions","apply","report"]},"progress":{"type":"object","properties":{"read":{"type":"number"},"planned":{"type":"number"},"applied":{"type":"number"}}},"plan":{"type":"object","properties":{"lists":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SeListChoice"}},"options":{"type":"object","properties":{"purposes":{"type":"boolean"},"templates":{"type":"boolean"},"automations":{"type":"boolean"}},"required":["purposes","templates","automations"]}}},"counts":{"type":"object","additionalProperties":{"type":"number"}},"report":{"anyOf":[{"$ref":"#/components/schemas/SeReport"},{"type":"null"}]},"failed":{"type":"boolean"},"stopped":{"type":"boolean","description":"The worker stopped before the run finished; starting it again resumes it."},"failure":{"type":"string","enum":["","unavailable","error","stopped","credentials","answer","dataKey","connection"],"description":"The kind of a failed run (SE_RUN_FAILURES), '' otherwise; never the technical text."},"createdAt":{"type":"string"},"startedAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]}},"required":["id","status","phase","progress","plan","counts","report","failed","createdAt","startedAt","finishedAt"]},"SePlan":{"type":"object","properties":{"lists":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SeListChoice"}},"options":{"type":"object","properties":{"purposes":{"type":"boolean"},"templates":{"type":"boolean"},"automations":{"type":"boolean"}},"required":["purposes","templates","automations"]}},"required":["lists","options"]},"SeProblem":{"type":"object","properties":{"code":{"type":"string","enum":["blacklistMissing","hardbounceMissing","unsubscribeMissing","listUnsubscribeMissing","suppressionMissing","duplicatesMerged","invalidWithOptOut","listUnsubscribeNotInPostarna","erased"]},"count":{"type":"number"},"blocking":{"type":"boolean","description":"true = Poštárna must not send yet (readyToSend false)."}},"required":["code","count","blocking"]},"SeReport":{"type":"object","properties":{"rows":{"type":"array","items":{"$ref":"#/components/schemas/SeReportRow"}},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["optin","member","unsub","skip"]},"seConfirmed":{"type":"number"},"seUnsubscribed":{"type":"number"},"postarnaConfirmed":{"type":["number","null"]},"postarnaUnsubscribed":{"type":["number","null"]}},"required":["id","name","role","seConfirmed","seUnsubscribed","postarnaConfirmed","postarnaUnsubscribed"]}},"skipped":{"type":"object","additionalProperties":{"type":"number"},"description":"Contacts not taken over and why (not_in_mapped_lists, invalid_address)."},"mapping":{"type":"object","additionalProperties":{"type":"number"}},"merged":{"type":"object","properties":{"duplicate_address":{"type":"number"}},"required":["duplicate_address"],"description":"SmartEmailing records merged into one contact because their addresses are the same."},"problems":{"type":"array","items":{"$ref":"#/components/schemas/SeProblem"}},"suppressionDiff":{"type":"object","properties":{"seOnly":{"type":"number"},"postarnaOnly":{"type":"number"}},"required":["seOnly","postarnaOnly"]},"readyToSend":{"type":"boolean","description":"Blacklist, hard bounces and unsubscribes of SmartEmailing are all in Poštárna: Poštárna may send."}},"required":["rows","lists","skipped","mapping","suppressionDiff","readyToSend"]},"SeReportRow":{"type":"object","properties":{"key":{"type":"string","enum":["unsubscribed","blacklisted","contacts","purposes","templates","automations","hardbounced","listUnsubscribes","customFields","consents"]},"se":{"type":"number"},"postarna":{"type":"number"},"created":{"type":"number"},"skipped":{"type":"number"},"archived":{"type":"number"},"imagesFailed":{"type":"number"},"failed":{"type":"number"}},"required":["key","se","postarna"],"description":"One line of the reconciliation: SmartEmailing against Poštárna (counts only)."},"SeState":{"type":"object","properties":{"connection":{"anyOf":[{"$ref":"#/components/schemas/SeConnection"},{"type":"null"}]},"migration":{"anyOf":[{"$ref":"#/components/schemas/SeMigration"},{"type":"null"}]}},"required":["connection","migration"]},"SeWebhook":{"type":"object","properties":{"id":{},"url":{},"method":{},"event":{"type":"string","enum":["new_contact","updated_contact","unsubscribed_contact","email_delivery_started","delivery_status","sent_email","email_open","email_click","scoring_result_changed","engagement_level_changed","sms_delivery_status"]},"active":{},"timeout":{},"last_response_code":{},"last_call_time":{},"errors_in_row":{},"basic_auth":{}}},"SearchResults":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/ContactListItem"}},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"number"}},"required":["id","name","size"]}}},"required":["contacts","lists"]},"SegmentDetail":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/SegmentGroup"},"signatureHtml":{"type":"string","description":"Advanced setting: owner's signature as HTML, sanitized like e-mail content."},"id":{"type":"string"},"name":{"type":"string"},"publicName":{"type":"string","description":"Advanced setting (se-spec 01 §3): name on the unsubscribe page when the segment is used as a sendable list."},"shopId":{"type":"string","description":"Segments belong to one shop; only contacts whose main shop it is are evaluated."},"refresh":{"type":"string","enum":["static","daily"]},"matched":{"type":"number","description":"Contacts of the shop that meet the conditions, any status."},"mailable":{"type":"number","description":"Of those: subscribed, not suppressed, without weak consent."},"computedAt":{"type":"string"},"ruleCount":{"type":"number"},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (Štítky); absent from older servers."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["definition","signatureHtml","id","name","publicName","shopId","refresh","matched","mailable","computedAt","ruleCount","createdAt","updatedAt"]},"SegmentField":{"type":"string","enum":["companyId","firstName","lastName","phone","country","street","city","language","note","email","company","mobile","postalCode","status","gender","source","consentBasis","createdAt","lastOpenAt","lastClickAt","lastSentAt","statusAt","consentAt"]},"SegmentGroup":{"type":"object","additionalProperties":false,"description":"A segment definition: AND (all) / OR (any) groups nested at most 8 levels, at most 50 rules. An empty root matches every contact of the shop (a saved segment needs at least one rule); an empty subgroup is an error. Errors: 400 validation \"definition.<path>.<field>\" (path = indices from the root).","properties":{"type":{"const":"group"},"match":{"type":"string","enum":["all","any"],"description":"all = AND, any = OR."},"rules":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/SegmentGroup"},{"$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"}]},"description":"Rules and subgroups."}},"required":["type","match","rules"],"examples":[{"type":"group","match":"any","rules":[{"type":"order_value","operator":"gte","amount":"2000","currency":"CZK","shopId":"1","days":"365"},{"type":"group","match":"all","rules":[{"type":"list","operator":"in","listId":"101"},{"type":"field","field":"lastOpenAt","operator":"in_last_days","value":"60"}]}]}]},"SegmentInput":{"type":"object","properties":{"name":{"type":"string"},"publicName":{"type":"string"},"shopId":{"type":"string"},"refresh":{"type":"string","enum":["static","daily"]},"definition":{"$ref":"#/components/schemas/SegmentGroup"},"signatureHtml":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (Štítky)."}},"required":["name","shopId","refresh","definition"]},"SegmentNode":{"anyOf":[{"$ref":"#/components/schemas/SegmentGroup"},{"$ref":"#/components/schemas/FieldRule"},{"$ref":"#/components/schemas/ListRule"},{"$ref":"#/components/schemas/OrderCountRule"},{"$ref":"#/components/schemas/OrderValueRule"},{"$ref":"#/components/schemas/LastOrderRule"},{"$ref":"#/components/schemas/EngagementRule"},{"$ref":"#/components/schemas/PurposeRule"},{"$ref":"#/components/schemas/CampaignRule"},{"$ref":"#/components/schemas/OrderAttributeRule"},{"$ref":"#/components/schemas/CustomFieldRule"},{"$ref":"#/components/schemas/SegmentRefRule"},{"$ref":"#/components/schemas/ListLabelRule"},{"$ref":"#/components/schemas/OpensRule"},{"$ref":"#/components/schemas/ProductBoughtRule"},{"$ref":"#/components/schemas/WebVisitRule"},{"$ref":"#/components/schemas/WebAttributeRule"}]},"SegmentPreview":{"type":"object","properties":{"matched":{"type":"number"},"mailable":{"type":"number"},"total":{"type":"number","description":"All contacts of the shop."}},"required":["matched","mailable","total"]},"SegmentRefRule":{"type":"object","properties":{"type":{"type":"string","const":"segment"},"operator":{"type":"string","enum":["in","not_in","added_before","added_after"]},"segmentId":{"type":"string"},"value":{"type":"string","description":"added_before / added_after: the date (YYYY-MM-DD) the contact entered the segment is compared with."}},"required":["type","operator","segmentId"],"description":"Another saved segment of the same tenant and the same shop (se-spec 01 §3 \"Kontakt je obsažen v seznamu nebo\nsegmentu...\"); never another shop's, even of the same tenant, and never one that would close a cycle or chain\ndeeper than SEGMENT_REF_MAX_DEPTH - the server refuses that save (400 definition.segmentCycle /\ndefinition.segmentDepth, no single rule to blame). Evaluated live, not any snapshot the referenced segment has."},"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"}]},"SegmentSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"publicName":{"type":"string","description":"Advanced setting (se-spec 01 §3): name on the unsubscribe page when the segment is used as a sendable list."},"shopId":{"type":"string","description":"Segments belong to one shop; only contacts whose main shop it is are evaluated."},"refresh":{"type":"string","enum":["static","daily"]},"matched":{"type":"number","description":"Contacts of the shop that meet the conditions, any status."},"mailable":{"type":"number","description":"Of those: subscribed, not suppressed, without weak consent."},"computedAt":{"type":"string"},"ruleCount":{"type":"number"},"tags":{"type":"array","items":{"type":"string"},"description":"Labels (Štítky); absent from older servers."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","publicName","shopId","refresh","matched","mailable","computedAt","ruleCount","createdAt","updatedAt"]},"SegmentToListResult":{"type":"object","properties":{"listId":{"type":"string"},"name":{"type":"string"},"members":{"type":"number"}},"required":["listId","name","members"],"description":"POST /segments/{id}/to-list: the new list and how many contacts it got."},"SendTiming":{"type":"string","enum":["now","schedule","later"]},"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"]},"SenderAuth":{"type":"object","properties":{"id":{"type":"string"},"shopId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"replyTo":{"type":"string"},"domain":{"type":"string"},"domainId":{"type":["string","null"]},"verified":{"type":"boolean"},"isDefault":{"type":"boolean"},"freemail":{"type":"boolean"},"spf":{"type":"string","enum":["ok","invalid","error","unknown","missing"]},"dkim":{"type":"string","enum":["ok","invalid","error","unknown","missing"]},"dmarc":{"type":"string","enum":["ok","invalid","error","unknown","missing"]},"usableAsSender":{"type":"boolean"}},"required":["id","shopId","name","email","replyTo","domain","domainId","verified","isDefault","freemail","spf","dkim","dmarc","usableAsSender"]},"SenderUsage":{"type":"object","properties":{"type":{"type":"string","enum":["campaign","automation","default"]},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["type","id","name","status"],"description":"One use of a sender (GET /sending/senders/{id}/usage). type default: the default sender of shop `id`."},"SendingDefaults":{"type":"object","properties":{"utmDefaultOn":{"type":"boolean"}},"required":["utmDefaultOn"],"description":"GET/PUT /tenants/{t}/sending-defaults (SE Výchozí nastavení, DO-07): utmDefaultOn = new drafts start with the\ntracking parameters utm_source newsletter and utm_medium email."},"SendingDomain":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"dkimSelectors":{"type":"array","items":{"type":"string"}},"spf":{"type":"object","properties":{"status":{"type":"string","enum":["ok","invalid","error","unknown","missing"]},"record":{"type":"string"}},"required":["status","record"]},"dkim":{"type":"object","properties":{"status":{"type":"string","enum":["ok","invalid","error","unknown","missing"]},"records":{"type":"object","additionalProperties":{"type":"object","properties":{"cname":{"type":"string"},"record":{"type":"string"}},"required":["cname","record"]}}},"required":["status","records"]},"dmarc":{"type":"object","properties":{"status":{"type":"string","enum":["ok","invalid","error","unknown","missing"]},"record":{"type":"string"}},"required":["status","record"]},"issues":{"type":"array","items":{"type":"string"},"description":"Codes, texts in the catalogs (deliverability.issue.<code>)."},"checkedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","domain","dkimSelectors","spf","dkim","dmarc","issues","checkedAt","createdAt"]},"SendingDomainInput":{"type":"object","properties":{"domain":{"type":"string"},"dkimSelectors":{"type":"array","items":{"type":"string"}}},"required":["domain"]},"SendingDomainList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SendingDomain"}},"suggestions":{"type":"array","items":{"type":"string"},"description":"Domains of sender addresses without a sending domain yet."}},"required":["items","suggestions"]},"SendingMode":{"type":"string","enum":["live","test","folder","off"]},"SendingModeInfo":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/SendingMode"},"testRecipients":{"type":"number","description":"How many addresses the tenant's test list has."},"sendingEnabled":{"type":"boolean","description":"The tenant's kill switch: off = no campaign goes out and no automation lets anybody in (tests still go out)."},"sendingState":{"type":"string","enum":["suspended","pending","live","paused"],"description":"The platform's approval (B4): anything but live keeps the tenant to test e-mails."},"sendingHold":{"type":"string","enum":["","free_limit","unpaid","platform"],"description":"Why a live tenant is held: the platform switch or billing (free tier used up, unpaid invoice)."}},"required":["mode","testRecipients"]},"SendingSetup":{"type":"object","properties":{"managed":{"type":"boolean","description":"The tenant sends through the platform account (Poštárna creates the identity)."},"platformReady":{"type":"boolean","description":"false = the platform still has to finish its part (no identity credential)."},"domains":{"type":"array","items":{"$ref":"#/components/schemas/SetupDomain"}},"suggestions":{"type":"array","items":{"type":"string"}},"shops":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"code":{"type":"string"}},"required":["id","displayName","code"]}},"senders":{"type":"array","items":{"$ref":"#/components/schemas/SetupSender"}},"advanced":{"type":"object","properties":{"region":{"type":"string"},"credentialsRef":{"type":"string"},"configurationSet":{"type":"string"},"identityCredential":{"type":"boolean"},"identityRegion":{"type":"string"}},"required":["region","credentialsRef","configurationSet","identityCredential","identityRegion"],"description":"Platform admins only."}},"required":["managed","platformReady","domains","suggestions","shops","senders"]},"SetupDnsRecord":{"type":"object","properties":{"kind":{"type":"string","enum":["dkim","spf","dmarc"]},"type":{"type":"string","enum":["CNAME","TXT"]},"host":{"type":"string","description":"Name without the domain (what most DNS hosts ask for); '@' = the domain itself."},"name":{"type":"string","description":"Full name."},"value":{"type":"string"},"required":{"type":"boolean"},"status":{"$ref":"#/components/schemas/SetupRecordStatus"}},"required":["kind","type","host","name","value","required","status"]},"SetupDomain":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"state":{"$ref":"#/components/schemas/SetupDomainState"},"records":{"type":"array","items":{"$ref":"#/components/schemas/SetupDnsRecord"}},"checkedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"advanced":{"type":"object","properties":{"managed":{"type":"boolean"},"sesStatus":{"type":"string"},"sesRegion":{"type":"string"},"dkimSelectors":{"type":"array","items":{"type":"string"}},"issues":{"type":"array","items":{"type":"string"}},"sesCheckedAt":{"type":["string","null"]}},"required":["managed","sesStatus","sesRegion","dkimSelectors","issues","sesCheckedAt"],"description":"Platform admins only."}},"required":["id","domain","state","records","checkedAt","createdAt"]},"SetupDomainState":{"type":"string","enum":["pending","failed","verified","setup"]},"SetupRecordStatus":{"type":"string","enum":["ok","unknown","missing"]},"SetupSender":{"type":"object","properties":{"id":{"type":"string"},"shopId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"replyTo":{"type":"string"},"isDefault":{"type":"boolean"},"verified":{"type":"boolean"},"domainVerified":{"type":"boolean"},"verifyMethod":{"type":"string","enum":["domain","email"],"description":"DO-03: domain = verified by the DKIM of its domain, email = confirmed (or waiting for) a confirmation e-mail."},"verificationSentAt":{"type":["string","null"],"description":"When the last confirmation e-mail went out; null = none could be sent."},"freemail":{"type":"boolean","description":"An address of a free mailbox service (its provider's DMARC fails for e-mails sent through Poštárna)."}},"required":["id","shopId","name","email","replyTo","isDefault","verified","domainVerified"]},"SetupSenderInput":{"type":"object","properties":{"shopId":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"replyTo":{"type":"string"},"isDefault":{"type":"boolean"}},"required":["shopId","email"]},"SetupSenderPatch":{"type":"object","properties":{"name":{"type":"string","description":"From name, at most 100 characters without < > { } \" and line breaks."},"replyTo":{"type":"string","description":"Address for replies, '' = replies go to the sender address."},"isDefault":{"type":"boolean","const":true}},"description":"Edit of an existing sender. The address itself never changes (it belongs to a verified domain; server 400\nvalidation email, reason read_only)."},"Shop":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string","description":"cz, sk (ShopSettings.code)"},"displayName":{"type":"string"},"domain":{"type":"string"},"currency":{"$ref":"#/components/schemas/Currency"},"language":{"$ref":"#/components/schemas/Lang"},"active":{"type":"boolean","description":"false = switched off in settings E-shopy (hidden from the switcher and pickers); absent = active."},"contactLanguage":{"type":"string","enum":["cs","sk"],"description":"SE's Výchozí jazyk kontaktu (UZ-02): the language of the shop's new contacts that come without one; until chosen\n(contactLanguageSet false) Czech for a .cz and Slovak for a .sk domain."},"contactLanguageSet":{"type":"boolean"}},"required":["id","code","displayName","domain","currency","language"]},"ShopBrand":{"type":"object","properties":{"logoUrl":{"type":"string"},"logoLink":{"type":"string","description":"Where the logo leads; defaults to the shop's web."},"logoWidth":{"type":["number","null"]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"textColor":{"type":"string"},"backgroundColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"type":"string"}},"required":["logoUrl","logoLink","logoWidth","primaryColor","secondaryColor","textColor","backgroundColor","fontFamily","headingFontFamily"],"description":"Brand identity of an e-shop (SmartEmailing \"Grafická identita\"): the Logo element and predefined sections use it."},"ShopConnector":{"type":"object","properties":{"host":{"type":"string"},"intervalS":{"type":"number","description":"Seconds between automatic runs; 0 = only by hand."}},"required":["host","intervalS"],"description":"The connector of orders and customers as the tenant sees it; the platform sets it (its key is the platform's)."},"ShopDetail":{"type":"object","properties":{"webDisplay":{"type":"string"},"platform":{"type":"string","enum":["shoptet","woocommerce","prestashop","upgates","custom"]},"senderName":{"type":"string"},"senderEmail":{"type":"string"},"linkDomain":{"type":"string","description":"Own domain of tracking and unsubscribe links; '' = the platform's."},"companyName":{"type":"string"},"companyId":{"type":"string"},"companyAddress":{"type":"string"},"active":{"type":"boolean","description":"false = switched off in settings E-shopy (hidden from the switcher and pickers); absent = active."},"disabledAt":{"type":["string","null"]},"createdAt":{"type":"string"},"connector":{"anyOf":[{"$ref":"#/components/schemas/ShopConnector"},{"type":"null"}]},"usage":{"$ref":"#/components/schemas/ShopUsage"},"locked":{"type":"boolean","description":"Language and currency are fixed once the shop has contacts, orders, feeds or a sent campaign."},"id":{"type":"string"},"code":{"type":"string","description":"cz, sk (ShopSettings.code)"},"displayName":{"type":"string"},"domain":{"type":"string"},"currency":{"$ref":"#/components/schemas/Currency"},"language":{"$ref":"#/components/schemas/Lang"},"contactLanguage":{"type":"string","enum":["cs","sk"],"description":"SE's Výchozí jazyk kontaktu (UZ-02): the language of the shop's new contacts that come without one; until chosen\n(contactLanguageSet false) Czech for a .cz and Slovak for a .sk domain."},"contactLanguageSet":{"type":"boolean"}},"required":["webDisplay","platform","senderName","senderEmail","linkDomain","companyName","companyId","companyAddress","active","disabledAt","createdAt","connector","usage","locked","id","code","displayName","domain","currency","language"]},"ShopEnrichReport":{"type":"object","properties":{"contacts":{"type":"number"},"matched":{"type":"number"},"contactsChanged":{"type":"number"},"fill":{"type":"object","additionalProperties":{"type":"number"},"description":"Source fields filled: first_name, last_name, phone, company, street, city, postal_code, country."},"language":{"type":"object","properties":{"cs":{"type":"number"},"sk":{"type":"number"}}},"derived":{"type":"object","additionalProperties":{"type":"number"},"description":"Derived fields: gender, name_day, vocative_first_name, vocative_last_name, salutation, salutation_formal."},"keptEdited":{"type":"object","additionalProperties":{"type":"number"},"description":"Empty fields left alone because a person edited them."},"automationReach":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"nameDay":{"type":"boolean"},"before":{"type":"number"},"after":{"type":"number"},"new":{"type":"number"},"newPerMonth":{"type":"object","additionalProperties":{"type":"number"}},"newNext30Days":{"type":"number"}},"required":["id","name","nameDay","before","after","new","newPerMonth","newNext30Days"]}},"ongoingBefore":{"type":"boolean"},"ongoing":{"type":"boolean"},"applied":{"type":"boolean"},"written":{"type":"number"}},"required":["contacts","matched","contactsChanged","fill","language","derived","keptEdited","ongoingBefore","ongoing","applied"],"description":"Contact data from the e-shop (core/shop_enrich.py): what a preview or a fill changes, counts only."},"ShopInput":{"type":"object","properties":{"code":{"type":"string"},"displayName":{"type":"string"},"domain":{"type":"string"},"webDisplay":{"type":"string"},"language":{"$ref":"#/components/schemas/Lang"},"currency":{"$ref":"#/components/schemas/Currency"},"platform":{"type":"string","enum":["shoptet","woocommerce","prestashop","upgates","custom"]},"senderName":{"type":"string"},"senderEmail":{"type":"string"},"linkDomain":{"type":"string"},"companyName":{"type":"string"},"companyId":{"type":"string"},"companyAddress":{"type":"string"}},"required":["code","displayName","domain","language","currency","companyName"],"description":"POST /tenants/{t}/shops (code, displayName, domain, language, currency, companyName required) and PATCH (code fixed)."},"ShopSettings":{"type":"object","properties":{"shopId":{"type":"string"},"code":{"type":"string"},"displayName":{"type":"string"},"language":{"$ref":"#/components/schemas/Lang"},"companyName":{"type":"string"},"companyId":{"type":"string"},"companyAddress":{"type":"string"}},"required":["shopId","code","displayName","language","companyName","companyId","companyAddress"],"description":"The sender company of one e-shop (settings Firma, GET /tenants/{t}/shop-settings): every campaign and automation\ne-mail names it in the standard footer, the public pages and forms in theirs. companyId (IČO) and companyAddress\n(registered office) are shown only when filled ('' = not filled)."},"ShopUsage":{"type":"object","properties":{"contacts":{"type":"number"},"lists":{"type":"number"},"segments":{"type":"number"},"campaigns":{"type":"number"},"automationsActive":{"type":"number"},"feeds":{"type":"number"},"orders":{"type":"number"}},"required":["contacts","lists","segments","campaigns","automationsActive","feeds","orders"],"description":"What a shop has (GET /tenants/{t}/shops/{id})."},"SiteScriptCheck":{"type":"object","properties":{"result":{"type":"string","enum":["found","not_found","unreachable"]},"url":{"type":["string","null"]},"state":{"type":"string","enum":["live","quiet","waiting"]},"seenAt":{"type":["string","null"]}},"required":["result","url","state","seenAt"],"description":"The Test button (POST /tenants/{t}/site-script/{shop}/check): found = the line is on the homepage."},"SiteScriptShop":{"type":"object","properties":{"shopId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"webDisplay":{"type":"string"},"platform":{"type":"string","enum":["shoptet","woocommerce","prestashop","upgates","custom"]},"scriptUrl":{"type":"string","description":"The postarna.js address of the one line."},"snippet":{"type":"string","description":"The whole line for the shop's footer."},"state":{"type":"string","enum":["live","quiet","waiting"],"description":"live = the script reported within 3 days, quiet = earlier, waiting = never."},"seenAt":{"type":["string","null"]},"seenHost":{"type":"string"},"checkoutConsent":{"type":"boolean","description":"The script also reads the newsletter box of the checkout and the registration."},"popups":{"type":"number","description":"Active pop-up and slide-in forms the script shows; active classic forms it can place."},"embeds":{"type":"number"},"signups":{"type":"object","properties":{"pending":{"type":"number"},"subscribed":{"type":"number"},"skipped":{"type":"number"},"expired":{"type":"number"}},"required":["pending","subscribed","skipped","expired"],"description":"Checkout newsletter boxes of the last 30 days by state."}},"required":["shopId","code","name","domain","webDisplay","platform","scriptUrl","snippet","state","seenAt","seenHost","checkoutConsent","popups","embeds","signups"]},"SmsTemplate":{"type":"object","properties":{"id":{"type":"string"},"length":{"type":"number","description":"The counter of the server (screens/sms/smsModel.ts gives the same)."},"parts":{"type":"number"},"capacity":{"type":"number"},"encoding":{"type":"string","enum":["gsm","ucs2"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"body":{"type":"string"},"stripDiacritics":{"type":"boolean","description":"Odeslat bez diakritiky: the text goes without accents (GSM 7-bit)."}},"required":["id","length","parts","capacity","encoding","createdAt","updatedAt","name","body","stripDiacritics"]},"SmsTemplateInput":{"type":"object","properties":{"name":{"type":"string"},"body":{"type":"string"},"stripDiacritics":{"type":"boolean","description":"Odeslat bez diakritiky: the text goes without accents (GSM 7-bit)."}},"required":["name","body","stripDiacritics"]},"SpamCheck":{"type":"object","properties":{"score":{"type":"number"},"verdict":{"type":"string","enum":["ok","spam","blocked"]},"sizeKb":{"type":"number"},"rules":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"points":{"type":"number"},"found":{"type":"array","items":{"type":"string"}}},"required":["code","points"]},"description":"found = what the rule found in the content (phrases, hosts, domains, HTML tags), at most 5."}},"required":["score","verdict","sizeKb","rules"],"description":"POST /content/spam-check: Poštárna's own antispam rules (SmartEmailing's \"Antispamová kontrola: X / 5\")."},"StackCoupon":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"$ref":"#/components/schemas/CouponStatus"},"assignedAt":{"type":["string","null"]},"usedAt":{"type":["string","null"]},"contact":{"type":["object","null"],"properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"],"description":"null after the contact was erased."},"email":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["campaign","automation"]},"campaignId":{"type":["string","null"]},"automationId":{"type":["string","null"]},"nodeKey":{"type":["string","null"]}},"required":["kind","campaignId","automationId","nodeKey"],"description":"The e-mail the code went out with; null = handed out by hand, or before every e-mail took its own code."}},"required":["id","code","status","assignedAt","usedAt","contact","email"],"description":"A code of a stack handed out (PZ-05, GET /coupon-stacks/{id}/coupons): to whom and with which e-mail."},"StatsActivity":{"type":"object","properties":{"sendId":{"type":"string"},"contactId":{"type":["string","null"]},"email":{"type":"string"},"firstAt":{"type":"string"},"lastAt":{"type":"string"},"opens":{"type":"number"},"clicks":{"type":"number"},"type":{"$ref":"#/components/schemas/StatsActivityType"},"source":{"type":"string"},"links":{"type":"array","items":{"type":"string"}},"detail":{"type":"string"}},"required":["sendId","contactId","email","firstAt","lastAt","opens","clicks","type","source","links","detail"]},"StatsActivityType":{"type":"string","enum":["complaint","unsubscribe","open","click","hard","soft"]},"StatsDay":{"type":"object","properties":{"date":{"type":"string"},"opens":{"type":"number"},"clicks":{"type":"number"},"unsubscribed":{"type":"number"}},"required":["date","opens","clicks","unsubscribed"]},"StockPhoto":{"type":"object","properties":{"id":{"type":"string"},"pageUrl":{"type":"string"},"tags":{"type":"string"},"type":{"type":"string"},"previewUrl":{"type":"string"},"previewWidth":{"type":"number"},"previewHeight":{"type":"number"},"webformatUrl":{"type":"string"},"webformatWidth":{"type":"number"},"webformatHeight":{"type":"number"},"largeImageUrl":{"type":"string"},"imageWidth":{"type":"number"},"imageHeight":{"type":"number"},"views":{"type":"number"},"downloads":{"type":"number"},"likes":{"type":"number"},"user":{"type":"string"},"userUrl":{"type":"string"}},"required":["id","pageUrl","tags","type","previewUrl","previewWidth","previewHeight","webformatUrl","webformatWidth","webformatHeight","largeImageUrl","imageWidth","imageHeight","views","downloads","likes","user","userUrl"]},"StockPhotoSaved":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/StoredFile"},"photo":{"type":"object","properties":{"id":{"type":"string"},"pageUrl":{"type":"string"},"user":{"type":"string"},"userUrl":{"type":"string"},"tags":{"type":"string"}},"required":["id","pageUrl","user","userUrl","tags"]},"existing":{"type":"boolean"}},"required":["file","photo","existing"]},"StockResult":{"type":"object","properties":{"total":{"type":"number"},"totalHits":{"type":"number"},"page":{"type":"number"},"perPage":{"type":"number"},"hits":{"type":"array","items":{"$ref":"#/components/schemas/StockPhoto"}},"source":{"type":"string"},"sourceUrl":{"type":"string"}},"required":["total","totalHits","page","perPage","hits","source","sourceUrl"]},"StockStatus":{"type":"object","properties":{"configured":{"type":"boolean"},"source":{"type":"string"},"sourceUrl":{"type":"string"}},"required":["configured","source","sourceUrl"],"description":"Fotobanka of the image library (Pixabay through Poštárna's server, one platform key)."},"StoredFile":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"folderId":{"type":["string","null"]},"contentType":{"type":"string"},"size":{"type":"number"},"width":{"type":["number","null"],"description":"Pictures only."},"height":{"type":["number","null"]},"url":{"type":"string","description":"Stable public address on the link domain: renaming or moving the file keeps it."},"createdAt":{"type":"string"},"pickedAt":{"type":["string","null"],"description":"Last time the editor chose it (Zvolit obrázek); null = never."},"source":{"anyOf":[{"$ref":"#/components/schemas/FileSource"},{"type":"null"}],"description":"Where a picture of the photo bank comes from (Pixabay, its page and author); null for own files."}},"required":["id","name","folderId","contentType","size","width","height","url","createdAt"]},"StoredFileDetail":{"type":"object","properties":{"usage":{"type":"object","properties":{"templates":{"type":"number"},"campaigns":{"type":"number"}},"required":["templates","campaigns"],"description":"Templates and draft campaigns whose content names the address (shown before a delete)."},"id":{"type":"string"},"name":{"type":"string"},"folderId":{"type":["string","null"]},"contentType":{"type":"string"},"size":{"type":"number"},"width":{"type":["number","null"],"description":"Pictures only."},"height":{"type":["number","null"]},"url":{"type":"string","description":"Stable public address on the link domain: renaming or moving the file keeps it."},"createdAt":{"type":"string"},"pickedAt":{"type":["string","null"],"description":"Last time the editor chose it (Zvolit obrázek); null = never."},"source":{"anyOf":[{"$ref":"#/components/schemas/FileSource"},{"type":"null"}],"description":"Where a picture of the photo bank comes from (Pixabay, its page and author); null for own files."}},"required":["usage","id","name","folderId","contentType","size","width","height","url","createdAt"]},"Subscription":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/SubscriptionState"},"inTrial":{"type":"boolean"},"trialEndsAt":{"type":["string","null"]},"trialDaysLeft":{"type":"number"},"period":{"$ref":"#/components/schemas/BillingPeriod"},"currency":{"$ref":"#/components/schemas/BillingCurrency"},"tier":{"anyOf":[{"$ref":"#/components/schemas/PriceTier"},{"type":"null"}]},"manual":{"type":"boolean"},"customMonthly":{"type":["string","null"]},"monthly":{"type":["string","null"]},"periodNet":{"type":["string","null"]},"annualMonthly":{"type":["string","null"]},"annualSaving":{"type":["string","null"]},"annualDiscountPct":{"type":"string"},"vatRate":{"type":"string"},"contacts":{"type":"number"},"limit":{"type":["number","null"]},"overBy":{"type":"number"},"contactsChange30d":{"type":["number","null"]},"sentMonth":{"type":"number"},"free":{"type":"boolean"},"freeEmailsMonth":{"type":["number","null"]},"fairUseLimit":{"type":"number"},"fairUseSends":{"type":"number"},"nextInvoiceOn":{"type":["string","null"],"description":"Day the next invoice is issued: at once for the first one, the 2nd of the month for a renewal."},"nextPeriodOn":{"type":["string","null"],"description":"First day of the next (or the waiting) period: a planned lower tier and the renewal apply from it."},"daysToInvoice":{"type":["number","null"]},"periodStart":{"type":["string","null"]},"periodEnd":{"type":["string","null"]},"cancelAt":{"type":["string","null"]},"billingBlock":{"$ref":"#/components/schemas/BillingBlock"},"billingExempt":{"type":"boolean"},"sendingState":{"type":"string"},"paymentMethod":{"type":"string","enum":["bank","card"]},"overageTotal":{"type":["string","null"]},"overageDays":{"type":"number"},"currentSpend":{"type":["string","null"]},"unpaidInvoices":{"type":"number"},"overdueInvoices":{"type":"number"},"ordered":{"type":"boolean","description":"A paid tier is ordered (in the trial: it starts when the trial ends)."},"dueDays":{"type":"number"},"firstInvoice":{"anyOf":[{"$ref":"#/components/schemas/BillingSlice"},{"type":"null"}],"description":"A tier ordered in the trial: its first invoice on the day the trial ends, for the rest of that month (pro rata)."},"nextTier":{"anyOf":[{"$ref":"#/components/schemas/PriceTier"},{"type":"null"}],"description":"Snížit tarif: the lower tier planned from the next period (null = none)."},"nextBilling":{"type":["object","null"],"properties":{"on":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"},"net":{"type":"string"},"overage":{"type":"string"},"tier":{"anyOf":[{"$ref":"#/components/schemas/PriceTier"},{"type":"null"}]}},"required":["on","start","end","net","overage","tier"],"description":"The next invoice of a running subscription: the tier (the planned lower one) and the overage of a monthly one."},"overageFrom":{"type":["string","null"],"description":"First day of the overage not billed yet (null outside a paid period)."},"overage":{"type":"array","items":{"$ref":"#/components/schemas/OverageDay"},"description":"Days over the tier since overageFrom (SE Příloha k faktuře), billed with the next invoice."}},"required":["state","inTrial","trialEndsAt","trialDaysLeft","period","currency","tier","manual","customMonthly","monthly","periodNet","annualMonthly","annualSaving","annualDiscountPct","vatRate","contacts","limit","overBy","contactsChange30d","sentMonth","free","freeEmailsMonth","fairUseLimit","fairUseSends","nextInvoiceOn","nextPeriodOn","daysToInvoice","periodStart","periodEnd","cancelAt","billingBlock","billingExempt","sendingState","paymentMethod","overageTotal","overageDays","currentSpend","unpaidInvoices","overdueInvoices","ordered","dueDays","firstInvoice","nextTier","nextBilling","overageFrom","overage"]},"SubscriptionState":{"type":"string","enum":["trial","active","past_due","suspended","cancelled","expired"]},"Survey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean","description":"An inactive survey answers 404."},"url":{"type":"string","description":"Anonymous public page."},"linkTag":{"type":"string","description":"{{surveylink_<id>}}: each recipient's own link in an e-mail."},"questions":{"type":"number"},"responses":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"title":{"type":"string"},"intro":{"type":"string"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/SurveyPage"}},"thanksHtml":{"type":"string"},"afterUrl":{"type":"string","description":"Address after the last page instead of the thank-you text."},"oneResponse":{"type":"boolean","description":"One contact answers once (the recipient's link)."}},"required":["id","name","active","url","linkTag","questions","createdAt","updatedAt","title","intro","pages","thanksHtml","afterUrl","oneResponse"]},"SurveyPage":{"type":"object","properties":{"questions":{"type":"array","items":{"$ref":"#/components/schemas/SurveyQuestion"}}},"required":["questions"]},"SurveyQuestion":{"type":"object","properties":{"id":{"type":"string","description":"'q' + digits, stable: the answers are kept under it."},"type":{"type":"string","enum":["number","date","short_text","long_text","single","multiple","dropdown","scale","stars"]},"label":{"type":"string"},"help":{"type":"string"},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"},"description":"single, multiple, dropdown."},"min":{"type":["number","null"],"description":"scale (0 or 1 to 3..10), stars (1 to 5), number (optional range)."},"max":{"type":["number","null"]},"minLabel":{"type":"string"},"maxLabel":{"type":"string"}},"required":["id","type","label","help","required"]},"SurveyResponse":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":["string","null"]},"email":{"type":"string"},"answers":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]}},"submittedAt":{"type":"string"}},"required":["id","contactId","email","answers","submittedAt"]},"SurveyResults":{"type":"object","properties":{"total":{"type":"number"},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["number","date","short_text","long_text","single","multiple","dropdown","scale","stars"]},"label":{"type":"string"},"answered":{"type":"number"},"options":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"count":{"type":"number"}},"required":["option","count"]}},"average":{"type":["number","null"]},"texts":{"type":"array","items":{"type":"string"}}},"required":["id","type","label","answered"]}}},"required":["total","questions"]},"SurveySummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"url":{"type":"string","description":"Anonymous public page."},"linkTag":{"type":"string","description":"{{surveylink_<id>}}: each recipient's own link in an e-mail."},"questions":{"type":"number"},"responses":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","active","url","linkTag","questions","createdAt","updatedAt"]},"TariffOrder":{"type":"object","properties":{"tierId":{"type":"string"},"period":{"$ref":"#/components/schemas/BillingPeriod"},"currency":{"$ref":"#/components/schemas/BillingCurrency"},"acceptTerms":{"type":"boolean"},"legal":{"type":"object","additionalProperties":{"type":"string"}}},"required":["tierId","period","currency","acceptTerms"],"description":"An order of a paid tariff (Objednávka): the consent with the terms, the claims policy and the processing agreement is\nrequired (400 acceptTerms otherwise); legal = the versions the order step showed, recorded by the server."},"TemplateActiveUses":{"type":"object","properties":{"automations":{"type":"number"},"emails":{"type":"number"},"campaigns":{"type":"number"}},"required":["automations","emails","campaigns"],"description":"SE \"Kryjeme vám záda\": active automations (and their e-mails) sending the template, running campaigns made of it."},"TemplateCheck":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string","enum":["subject_missing","subject_too_long","content_empty","unknown_tag","foreign_tag","script_tag","script_error","unsupported_filter","bad_fallback","emoji","forbidden_word","image_placeholder","image_data_uri","banned_host","html_too_large","no_unsubscribe","footer_incomplete","subject_long","img_without_alt","insecure_image","image_too_large","image_foreign_host","text_image_ratio"]}},"warnings":{"type":"array","items":{"type":"string","enum":["subject_missing","subject_too_long","content_empty","unknown_tag","foreign_tag","script_tag","script_error","unsupported_filter","bad_fallback","emoji","forbidden_word","image_placeholder","image_data_uri","banned_host","html_too_large","no_unsubscribe","footer_incomplete","subject_long","img_without_alt","insecure_image","image_too_large","image_foreign_host","text_image_ratio"]}},"checkedAt":{"type":["string","null"]}},"required":["errors","warnings","checkedAt"],"description":"Result of the content check stored with every save (server rules with the tenant's)."},"TemplateDetail":{"type":"object","properties":{"content":{"allOf":[{"$ref":"#/components/schemas/EmailContent"}],"description":"What the editor opens: the draft of a template in use, else the published content."},"settings":{"$ref":"#/components/schemas/TemplateSettings"},"draft":{"type":"object","properties":{"pending":{"type":"boolean"},"savedAt":{"type":["string","null"]},"publishedAt":{"type":["string","null"]}},"required":["pending","savedAt","publishedAt"],"description":"A template that active automations send keeps its published content; the editor saves a draft until it is\npublished with the password (POST /templates/{id}/publish) or thrown away (DELETE /templates/{id}/draft)."},"activeUses":{"$ref":"#/components/schemas/TemplateActiveUses"},"publicUrl":{"type":"string","description":"Veřejný náhled: a public page with the content (merge tags unfilled)."},"id":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"editor":{"type":"string","enum":["visual","html"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"size":{"type":"number","description":"Size of the HTML in bytes (Gmail clips messages over 102 kB)."},"archived":{"type":"boolean","description":"Archived templates are not offered for new campaigns; they can be duplicated or restored."},"archivedAt":{"type":["string","null"]},"readOnly":{"type":"boolean","description":"Archive copy of an imported SmartEmailing original: content, name and tags never change, no delete or restore."},"usage":{"type":"object","properties":{"campaigns":{"type":"number"},"automations":{"type":"number"}},"required":["campaigns","automations"],"description":"Campaigns made from the template and e-mail nodes of automations naming it."},"lastUsedAt":{"type":["string","null"],"description":"Newest such campaign or automation e-mail."},"check":{"$ref":"#/components/schemas/TemplateCheck"}},"required":["content","settings","draft","activeUses","publicUrl","id","name","subject","preheader","editor","createdAt","updatedAt","tags","size","archived","archivedAt","readOnly","usage","lastUsedAt","check"]},"TemplateInput":{"type":"object","properties":{"name":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"content":{"type":"object","properties":{"html":{"type":"string"},"editor":{"type":"string","enum":["visual","html"]},"design":{"anyOf":[{"$ref":"#/components/schemas/EmailDesign"},{"type":"null"}]},"saveKind":{"type":"string","enum":["manual","auto","restore"],"description":"History entry kind: auto (autosave, journaled), manual (Uložit), restore (a version taken back). Default auto."}},"required":["html","editor","design"],"description":"A copy of a design: a starter, a campaign or another template."}},"required":["name","subject","preheader","content"]},"TemplatePatch":{"type":"object","properties":{"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"preheader":{"type":"string"},"linkParams":{"type":"array","items":{"$ref":"#/components/schemas/CampaignLinkParam"},"description":"Google Analytics parameters added to links of the e-shop (as a campaign's linkParams)."},"headers":{"type":"array","items":{"$ref":"#/components/schemas/CampaignHeader"},"description":"Own e-mail headers (X-...)."},"unsubscribePageId":{"type":["string","null"],"description":"Null = the default unsubscribe page."},"footerId":{"type":["string","null"],"description":"Null = the default footer of the editor."}},"description":"PATCH /templates/{id}: name, subject, preheader, tags and the e-mail settings (any of them)."},"TemplatePublishInput":{"anyOf":[{"type":"object","properties":{"password":{"type":"string"}},"required":["password"]},{"type":"object","properties":{"confirm":{"type":"string"}},"required":["confirm"]}]},"TemplateSettings":{"type":"object","properties":{"linkParams":{"type":"array","items":{"$ref":"#/components/schemas/CampaignLinkParam"},"description":"Google Analytics parameters added to links of the e-shop (as a campaign's linkParams)."},"headers":{"type":"array","items":{"$ref":"#/components/schemas/CampaignHeader"},"description":"Own e-mail headers (X-...)."},"unsubscribePageId":{"type":["string","null"],"description":"Null = the default unsubscribe page."},"footerId":{"type":["string","null"],"description":"Null = the default footer of the editor."}},"required":["linkParams","headers","unsubscribePageId","footerId"],"description":"Nastavení e-mailu of a template (migration 0231): Data a statistiky, the unsubscribe page and the footer."},"TemplateSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"editor":{"type":"string","enum":["visual","html"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"size":{"type":"number","description":"Size of the HTML in bytes (Gmail clips messages over 102 kB)."},"archived":{"type":"boolean","description":"Archived templates are not offered for new campaigns; they can be duplicated or restored."},"archivedAt":{"type":["string","null"]},"readOnly":{"type":"boolean","description":"Archive copy of an imported SmartEmailing original: content, name and tags never change, no delete or restore."},"usage":{"type":"object","properties":{"campaigns":{"type":"number"},"automations":{"type":"number"}},"required":["campaigns","automations"],"description":"Campaigns made from the template and e-mail nodes of automations naming it."},"lastUsedAt":{"type":["string","null"],"description":"Newest such campaign or automation e-mail."},"check":{"$ref":"#/components/schemas/TemplateCheck"}},"required":["id","name","subject","preheader","editor","createdAt","updatedAt","tags","size","archived","archivedAt","readOnly","usage","lastUsedAt","check"]},"Tenant":{"type":"object","properties":{"id":{"type":"string","description":"Opaque id (tenants.public_id, UUID)."},"slug":{"type":"string"},"name":{"type":"string"},"locale":{"$ref":"#/components/schemas/Lang"}},"required":["id","slug","name","locale"]},"TestSendResult":{"type":"object","properties":{"to":{"type":"string"},"sentAt":{"type":"string"}},"required":["to","sentAt"]},"ThemePref":{"type":"string","enum":["system","light","dark"]},"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"}]},"TotpSetup":{"type":"object","properties":{"secret":{"type":"string"},"uri":{"type":"string"},"qrSvg":{"type":"string","description":"SVG of the QR code of `uri` (scan it in the app)."}},"required":["secret","uri"],"description":"Start of the authenticator setup: the secret (typed into the app) and its otpauth link."},"UnsubscribePage":{"type":"object","properties":{"id":{"type":"string"},"isDefault":{"type":"boolean","description":"Serves every unsubscribe link of the tenant (Poštárna; without one the standard page)."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean","description":"Active pages may be the default; an active page cannot be deleted."},"mode":{"type":"string","enum":["page","redirect"],"description":"page = Zobrazit odhlašovací stránku; redirect = skip it, unsubscribe and go to redirectUrl."},"redirectUrl":{"type":"string"},"logoUrl":{"type":"string"},"videoUrl":{"type":"string","description":"YouTube only."},"language":{"type":"string","enum":["cs","sk","auto","en","pl","de","hu","it","ro","uk"]},"customHtml":{"type":"string"},"questionEnabled":{"type":"boolean"},"question":{"type":"string"},"answers":{"type":"array","items":{"type":"string"}},"afterUrl":{"type":"string","description":"Přesměrování po odhlášení ('' = the thank-you page); merge tags of the contact allowed."}},"required":["id","isDefault","createdAt","updatedAt","name","active","mode","redirectUrl","logoUrl","videoUrl","language","customHtml","questionEnabled","question","answers","afterUrl"]},"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"locale":{"$ref":"#/components/schemas/Lang"},"theme":{"$ref":"#/components/schemas/ThemePref"},"totpEnabled":{"type":"boolean"}},"required":["id","email","firstName","lastName","locale","theme","totpEnabled"]},"UserActivity":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"type":{"type":["string","null"]},"operation":{"type":["string","null"]},"login":{"type":"string"},"system":{"type":"boolean"},"at":{"type":"string"}},"required":["id","action","type","operation","login","system","at"],"description":"One row of SE Aktivity uživatelů (the audit log)."},"ValidityLength":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["seconds","minutes","hours","days","weeks","months","years"]}},"required":["value","unit"],"description":"Length of a purpose's validity as entered (months count 30 days and years 365 for the consent ends)."},"VariantApproveInput":{"type":"object","properties":{"sendAt":{"type":["string","null"],"description":"null = now."},"expectedRecipients":{"type":"object","additionalProperties":{"type":"number"},"description":"The final number per variant id the user confirmed."}},"required":["sendAt","expectedRecipients"]},"VariantPreview":{"type":"object","properties":{"variants":{"type":"array","items":{"$ref":"#/components/schemas/VariantPreviewItem"}},"total":{"type":"number"}},"required":["variants","total"]},"VariantPreviewItem":{"type":"object","properties":{"campaignId":{"type":"string"},"label":{"type":"string"},"shopId":{"type":"string"},"takenByEarlier":{"type":"number"},"final":{"type":"number"},"matched":{"type":"number","description":"Unique contacts in the chosen lists and segments."},"recipients":{"type":"number","description":"Who would receive the campaign now."},"excluded":{"type":"object","properties":{"unconfirmed":{"type":"number"},"not_mailable":{"type":"number"},"weak_consent":{"type":"number"},"exception_expired":{"type":"number"},"no_purpose":{"type":"number"},"excluded_list":{"type":"number"},"excluded_manual":{"type":"number"},"inactive":{"type":"number"}},"required":["unconfirmed","not_mailable","weak_consent","exception_expired","no_purpose","excluded_list","excluded_manual","inactive"]}},"required":["campaignId","label","shopId","takenByEarlier","final","matched","recipients","excluded"],"description":"Counts of one variant before sending: its own audience, the recipients an earlier variant takes, the final number."},"VariantStats":{"type":"object","properties":{"variants":{"type":"array","items":{"type":"object","properties":{"campaignId":{"type":"string"},"label":{"type":"string"},"shopId":{"type":"string"},"stats":{"anyOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}]}},"required":["campaignId","label","shopId","stats"]}},"total":{"anyOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}],"description":"Sums over the variants (a contact gets one variant, so these are unique contacts); null before sending."}},"required":["variants","total"]},"VatCheck":{"type":"object","properties":{"required":{"type":"boolean","description":"An EU company outside CZ that says it is a VAT payer: only then is the VAT ID checked."},"state":{"$ref":"#/components/schemas/VatCheckState"},"vatId":{"type":"string"},"checkedAt":{"type":["string","null"]},"name":{"type":"string","description":"Name and address as VIES returned them; requestIdentifier = the consultation number (evidence)."},"address":{"type":"string"},"requestIdentifier":{"type":"string"},"error":{"type":"string"},"lastValidAt":{"type":["string","null"]},"fallbackUntil":{"type":["string","null"],"description":"Until when an unavailable VIES still allows reverse charge (last valid check + 30 days)."},"reverseCharge":{"type":"boolean"}},"required":["required","state","vatId","checkedAt","name","address","requestIdentifier","error","lastValidAt","fallbackUntil","reverseCharge"]},"VatCheckState":{"type":"string","enum":["not_needed","unchecked","valid","invalid","unavailable"]},"VideoThumbnail":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/StoredFile"},"provider":{"type":"string","enum":["youtube","vimeo"]},"videoId":{"type":"string"},"videoUrl":{"type":"string"},"title":{"type":"string"}},"required":["file","provider","videoId","videoUrl","title"],"description":"POST .../files/video-thumbnail: the preview picture of a YouTube or Vimeo video, kept in the file manager."},"WebAttributeRule":{"type":"object","properties":{"type":{"type":"string","const":"web_attribute"},"attribute":{"type":"string"},"operator":{"type":"string","enum":["starts_with","is","gte","lte","gt","lt"]},"value":{"type":"string"},"days":{"type":["string","null"]}},"required":["type","attribute","operator","value","days"],"description":"SE \"Kontakt navštívil stránku, kde atribut Y je Z\": visitType = page type, other names = the visit's attributes."},"WebTrackingEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["custom","visit","identification","cart"]},"data":{"type":"object","additionalProperties":{}},"at":{"type":"string"},"shopId":{"type":["string","null"]},"source":{"type":"string"},"contactId":{"type":"string"},"email":{"type":"string"}},"required":["id","type","data","at","shopId","source","contactId","email"],"description":"One row of the grid Identifikováni (a tracked event of a contact)."},"WebTrackingShop":{"type":"object","properties":{"shopId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"enabled":{"type":"boolean"},"listening":{"type":"boolean"},"scriptUrl":{"type":"string","description":"The cart.js address for the one line in the shop's footer."}},"required":["shopId","code","name","domain","enabled","listening","scriptUrl"],"description":"SE Datové zdroje › Webtracking: a shop's Používat switch, whether a scenario listens to its carts, the script."},"WebVisitRule":{"type":"object","properties":{"type":{"type":"string","const":"web_visit"},"operator":{"type":"string","enum":["any","contains","starts_with","is"]},"url":{"type":"string"},"days":{"type":["string","null"]}},"required":["type","operator","days"],"description":"SE Web tracking \"Kontakt navštívil stránku...\": a page visit from the shop's script or the API. any = any page."}}}}