Edit an email design
Writes a new version: "latest" row on the same emailId (the previous head is demoted to a numeric historical version) via one of two mutually-exclusive bodies:
- AI edit —
{ prompt }(optionally aemailVersionIdsource pin +contentUrls): runs the Brew email agent against the design’s current latest JSX (or the pinned version). - Manual JSX save —
{ jsx }: persists hand-authored / pasted React-Email JSX verbatim (rendered to HTML server-side), no agent involved — the same operation the in-app canvas editor performs.
Supply exactly one of prompt / jsx; a body carrying both is rejected 400 INVALID_REQUEST. Returns the generated-email shape with the new emailVersionId.
Authorizations
Send your Brew API key as Authorization: Bearer brew_xxx.
Path Parameters
Design id returned by POST /v1/emails and listed by GET /v1/emails.
1 - 64"eml_2SmZOWV3ZQ7W5x6g3m4p"
Body
Either an AI edit (prompt, optional emailVersionId source pin, optional contentUrls) OR a manual JSX save (jsx). Identity lives on the path. Exactly one of prompt / jsx must be present.
Response
Updated design (a new latest version row was written) or a text response if the agent returned prose without JSX. The AI prompt edit is usage-metered (actual token usage charged, no fixed price); the deterministic jsx save branch is FREE.