Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Outreach

Change a campaign

Changes a campaign, starts it (status active: it needs the business's postal address, its steps, and a mailbox whose domain has SPF or DKIM), pauses it, or ends it (done: every email not yet sent is canceled). New steps drop the drafts written for the old ones.

patch/api/v1/campaigns/{id}

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 update
MCP tooltroopy_update_campaign
Rate limit60 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

Body

application/json
namestring

At least 1 characters · At most 120 characters

liststring

A 24-character id

wherearray<object>

At most 10 items

3 properties
column*string

A column's id

At most 40 characters

op*enum<string>

isis_notcontainsgtltemptynot_empty

valuestring | number | boolean

What to compare with; none for empty and not_empty

stepsarray<object>

At most 8 items

6 properties
kind*"email"
waitinteger

Days after the step before it (the first: 0)

Default 0 · At least 0 · At most 60

writeenum<string>

fixed: the body is the email, with variables filled in for each lead. ai: a teammate writes the email for each lead from the brief

fixedai

Default "fixed"

briefstring | null

For ai: what the email is for, like the offer, the angle and the ask. It is required. For fixed: a note for people

subjectstring | null

Its subject, with variables. A fixed first email needs one. A follow-up without one answers in the thread. For ai, a first email without one gets a subject from the teammate

bodystring | null

For fixed: its words, with variables like {{first_name|there}} filled in for each lead. For ai: a draft for the teammate to follow, or nothing

mailboxesarray<string>

At most 20 items

windowobject
4 properties
days*array<integer>

The weekdays it sends on, 0 is Sunday

At most 7 items

start*integer

The hour it starts sending

At least 0 · At most 23

end*integer

The hour it stops

At least 1 · At most 24

timezone*string

IANA time zone the time is in, like Europe/Berlin

At most 64 characters

statusenum<string>

activepauseddone

Response

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

A 24-character id

name*string
list*object | null

The list of people it is for

2 properties
id*string

A 24-character id

name*string
where*array<object>
3 properties
column*string
op*enum<string>

isis_notcontainsgtltemptynot_empty

valuestring | number | boolean | null
steps*array<object>
6 properties
kind*"email"
wait*integer
write*enum<string>

fixed: the body is the email, with variables filled in for each lead. ai: a teammate writes the email for each lead from the brief

fixedai

brief*string | null
subject*string | null
body*string | null
mailboxes*array<string>

The mailboxes it sends from

window*object
4 properties
days*array<integer>
start*integer
end*integer
timezone*string
status*enum<string>

draftactivepauseddone

stats*object
7 properties
enrolled*integer
active*integer
replied*integer
bounced*integer
unsubscribed*integer
sent*integer
review*integer

Drafts waiting for a person

writer*object

The emails that a teammate writes for each lead

2 properties
busy*boolean

A teammate writes emails of it now

error*string | null

Why its emails could not be written lately. The teammate tries again after 10 minutes

autopilot*object | null

An owner's or admin's grant to send without a person approving each email; null when never granted

7 properties
on*boolean

In force now

until*string

ISO 8601 date and time

dailyCap*integer
grantedBy*object

Who wrote it

3 properties
type*enum<string>

personagentapi

id*string
name*string
grantedAt*string

ISO 8601 date and time

endedAt*string | null
why*string | null

Why it ended

createdBy*object

Who wrote it

3 properties
type*enum<string>

personagentapi

id*string
name*string
createdAt*string

ISO 8601 date and time

updatedAt*string

ISO 8601 date and time

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.