Skip to main content
PATCH
/
v1
/
emails
/
{emailId}
curl --request PATCH \
  --url https://brew.new/api/v1/emails/{emailId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "Tighten the headline and replace the CTA copy with \"Get started today\"."
}
'
{
  "emailId": "eml_2SmZOWV3ZQ7W5x6g3m4p",
  "emailVersionId": "emv_2SmZOWV3ZQ7W5x6g3m4p_v1",
  "html": "<!DOCTYPE html><html><body>Welcome to Brew.</body></html>",
  "previewImage": "https://storage.example.com/emails/eml_2SmZOWV3ZQ7W5x6g3m4p.png"
}

Authorizations

Authorization
string
header
default:Bearer brew_your_api_key
required

Send your Brew API key as Authorization: Bearer brew_xxx.

Path Parameters

emailId
string
required

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

Required string length: 1 - 64
Example:

"eml_2SmZOWV3ZQ7W5x6g3m4p"

Body

application/json

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.

prompt
string
required
Minimum string length: 1
emailVersionId
string
Required string length: 1 - 64
contentUrls
string<uri>[]
Maximum array length: 8

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.

emailId
string
required
Minimum string length: 1
emailVersionId
string
required
Minimum string length: 1
html
string
required
previewImage
string<uri>