Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Troop

Add an inbox rule

Allows or blocks an email address or a domain, with its subdomains, for the mail that a teammate's address gets (in), sends (out), or both. A block wins. With an allow rule for a direction, only what an allow rule names goes through in that direction. Mail that the rules keep out is not kept. The same rule again changes nothing. Owners and admins only.

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

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 inbox-rule-add
MCP tooltroopy_add_inbox_rule
Rate limit30 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
kind*enum<string>

allowblock

value*string

An email address, or a domain like acme.com

At least 3 characters · At most 254 characters

directionenum<string>

inoutboth

Default "both"

Response

200 · application/json
data*object
13 properties
handle*string

The teammate's handle, like chief

At most 40 characters

name*string
box*string

Its box in GET /emails: a t- id

address*string

The teammate's own email address

fromName*string

The name that people see beside the address. Empty: the teammate's name

signature*string

Goes under every email that the address sends

dailyCap*integer

The most emails that the address sends in 24 hours. Each address of an email counts as one

paused*boolean

A paused inbox still takes mail, but the teammate neither reads it nor sends from it

wake*enum<string>

Which new mail starts the teammate on it, as a task. people: the people of the workspace, the addresses that it wrote to, and answers to its mail. anyone: every sender that passed DMARC too. off: none

offpeopleanyone

instructions*string

How the teammate handles the mail of this address, beside the Email file of the workspace

rules*array<object>

Who the address takes mail from and sends to. A block wins. With an allow rule for a direction, only what it allows goes through. The rules of the workspace (GET /email/rules) apply too

4 properties
id*string

A 24-character id

kind*enum<string>

allowblock

value*string

An email address, or a domain with its subdomains

direction*enum<string>

in: mail that it gets. out: mail that it sends. both

inoutboth

deleted*boolean

A person deleted the inbox: the address takes no mail. POST /agents/{handle}/inbox gives a new one

sentToday*integer

Emails that it sent in the last 24 hours, each address one

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.