{"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":"SmartEmailing v3","x-displayName":"SmartEmailing compatible API v3","description":"The same paths, envelopes and errors as SmartEmailing REST API v3 (read operations and account webhooks). HTTP Basic: member e-mail + API key."}],"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/v3/account-info":{"get":{"operationId":"se_v3_account_info","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Account info (guid = tenant id for API v1)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"data":{"type":"object","properties":{"account_id":{"type":"integer"},"guid":{"type":"string","format":"uuid","description":"The {tenant} of API v1 paths."},"username":{"type":"string"},"firstname":{"type":["string","null"]},"surname":{"type":["string","null"]},"company":{"type":"string"},"phone":{"type":["string","null"]}}}},"required":["status","meta"]},"examples":{"getting-started-account-info":{"summary":"docs/api-examples/getting-started.json account-info","value":{"status":"ok","meta":[],"data":{"account_id":4,"guid":"3f6c2a1e-8b7d-4c5e-9f10-2a3b4c5d6e7f","username":"admin@example.cz","firstname":null,"surname":null,"company":"Example s.r.o.","phone":null}}}}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/check-credentials":{"get":{"operationId":"se_v3_check_credentials","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Check the credentials","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"message":{"type":"string"},"account_id":{"type":"integer"}},"required":["status","meta"]},"example":{"status":"ok","meta":[],"message":"Hi there! Your credentials are valid!","account_id":1}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}},"post":{"operationId":"se_v3_check_credentials_post","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Check the credentials","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"message":{"type":"string"},"account_id":{"type":"integer"}},"required":["status","meta"]},"example":{"status":"ok","meta":[],"message":"Hi there! Your credentials are valid!","account_id":1}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/contactlists":{"get":{"operationId":"se_v3_contactlists","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"List contact lists","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":500}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"select","in":"query","description":"Comma separated properties to return.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Comma separated properties, \"-\" = descending.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"object","properties":{"total_count":{"type":"integer"},"displayed_count":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/SeContactList"}}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/contactlists/{list_id}":{"get":{"operationId":"se_v3_contactlist","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Get a contact list","parameters":[{"name":"list_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"data":{"$ref":"#/components/schemas/SeContactList"}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/contacts":{"get":{"operationId":"se_v3_contacts","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"List contacts","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":500}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"select","in":"query","description":"Comma separated properties to return.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Comma separated properties, \"-\" = descending.","schema":{"type":"string"}},{"name":"emailaddress","in":"query","schema":{"type":"string"},"description":"Exact e-mail."},{"name":"id","in":"query","schema":{"type":"integer"}},{"name":"blacklisted","in":"query","schema":{"type":"integer","enum":[0,1]}},{"name":"hardbounced","in":"query","schema":{"type":"integer","enum":[0,1]}},{"name":"expand","in":"query","schema":{"type":"string","enum":["customfields"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"object","properties":{"total_count":{"type":"integer"},"displayed_count":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/SeContact"}}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/contacts/{contact_id}":{"get":{"operationId":"se_v3_contact","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Get a contact","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"expand","in":"query","schema":{"type":"string","enum":["customfields"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"data":{"$ref":"#/components/schemas/SeContact"}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/customfields":{"get":{"operationId":"se_v3_customfields","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"List custom fields","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":500}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"select","in":"query","description":"Comma separated properties to return.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Comma separated properties, \"-\" = descending.","schema":{"type":"string"}},{"name":"expand","in":"query","schema":{"type":"string","enum":["customfield_options"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"object","properties":{"total_count":{"type":"integer"},"displayed_count":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/SeCustomField"}}},"required":["status","meta"]}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/ping":{"get":{"operationId":"se_v3_ping","tags":["SmartEmailing v3"],"security":[],"summary":"Ping (no authentication)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"message":{"type":"string"}},"required":["status","meta"]},"example":{"status":"ok","meta":[],"message":"Hi there! API version 3 here!"}}}}}}},"/api/v3/web-hooks":{"get":{"operationId":"se_v3_webhooks","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"List account webhooks","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":500}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"select","in":"query","description":"Comma separated properties to return.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Comma separated properties, \"-\" = descending.","schema":{"type":"string"}},{"name":"id","in":"query","schema":{"type":"string"}},{"name":"event","in":"query","schema":{"type":"string"}},{"name":"url","in":"query","schema":{"type":"string"}},{"name":"active","in":"query","schema":{"type":"string"}},{"name":"method","in":"query","schema":{"type":"string"}},{"name":"timeout","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"object","properties":{"total_count":{"type":"integer"},"displayed_count":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/SeWebhook"}}},"required":["status","meta"]},"examples":{"webhook-consumer-list":{"summary":"docs/api-examples/webhook-consumer.json list","value":{"status":"ok","meta":{"total_count":2,"displayed_count":2,"offset":0,"limit":500},"data":[{"id":7,"url":"https://crm.example.cz/postarna/webhook","method":"POST","event":"new_contact","active":1,"timeout":30,"last_response_code":null,"last_call_time":null,"errors_in_row":0,"basic_auth":{"login":"***","password":"***"}},{"id":8,"url":"https://crm.example.cz/postarna/webhook","method":"POST","event":"unsubscribed_contact","active":1,"timeout":30,"last_response_code":null,"last_call_time":null,"errors_in_row":0,"basic_auth":{"login":"***","password":"***"}}]}}}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}},"post":{"operationId":"se_v3_webhook_create_post","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Register an account webhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["target_url","event"],"properties":{"target_url":{"type":"string","description":"http(s) URL, at most 1 000 characters; public addresses only."},"event":{"type":"string","enum":["new_contact","updated_contact","unsubscribed_contact","email_delivery_started","delivery_status","sent_email","email_open","email_click","scoring_result_changed","engagement_level_changed","sms_delivery_status"],"description":"Fired: new_contact, updated_contact, unsubscribed_contact, delivery_status, sent_email, email_open, email_click. Accepted but never fired yet: email_delivery_started, scoring_result_changed, engagement_level_changed, sms_delivery_status."},"basic_auth":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}},"description":"Optional HTTP Basic the calls send (login 1 to 200 without \":\", password 1 to 500)."}}},"example":{"target_url":"https://crm.example.cz/postarna","event":"unsubscribed_contact"},"examples":{"webhook-consumer-register-new":{"summary":"docs/api-examples/webhook-consumer.json register-new","value":{"target_url":"https://crm.example.cz/postarna/webhook","event":"new_contact","basic_auth":{"login":"postarna","password":"example-webhook-password"}}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","created","error"]},"meta":{"type":"array","maxItems":0},"id":{"type":"integer"}},"required":["status","meta"]},"example":{"status":"created","meta":[],"id":7}}}},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"409":{"description":"Already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"},"examples":{"webhook-consumer-duplicate":{"summary":"docs/api-examples/webhook-consumer.json duplicate","value":{"status":"error","meta":[],"message":"Already exists"}}}}}},"422":{"description":"Validation failed: <parameter>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}},"/api/v3/web-hooks/{webhook_id}":{"delete":{"operationId":"se_v3_webhook_delete_delete","tags":["SmartEmailing v3"],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"summary":"Delete an account webhook","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Authentication Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}}},"429":{"description":"Rate limit exceeded (...)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}}}}},"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":{},"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":{"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}}}]},"SeContact":{"type":"object","description":"A contact in SmartEmailing's shape: times \"YYYY-MM-DD HH:MM:SS\" local, flags 0 / 1, gender M / F, language cs_CZ ...","properties":{"id":{"type":"integer"},"guid":{},"emailaddress":{"type":"string"},"name":{},"surname":{},"titlesbefore":{},"titlesafter":{},"salution":{},"company":{},"street":{},"town":{},"postalcode":{},"country":{},"cellphone":{},"phone":{},"language":{},"birthday":{},"nameday":{},"gender":{},"notes":{},"realname":{},"blacklisted":{"type":"integer"},"is_blacklisted":{},"hardbounced":{},"softbounced":{},"created":{},"updated":{},"created_at":{},"last_updated_at":{},"domain":{},"origin":{},"contactlists":{"type":"array","items":{"type":"object","properties":{"id":{},"contactlist_id":{},"contact_id":{},"status":{},"added":{},"updated":{}}}},"customfields":{"type":"array","description":"Only with expand=customfields.","items":{"type":"object"}},"customfields_url":{}}},"SeContactList":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"publicname":{},"sendername":{},"senderemail":{},"replyto":{},"signature":{},"notes":{},"category":{},"hidden":{},"created":{},"alertIn":{},"alertOut":{}}},"SeCustomField":{"type":"object","properties":{"id":{},"name":{},"type":{},"options_url":{},"customfield_options":{}}},"SeError":{"type":"object","properties":{"status":{"const":"error"},"meta":{"type":"array"},"message":{"type":"string"}},"required":["status","message"],"examples":[{"status":"error","meta":[],"message":"Authentication Failed"}]},"SeWebhook":{"type":"object","properties":{"id":{},"url":{},"method":{},"event":{"type":"string","enum":["new_contact","updated_contact","unsubscribed_contact","email_delivery_started","delivery_status","sent_email","email_open","email_click","scoring_result_changed","engagement_level_changed","sms_delivery_status"]},"active":{},"timeout":{},"last_response_code":{},"last_call_time":{},"errors_in_row":{},"basic_auth":{}}}}}}