v1

latestOpenAPI 3.1.02026-07-2670105729.6 KB
Emails

Edit an email design

Applies a natural-language prompt edit (optionally a emailVersionId source pin + contentUrls) to an existing design: the Brew email agent edits the design’s current latest version (or the pinned version) and writes a new version: "latest" row on the same emailId (the previous head is demoted to a numeric historical version).

USAGE-metered — the agent’s actual token spend is charged. Returns the generated-email shape with the new emailVersionId.

patch/v1/emails/{emailId}

Path parameters

emailIdstring required

Design id returned by POST /v1/emails and listed by GET /v1/emails.

Example:eml_2SmZOWV3ZQ7W5x6g3m4p

Design id returned by POST /v1/emails and listed by GET /v1/emails.

Request body

promptstring required

The edit to make, in plain language — e.g. "swap the hero for the spring campaign image and tighten the CTA copy". Scoped edits beat full rewrites.

emailVersionIdstring

Pin the edit to a specific source version (from list_email_designs include: ["versions"]). Omit to edit the current latest.

contentUrlsstring[]

Up to 8 URLs whose content grounds the edit (e.g. the product page the new section should describe).

Response

Updated design (a new latest version row was written) or a text response if the agent returned prose instead of a design. USAGE-metered: the agent’s actual token usage is charged (no fixed price).

OR