Skip to main content
POST
Call email_message.write

Authorizations

Authorization
string
header
required

An API key minted at Settings › API & MCP. Send it as Authorization: Bearer <key>. A key carries its holder's own permissions, resolved on every call — revoking a membership closes the key's reach immediately. Keep it in an environment variable (GOOSY_API_KEY), never in a committed file.

Headers

x-request-id
string

Your own id for this request, echoed back and recorded on the audit trail. 1–128 characters from A–Z a–z 0–9 . _ : -, starting with a letter or digit; anything else is replaced by a generated id.

Maximum string length: 128

Body

application/json
step_key
string
required

The message step's key in the flow, as the flow on screen or email_flow.read_messages names it (e.g. message_1); its place in the flow ('2' for the second message) is read too.

Required string length: 1 - 200
brief
string
required

What the message should say, in the member's own words (the offer, the news, the tone they asked for). Add nothing they did not say.

Maximum string length: 4000
flow_id
string<uuid>

The flow's id: the Email & text flow or automation on screen, or one email_flow.read_messages named. Omit it on that flow's or automation's own page.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
flow_name
string

The flow's or automation's name as the member said it ('Quick question', 'Last chance offer'), when no flow is on screen and no result gave its id; every email or text on the Email & text page is a flow.

Required string length: 1 - 200
channel
enum<string>

email or sms, only for a step that does not already say which; a step keeps its channel.

Available options:
email,
sms
member_subject
string

The member's own subject line, word for word, when they gave one.

Maximum string length: 20000
member_preview_text
string

The member's own preview text (the line an inbox shows after the subject), word for word, when they gave one; "" when they asked for none ('leave the preview text empty', 'no preview text'): it is saved empty and stays empty through later rewrites. Leave it out otherwise: an email the member pasted without one keeps none, and an email Goosy writes gets one.

Maximum string length: 20000
member_body
string

The member's own email body or text, word for word, when they pasted or dictated one; or, to add a brand kit picture to an email, the body's words now, every line as it is, with {{image.<asset_id>}} (the picture's asset_id from brand_kit.read) alone on its own line where the member asked: directly under the sign-off name for a signature headshot.

Maximum string length: 20000
polish_member_copy
boolean

true only when the member said their copy may be edited or polished; otherwise their copy is kept exactly as given.

fields
enum<string>[]

The fields the member asked to change, when they named only some ('change the subject', 'make the body shorter'); every other field stays exactly as it is. Leave it out to write the whole message.

Minimum array length: 1
Available options:
subject,
preview_text,
body
button_style
object

How the email's buttons look, only when the member asked to change them ('white text, bigger, rounded', 'make them plain text links'): set just the parts they named. A button is a line holding only a link.

button
integer

Which button, counting from 1 in reading order, when the member named one ('the second button', 'the Book a call button'); leave it out to style every button in the email.

Required range: 1 <= x <= 20
replace
object[]

The member's exact text to change and what it becomes, for a find-and-replace the member spells out ('change open Saturdays to open Sundays in every email', 'replace example.com/shop with example.com/store'): each find, case and spacing exactly as the email has it, is replaced everywhere it appears in this message, in order; fields narrows where. Only the matched text changes and no writing turn is spent.

Required array length: 1 - 20 elements
confirmation_id
string<uuid>

Omit to propose: the first call says what would happen, returns a confirmation_id and changes nothing. To go ahead, send the same arguments again with that confirmation_id, on a member's own API key; a service account's key can propose but never confirm.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
workspace
string

Which workspace to run in — its slug. Omit to use your default. With more than one reachable workspace and no default, the call is refused and the choices are listed.

Minimum string length: 1

Response

The call was admitted and dispatched. ok says whether the tool succeeded — a refusal the tool itself produced is still a 200, exactly as it is a successful JSON-RPC result over MCP.

The tool ran and answered.

ok
boolean
required
workspace
string
required

The slug of the workspace this call ran in.

working_in
object
required

Which workspace this call ran in, and how that was decided. Present on every workspace-scoped result.

state
string
Allowed value: "confirmation_required"
confirmation_id
string<uuid>
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
expires_in_seconds
integer
request_summary
string

What will happen, in one sentence, for a person to approve before confirming.

message_id
string
step_key
string
revision
integer
channel
enum<string>
Available options:
email,
sms,
whatsapp
subject
string | null
preview_text
string | null
words
string
look
enum<string> | null
Available options:
plain,
template,
designed,
html
reply_to
string | null
cc
string[]
bcc
string[]
button_styles
any
wrote_by
enum<string>
Available options:
writer,
member,
none
replaced
object
stop_rules
object[] | null
still_unwritten
string