Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Troop

Send an email from a teammate

Sends one email now from a teammate's own address, with its signature, to one address or to up to 10 addresses. A teammate sends only from its own address, after an owner or admin says yes. A person who sends must be an owner or admin. Troopy refuses a paused inbox, an address on do-not-contact, and an email for more addresses than the daily cap has left for 24 hours. The answer is the kept email: sent, failed with the reason, or unknown when it possibly went. Troopy does not send an unknown email again.

post/api/v1/agents/{handle}/inbox/send

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 agents send-email
MCP toolNone. Call it over REST or with the CLI.
Rate limit20 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

handle*string

The teammate's handle, like chief

At most 40 characters

Body

application/json
to*string | array<string>

One email address, or a list of up to 10 addresses

subjectstring

Needed, except for an answer: an answer takes the subject of its email

At most 300 characters

body*string

Plain text. The signature goes under it

At least 1 characters · At most 20000 characters

replyTostring

The id of an email in this teammate's inbox that it answers

Response

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

A 24-character id

direction*enum<string>

in for an email that came, out for one that the address sent

inout

from*string

The sender's address

fromName*string
subject*string

Codes in it masked, like [code 1]

receivedAt*string

ISO 8601 date and time

checked*boolean

The sender's domain passed DMARC: the one sign it is who it says

spam*boolean

SES called it spam: the teammate doesn't see it

codes*integer

How many codes it carries. Never shown over the API: the teammate types them by reference

links*array<object>

Its links' sites and words, never their addresses

3 properties
n*integer
site*string
label*string
to*array<string>

A sent email: the addresses that it went to

status*enum<string> | null

A sent email: whether it went. unknown when it possibly went: Troopy does not send it again

sendingsentfailedunknown

error*string | null

A sent email that did not go, or possibly did not: why

textstring

One email's words, every code and link masked

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.