templates

Import a template from HTML or an image

Changed on

Import an existing template from HTML or an image (URL or base64) and return the resulting Unlayer design JSON. No template DB entry is created.

post/v3/templates/import

Request

  • Base URL: https://api.unlayer.com
  • URL: https://api.unlayer.com/v3/templates/import
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Query parameters

projectIdstring

The project ID (required for PAT auth, auto-resolved for API key auth)

Request body

modelstring

Preferred AI model. Accepts a provider/model string (e.g. "anthropic/claude-opus-5", "openai/gpt-5.6-luna"), a bare provider ("anthropic", "openai") which uses that provider's default model, or a bare model id ("claude-opus-5", "gpt-5.6-luna") with the provider inferred from the name. Optional — defaults to anthropic/claude-opus-5.

displayMode'email' | 'web' | 'popup' | 'document' required

Display mode for the imported design

Response

Successfully imported template

idstring
modelstring
providerstring

Changes