Mailboxes
Manage individual Google Workspace / Microsoft / Azure mailboxes: buy new ones on a domain you already own, list and filter them, update profile info, rotate passwords, and cancel/reactivate.
| Method | Path | Description |
|---|---|---|
POST | /v1/api/mailboxes/list | List/filter mailboxes in the workspace |
GET | /v1/api/mailboxes/show-credentials | Reveal the mailbox’s own Google console password |
POST | /v1/api/mailboxes/smtp-credentials/status | Check whether an SMTP sending credential has been issued |
POST | /v1/api/mailboxes/smtp-credentials/issue | Mint (or rotate) an SMTP sending credential |
POST | /v1/api/mailboxes/messages/list | Read new INBOX messages (reply detection) |
GET | /v1/api/mailboxes/details | Get one mailbox’s details |
POST | /v1/api/mailboxes/buy | Buy mailboxes on domain(s) you already control |
POST | /v1/api/mailboxes/status | Check provisioning status |
POST | /v1/api/mailboxes/cancel | Cancel mailboxes |
POST | /v1/api/mailboxes/uncancel | Undo a pending cancellation |
POST | /v1/api/mailboxes/reactivate | Reactivate Microsoft/Azure mailboxes in place (free) |
POST | /v1/api/mailboxes/reactivate-rebuy | Re-purchase & re-provision Microsoft/Azure mailboxes |
POST | /v1/api/mailboxes/resetup | Resetup Google Workspace mailboxes (renewal flow) |
GET | /v1/api/mailboxes/resetup-status | Get the latest resetup job for a domain |
POST | /v1/api/mailboxes/update | Update mailbox first/last name |
POST | /v1/api/mailboxes/add-signature | Set signature on mailbox(es) |
POST | /v1/api/mailboxes/delete-signature | Remove signature |
POST | /v1/api/mailboxes/profile-picture | Update profile picture |
GET | /v1/api/mailboxes/generate-totp | Generate a TOTP code for a mailbox’s 2FA |
POST | /v1/api/mailboxes/username | Change username (local part of the address) |
POST | /v1/api/mailboxes/password | Change password |
GET | /v1/api/mailboxes/availability | Check whether a username is available on a domain |
GET | /v1/api/mailboxes/refresh-tokens | Get OAuth refresh tokens by domain or email |
POST | /v1/api/mailboxes/forwarding/setup | Set up email forwarding (Google) |
POST | /v1/api/mailboxes/forwarding/update | Update email forwarding |
POST | /v1/api/mailboxes/forwarding/remove | Remove email forwarding |
POST | /v1/api/mailboxes/forwarding/jobs | List forwarding job status |
POST | /v1/api/mailboxes/failure-reason | Get why an admin/setup mailbox failed |
POST | /v1/api/mailboxes/client-id-request/initiate | Start a custom OAuth Client ID request |
GET | /v1/api/mailboxes/client-id-request/status/{requestId} | Check a Client ID request |
GET | /v1/api/mailboxes/client-id-requests | List Client ID requests |
For most integrations you won’t buy mailboxes directly here — Orders registers a
domain and buys its mailboxes in one call. Use /mailboxes/buy when the domain is already
registered and verified in your workspace and you just need more mailboxes on it.
List mailboxes
curl -X POST https://api.infrabox.software/v1/api/mailboxes/list \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_UID" \
-H "Content-Type: application/json" \
-d '{ "domain": "yourdomain.com", "page": 1, "limit": 50 }'Filter with keyword, domain, domain_uid, platform (GOOGLE/MICROSOFT/AZURE), status,
or a specific list of uids. Each row includes status, sequencers (what it’s connected to —
see Sequencers), tags, and renewal fields.
Buy mailboxes on an existing domain
curl -X POST https://api.infrabox.software/v1/api/mailboxes/buy \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_UID" \
-H "Content-Type: application/json" \
-d '{
"uids": ["<domain_uid>"],
"mailboxes": [
{ "first_name": "Jane", "last_name": "Smith", "username": "jane.smith", "platform": "GOOGLE" }
]
}'username is the local part only — the full address is derived from it plus the domain the
mailbox is bought on.
Reveal console credentials
curl "https://api.infrabox.software/v1/api/mailboxes/show-credentials?uid=<mailbox_uid>" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_UID"Returns the mailbox’s own Google console sign-in password (and TOTP secret, for 2FA). This is not a sending credential — Google requires 2-step verification plus an app password to send over SMTP directly, and this endpoint does not produce that. To actually send mail from the mailbox, use SMTP relay credentials below instead.
Don’t try to authenticate to smtp.gmail.com with the value this endpoint returns — Google will
reject it (534 5.7.9 WebLoginRequired). Sending is done through the Infrabox relay, not
directly against Google.
SMTP relay credentials (for sending)
Every mailbox sends through the Infrabox SMTP relay, not directly against Google — the relay authenticates to Gmail on the mailbox’s behalf via domain-wide delegation, so nothing here ever touches a Google password or 2FA. This is the credential an external sending tool (Instantly/Smartlead/Lemlist/your own code) actually needs.
Check status
curl -X POST https://api.infrabox.software/v1/api/mailboxes/smtp-credentials/status \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_UID" \
-H "Content-Type: application/json" \
-d '{ "uids": ["mb_111", "mb_222"] }'Up to 100 uids per call. Reports password_set per mailbox — never the password itself, which is
bcrypt-hashed at issue time and cannot be returned again by any endpoint.
Issue a credential
curl -X POST https://api.infrabox.software/v1/api/mailboxes/smtp-credentials/issue \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_UID" \
-H "Content-Type: application/json" \
-d '{ "uids": ["mb_111"] }'{
"error": false,
"results": [
{
"uid": "mb_111",
"success": true,
"host": "smtp.infrabox.software",
"port": 2587,
"security": "STARTTLS",
"username": "[email protected]",
"password": "generated-once-password",
"rotated": false,
"warning": "shown once"
}
]
}The password is returned exactly once, in this response — save it immediately. Calling
/issue again for a mailbox that already has one does not reissue it (you’ll get
credential_already_issued back) unless you explicitly pass "rotate": true, since rotating
invalidates the old password instantly with no overlap window. Only pass rotate: true when you
mean to break whatever tool is currently using the old one.
Only active (or scheduled_for_cancellation) GOOGLE mailboxes can receive a credential —
anything else comes back as a per-uid error (not_sendable / unsupported_platform) rather than
failing the whole batch. Rate limited to 20 requests / 5 minutes per team.
Read inbox messages (reply detection)
Polls a mailbox’s INBOX for new mail — same domain-wide-delegation grant as sending, no separate setup. Built for reply detection: point a sending tool at this on an interval instead of asking for IMAP (Google’s basic IMAP auth is closed for these mailboxes the same way SMTP AUTH is).
curl -X POST https://api.infrabox.software/v1/api/mailboxes/messages/list \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_UID" \
-H "Content-Type: application/json" \
-d '{ "uids": ["mb_111", "mb_222"], "limit": 20 }'{
"error": false,
"results": [
{
"uid": "mb_111",
"messages": [
{
"id": "19abc0123def4567",
"thread_id": "19abc0123def4567",
"label_ids": ["UNREAD", "CATEGORY_UPDATES", "INBOX"],
"snippet": "This confirms the Infrabox SMTP relay delivers via Gmail API...",
"body_text": "This confirms the Infrabox SMTP relay delivers via Gmail API + domain-wide delegation.",
"from": "[email protected]",
"to": "[email protected]",
"subject": "Re: Quick question",
"date": "Sat, 12 Sep 2026 06:53:16 -0400",
"message_id": "<[email protected]>",
"in_reply_to": null,
"references": null
}
],
"next_cursor": "19abc0123def4567"
}
]
}Pagination is cursor-based, not timestamp-based. Pass the next_cursor you got back for a
mailbox as cursor: { "mb_111": "19abc..." } on the next call — the response then only includes
messages newer than that id, and echoes the same cursor back once nothing new has arrived. Omit a
uid from cursor (or the whole field, on the first call) to fetch its newest page from scratch.
Scope is INBOX only (no Sent/Drafts/other labels), and body_text is a plain-text extract capped
at 5,000 characters — not the raw MIME. Up to 20 uids per call (lower than the credential
endpoints’ 100, since each uid costs one Gmail list call plus up to limit get calls); limit
defaults to 20, capped at 50. Only active (or scheduled_for_cancellation) GOOGLE mailboxes are
supported — others come back as a per-uid error (not_found / not_sendable /
unsupported_platform / temporary_error / permanent_error) rather than failing the whole batch.
Rate limited to 30 requests / 5 minutes per team.
Message content returned here (subjects, bodies, sender addresses) is never persisted on Infrabox’s side beyond the response itself — don’t rely on this endpoint as a message store; fetch what you need and keep it in your own system if you need history.
Errors
| Status | Meaning |
|---|---|
400 | Invalid body/filters |
401 | Missing/invalid API key |
404 | Mailbox, domain, or workspace not found |
500 | Internal error |