Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Email

Connect an email domain

Connects the workspace's own domain for its teammates' addresses. The answer has the DNS records to add. When the DKIM records and the MX record check out, each teammate moves to handle@domain, and its old address still takes mail. Use a domain or a subdomain that gets no other mail, like agents.acme.com: Troopy refuses a domain whose MX points elsewhere. One domain a workspace. Owners and admins only.

post/api/v1/email/domain

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 email-domain connect
MCP tooltroopy_connect_email_domain
Rate limit5 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.

Body

application/json
domain*string

Like agents.acme.com

At least 4 characters · At most 253 characters

Response

200 · application/json
data*object
10 properties
domain*string

Like agents.acme.com

status*enum<string>

pending waits for its DNS records. verified: teammates send and get mail on it. failed: error says why

pendingverifiedfailed

error*string | null

Why it failed, or what still waits

records*array<object>

The records to add at the DNS host of the domain

7 properties
type*enum<string>

CNAMEMXTXT

name*string

The full name of the record

value*string
priority*integer | null

For an MX record

purpose*enum<string>

dkiminboundmail_fromdmarc

ok*boolean

What the latest check found

optional*boolean

It helps mail land, but the domain verifies without it

zone*string | null

The DNS zone that holds the records. A DNS host asks for the name of a record without it

dnsHost*string | null

Who serves the zone, like Namecheap, when Troopy knows its name servers

zoneMail*array<object>

The MX records of the zone when the domain is a subdomain: the business's own mail. Keep them

2 properties
priority*integer
host*string
checkedAt*string | null
verifiedAt*string | null
createdAt*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.
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.