Overview
The Server section covers everything that runs outside the browser.
While Builders run inside your application (client-side), Server APIs allow you to:
- Generate artifacts (HTML, PDF, Image, ZIP)
- Process designs server-side
- Integrate Unlayer into backend workflows
- Execute secure operations that should not run in the browser
This is the backend execution surface of Unlayer.
When to Use the Server APIs
Use the Server surface when:
- You need to generate a PDF from a design in a background job
- You want to export HTML without exposing API keys to the browser
- You want to generate an image preview server-side
- You are running a cron job, webhook handler, or worker process
- You need authenticated access using your API key
If your use case involves embedding a visual builder or editor in your frontend, see Builders instead.
How It Works
Most server workflows follow this pattern:

- A Builder produces a design JSON (in the browser).
- Your backend sends that JSON to the Cloud API.
- The API returns a generated artifact (HTML, PDF, Image, ZIP).
- You store, send, or distribute the result.
Cloud API
The Cloud API is the primary server-side interface.
It allows you to:
- Export HTML
- Export PDF
- Export Image
- Export ZIP bundles
- Fetch templates from Unlayer Console
- Apply merge tags dynamically
- Generate files securely using your API key
All requests are authenticated and executed server-to-server.
For HTML export, you often don't need the Cloud API—the builder can produce HTML directly in the browser via unlayer.exportHtml(); Use the Cloud API when you need to export HTML server-side (for example, in a background job or when the user is not in the builder).
See the Cloud API reference for endpoint details.
Security Model
Server APIs use API key authentication.
Because requests are authenticated with your API key:
- Never call the Cloud API directly from the browser
- Always proxy requests through your backend
- Keep API keys in secure server-side environments only
Typical Server Use Cases
| Use case | Description |
|---|---|
| Export PDF in background job | Generate a PDF after a user submits a form, then email it automatically. |
| Generate HTML for email sending | Export HTML server-side and pass it to your email provider. |
| Image thumbnail generation | Generate preview images for templates or documents. |
| ZIP export for asset bundles | Produce downloadable packages including images and required assets. |