templates
AI design generation
Changed onGenerate or modify an Unlayer design using AI. Send the conversation as messages (today only the last user message is consumed; earlier turns are accepted as chat history) and describe the target with output.kind + output.displayMode. Pass the current canvas state in context (full design JSON + selection pointer) to modify an existing design. Only anthropic and openai models are supported. To import existing HTML or an image instead, use POST /v3/templates/import.
post/v3/templates/generate
Request
- Base URL: https://api.unlayer.com
- URL: https://api.unlayer.com/v3/templates/generate
- 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
Response
The generated (or modified) design plus model metadata and optional usage metadata.
Changes
- breaking
the request property
/became not nullable - breaking
the request property
/became not nullable - breaking
the request property
/became not nullable
- breaking