API reference / Outreach
Ask for changes to a campaign's email
A teammate writes a draft, or an approved email not yet sent, again with the changes that you ask for. An approved one goes back to draft. Answers 202 with the email: rewriting is true until the new words are in. A person's own edit meanwhile wins.
/api/v1/campaigns/{id}/emails/{email}/rewriteOther ways to call it
troopy campaigns rewrite-emailtroopy_rewrite_campaign_emailIdempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.Path parameters
id*stringA 24-character id
email*stringA 24-character id
Body
application/jsoninstruction*stringWhat to change, in your words, like: shorter, and ask about Saturdays
At least 2 characters · At most 1000 characters
Response
202 · application/jsondata*object17 properties
id*stringA 24-character id
lead*object4 properties
enrollment*stringA 24-character id
email*stringname*string | nullstatus*enum<string>activepausedrepliedbouncedunsubscribeddonestopped
step*integerIts step, from 0
subject*stringbody*stringflags*array<string>What a person should look at first: a flagged email always waits for one
status*enum<string>draftapprovedsendingsentunknownfailedskippedcanceledreceived
dueAt*string | nullsentAt*string | nullwrittenBy*enum<string>templatepersonteammate
teammate*object | nullThe teammate that wrote it
2 properties
name*stringhandle*stringnote*string | nullThe line of the teammate for the person who reviews it: the detail it starts with, and where that comes from
used*array<object>What the teammate took from the lead's material, each with the words it took. Troopy checked each quote against its source
3 properties
source*stringurl*string | nullquote*stringrewriting*booleanA teammate writes it again now, as a person asked
approvedBy*object | null3 properties
type*enum<string>personagentapi
id*stringname*stringautopilot*booleanApproved by the campaign's Autopilot, in the name of whoever granted it
error*string | nullWhy it hasn't gone, or may not have, or why it couldn't be rewritten