---
title: "Save AI email style"
method: PUT
path: "/email-ai-style"
tags: ["Email AI Style"]
---

# Save AI email style

`PUT /email-ai-style`

Requires emails:write and access to the source email. Snapshots the stored email appearance, using email then company theme and font defaults, or the optional unsaved canvas, plus detected layout habits such as dotted dividers around every button. Existing emails and company theme remain unchanged. Marketers cannot capture transactional sources. Replaces only the expected revision; explicit generation style requests and plain-text choices still take precedence.

## Request body

- object
  - `emailId` string, required — Source email ID in this company, including campaign, sequence and transactional email rows. Use the underlying email ID, not a campaign ID or transactional slug.
  - `expectedStyleId` string, nullable, required — revisionId returned by GET. Use null only when no style is stored.
  - `canvas` EmailAiStyleCanvas
    - `blocks` object[], required — Native blocks JSON, limited to 500,000 serialized characters. Must contain substantive email content.
    - `theme` object, required — Complete editor theme. Required color keys are primary, background, surface, text, mutedText, heading, border and link. Required typography keys are baseFontSize, leadFontSize, baseLineHeight, heading1Size, heading2Size, heading3Size and buttonFontSize. Required layout keys are contentWidth, containerPaddingX, containerPaddingY, blockSpacing, baseRadius, sectionPadding, buttonPaddingX, buttonPaddingY and borderedBlockPadding. Optional theme fields match the editor, including content color, heading font, button radius and weight.
      - `presetId` 'default' | 'soft' | 'editorial' | 'bold', required
      - `colors` object, required
      - `typography` object, required
      - `layout` object, required
    - `fontFamily` string, required
    - `emailPreset` 'branded' | 'minimal', required
  - `layoutRuleIds` string[] — IDs of detected layout habits to keep. Omit to keep every habit detected in the source; pass an empty array to keep none. Unknown IDs are ignored. Review style.layout.rules in the response.
  - `notes` string — Optional design notes for future generations, for example "always open with a short video". Treated as design guidance, never as email content.

## Response `200`

Current saved-style state

- EmailAiStyleState
  - `success` boolean, required
  - `style` object, nullable, required — Independent version 1 appearance snapshot. No source copy, links or bindings are stored in block styles. Unsupported versions are returned as null.
    - `version` 1
    - `id` string
    - `sourceEmailId` string
    - `sourceName` string
    - `savedAt` string, date-time
    - `theme` object
    - `fontFamily` string
    - `emailPreset` 'branded' | 'minimal'
    - `blocks` object[] — Appearance records keyed by block type and discriminator, not source email blocks.
    - `layout` object — Structure guidance captured with the appearance. Absent on snapshots saved before layout habits existed.
      - `outline` string[] — Top-level block descriptors in source order (for example heading:1, divider:dots, button:pill), excluding logo and footer scaffolding.
      - `rules` EmailAiStyleLayoutRule[] — Confirmed layout habits. Generation follows them in prompts and inserts content-free companions (dividers, spacers) deterministically.
        - `id` string, required — Stable rule identifier, for example around|button|divider:dots. Pass it in layoutRuleIds to keep the habit.
        - `kind` 'opener' | 'around' | 'before' | 'after', required
        - `block` string, required — Target block type, for example button or video.
        - `companion` string — Content-free companion descriptor for around/before/after rules, for example divider:dots.
        - `description` string, required
    - `notes` string — Free-text design notes supplied when saving, up to 500 characters.
  - `revisionId` string, nullable, required — Pass this as expectedStyleId on the next write. An unsupported style version still returns its revision for replacement or clearing.
  - `canManage` boolean, required — Whether your key scopes and workspace role permit saving or clearing.

## Other responses

- `400` — Invalid or oversized canvas, or no substantive email content
- `401` — Missing or invalid API key
- `403` — Missing required scope or workspace role cannot perform this operation
- `404` — Company or accessible source email not found
- `409` — AI_STYLE_CONFLICT. Get the current style, review it and retry with its revisionId. Do not automatically retry a conflicting write.
- `422` — Missing or malformed required fields
- `503` — The database was temporarily unavailable. The request may be retried after the delay in Retry-After.

## Changes

- **2026-09-06** `b11064a8f41b` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/sequenzy/apis/sequenzy-api/changes/email-ai-style/put.md)

---

[API](https://skmtc.dev/sequenzy/apis/sequenzy-api.md) · [All operations](https://skmtc.dev/sequenzy/apis/sequenzy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sequenzy/apis/sequenzy-api/revisions/e93563b0d37e?raw)
