# Souborovna API — build and publish a page at a download link The user has an Agency plan and generated an API key for a particular page. The key is bound to that page, so no fileId is needed: send the key and HTML. ## Steps for the agent 1. Create a complete, self-contained single HTML page from the user's brief. - Include all CSS and JavaScript inline in the HTML. - Use data URIs or absolute HTTPS URLs for images, never local paths. - Do not add a file download button; Souborovna provides it. - Maximum size: 1 MB. 2. Send the HTML in one POST request, as shown below. 3. Return the response's "url" to the user. This is a path without a domain; add https://souborovna.cz before it to share the link. ## Request POST https://souborovna.cz/api/campaign/custom-html Headers: Authorization: Bearer Content-Type: application/json Body (JSON): { "html": "", "publish": true } Omit fileId when using a page-bound key; the key identifies the page. Only a general, unbound key requires fileId: add "fileId": "" to the body. ## Example (curl) curl -X POST https://souborovna.cz/api/campaign/custom-html \ -H "Authorization: Bearer sbrvn_your_key" \ -H "Content-Type: application/json" \ -d '{"html":"Hello","publish":true}' ## Response (200) { "ok": true, "slug": "s6nkd6n3vdjhpykf", "url": "/f/s6nkd6n3vdjhpykf", "published": true } ## Errors - 401: Invalid or missing API key. - 403: The account does not have an Agency plan. - 400: Missing fileId with a general key; add "fileId". - 404: File not found. ## Notes - The page runs in a secure sandbox. Souborovna provides a floating download ticket above the page; do not add it to the HTML. - publish:true publishes the page immediately; otherwise it is saved as a draft. - A configured, published page takes precedence over the template design.