{"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":"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."}],"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."}},"paths":{"/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}/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}/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}/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}/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}/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}/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}/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"}}}}},"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)."},"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":{"BoxPadding":{"type":"object","properties":{"top":{"type":"number"},"right":{"type":"number"},"bottom":{"type":"number"},"left":{"type":"number"}},"required":["top","right","bottom","left"]},"CampaignHeader":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"CampaignLinkParam":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"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"]},"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."},"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"]},"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."},"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."},"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}}}]},"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"]},"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."},"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"]},"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"]},"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\")."}}},"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"]},"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\")."},"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"]},"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"]},"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"]},"TestSendResult":{"type":"object","properties":{"to":{"type":"string"},"sentAt":{"type":"string"}},"required":["to","sentAt"]},"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"]},"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."}}}}