Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Outreach

Edit a campaign's email

A person's own words for a draft, or for an approved email not yet sent. What a person writes carries no flags.

patch/api/v1/campaigns/{id}/emails/{email}

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy campaigns edit-email
MCP tooltroopy_update_campaign_email
Rate limit120 calls in 60 seconds, for each key
RetriesSend an Idempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.

Path parameters

id*string

A 24-character id

email*string

A 24-character id

Body

application/json
subjectstring

At least 1 characters · At most 200 characters

bodystring

At least 1 characters · At most 5000 characters

Response

200 · application/json
data*object
17 properties
id*string

A 24-character id

lead*object
4 properties
enrollment*string

A 24-character id

email*string
name*string | null
status*enum<string>

activepausedrepliedbouncedunsubscribeddonestopped

step*integer

Its step, from 0

subject*string
body*string
flags*array<string>

What a person should look at first: a flagged email always waits for one

status*enum<string>

draftapprovedsendingsentunknownfailedskippedcanceledreceived

dueAt*string | null
sentAt*string | null
writtenBy*enum<string>

templatepersonteammate

teammate*object | null

The teammate that wrote it

2 properties
name*string
handle*string
note*string | null

The 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*string
url*string | null
quote*string
rewriting*boolean

A teammate writes it again now, as a person asked

approvedBy*object | null
3 properties
type*enum<string>

personagentapi

id*string
name*string
autopilot*boolean

Approved by the campaign's Autopilot, in the name of whoever granted it

error*string | null

Why it hasn't gone, or may not have, or why it couldn't be rewritten

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
404 not_foundCheck the path and any id in it. Every operation is listed in /api/v1/openapi.json.
409 conflictThis Idempotency-Key was used for a different request, or that request is still running. Use a new key for a new request.
429 rate_limitedWait the number of seconds in Retry-After, then retry.