What the API gives you
The REST API at https://api.trustyourinbox.com/v1 exposes your domains, issues, reports, senders, DNS changes, webhooks and who has access, documented publicly at trustyourinbox.com/developers with an OpenAPI spec and a Postman collection. API keys are a Pro feature; the settings page shows an upgrade path on other plans.
Creating a key
On Settings → Integrations → API keys, name the key and choose its scope. Keys are read-only by default; ticking Allow write actions lets it dismiss or snooze issues, re-check DNS, and stage one-click DNS fixes, which still go through the five-minute delay, the email notice, and an undo with no deadline. The plaintext key (prefix tyi_api_) is shown exactly once; we store only a hash. A workspace holds up to 20 active keys.
A key expires after 90 days unless you pick another lifetime when you create it (Never expires is still a choice). A week before a key expires, the person who created it gets an email. Rotate on your own key makes a replacement with the same name, access and lifetime and turns the old one off at once, so you can swap the new key into your script before the old one would have stopped.
Adding or deleting a webhook endpoint needs a second choice under write: Also allow sharing outside the account. A webhook endpoint keeps receiving this workspace's alerts at an outside address, so write access alone cannot create one. The choice is off by default.
Every owner of the workspace gets an email whenever a key is created, read-only or not. It names the key, who made it, what it can do and when it expires, with a link to revoke it.
403 share_scope_required on these. To manage webhooks from a script, create a new key with sharing outside the account allowed and revoke the old one.Using it
Send it as a bearer token: Authorization: Bearer tyi_api_.... Each key gets 120 requests a minute. Requests from one network address also share a much higher ceiling, which only stops a flood of requests no key vouches for. Every answer carries RateLimit-Policy (the ceiling) and RateLimit (how many requests are left, and the seconds until the next one fits), so a client can pace itself before it reaches the limit. Every 429 carries Retry-After, the seconds until a retry can succeed, including the limits a single action has (five DNS changes in 24 hours, the daily diagnosis cap, invite emails). A request body may be 16 KiB (96 KiB for a header block sent for diagnosis); a larger one is answered with a 413 that states the limit. Most write requests accept an Idempotency-Key header so a retried request cannot double-apply: for 24 hours a replay from the same API key returns the original result, and reusing an idempotency key for a different request is rejected. Idempotency keys are held per API key, so two API keys never share one.
Confirming a new key works
One call tells you everything:
curl -H "Authorization: Bearer tyi_api_..." \ https://api.trustyourinbox.com/v1/me
A 200 describes the key: the workspace (or, for a partner key, the organization) it acts for, whether it can write and share, when it expires, your role, and your plan's limits. If plan.apiAccess is false, your plan no longer includes the API and every other call answers 403 plan_required. A 401 means the key is wrong, revoked, or its creator lost access. A 403 on a write means the key is read-only or the plan does not include the action, which are different fixes: tick Allow write actions for the first, upgrade for the second. A 403 with share_scope_required means the call reaches outside the account and the key was made without sharing allowed.
Long lists come in pages
Lists that grow over time (domains, reports, Delivery Diagnosis cases, graded messages, custom senders, DNS changes and webhook deliveries) answer one page at a time. Set the page size with ?limit= (each list states its default and maximum). When more follow, the answer carries a nextCursor; send it back as ?cursor= for the next page, and stop when it is null. A call without a cursor answers the first page, as before. Pages never repeat or skip an item, even when new ones arrive while you read.
Undoing a DNS change
POST /v1/changes/{id}/undo puts a record an applied fix changed back to what it held before. The undo is staged like any fix: it waits five minutes, emails a heads-up, and can be canceled until it applies. An undo has no deadline; it is refused only when the record no longer holds the value the fix wrote, so it never overwrites someone else's edit. Send {"preview": true} first to see the record now and after without staging anything. The same works when staging a fix. Only the JSON value true asks for a preview: anything else, such as the text "true" or the number 1, is refused with invalid_preview and nothing is staged. It needs a key with write actions allowed.
Who has access
GET /v1/members lists everyone who can see the workspace, GET /v1/invites the invitations still open, and GET /v1/credentials every API key and AI assistant token with its state and when it was last used. None of them ever returns a key or token itself.
Revocation is instant, in every direction
Revoke stops a key immediately. So does anything that invalidates its holder: the key checks its creator's live role and your plan on every call, so a downgrade or a removed teammate kills the key at the next request, not the next sync. When its creator is removed or moves to a role that cannot edit, the key is revoked on the spot and the audit log says why, so a re-invite never brings it back; the list shows any key whose creator lost access as Orphaned. A key a plan that ended turned off shows as Paused and stays off after you pay again: rotate it for a working key. Revoking deliberately works even after a downgrade, and anyone can always revoke a key they created. Every write made with a key is audited as via API key "name".
The list opens on Current: every key that has not been revoked, expired ones included, because they still count toward the 20 and still need revoking. A revoked key moves to the Revoked tab, where Delete removes it for good. Only a revoked key can be deleted, and your audit log keeps the record that it was created, revoked and deleted.