API Reference
Every endpoint below is documented with request parameters, example requests, and real response shapes.
Authentication
All requests require an API key sent via the Authorization header.
Authorization: Bearer <YOUR_BANSOSMAIL_API_KEY>
Base URL
https://www.bansosmail.com/api/v1
/inboxesAuto-generate a new protected inbox. Omit domain/username to get a random address on the default active public domain — the exact flow for spinning up a throwaway inbox to receive an OTP or verification link.
Parameters
domainPublic domain to use — optional, defaults to the first active oneusernameLocal part (3–64 lowercase letters/digits/._-) — optional, randomly generated if omitted
curl -X POST \
-H "Authorization: Bearer bm_live_..." \
-H "Content-Type: application/json" \
-d '{}' \
https://www.bansosmail.com/api/v1/inboxesResponse
{
"id": "ib_abc123",
"address": "kx8pd2m1@tinghohoa.me",
"domain": "tinghohoa.me",
"created_at": "2026-07-23T04:59:06.919Z"
}/inboxes?address=:addressLook up an inbox your key owns by its full email address.
Parameters
addressFull email address — required
curl -H "Authorization: Bearer bm_live_..." \ "https://www.bansosmail.com/api/v1/inboxes?address=kx8pd2m1@tinghohoa.me"
Response
{
"id": "ib_abc123",
"username": "kx8pd2m1",
"domain": "tinghohoa.me",
"domain_kind": "public",
"kind": "protected",
"created_at": "2026-07-23T04:59:06.919Z"
}/inboxes/:id/messagesRetrieve all non-expired messages for an inbox, newest first, within the 24-hour retention window.
Parameters
idInbox ID (uuid) — required
curl -H "Authorization: Bearer bm_live_..." \ https://www.bansosmail.com/api/v1/inboxes/ib_abc123/messages
Response
{
"messages": [
{
"id": "msg_abc",
"from_address": "sender@example.com",
"subject": "Your verification code",
"text_body": "Your code is 428193",
"received_at": "2026-07-22T10:30:00Z",
"expires_at": "2026-07-23T10:30:00Z"
}
]
}/inboxes/:id/messages/latestFetch only the most recent non-expired message — the exact endpoint for polling an inbox for its OTP or verification link right after triggering it.
Parameters
idInbox ID (uuid) — required
curl -H "Authorization: Bearer bm_live_..." \ https://www.bansosmail.com/api/v1/inboxes/ib_abc123/messages/latest
Response
{
"message": {
"id": "msg_abc",
"from_address": "noreply@example.com",
"subject": "Your verification code is 482913",
"text_body": "Your one-time verification code is 482913.",
"received_at": "2026-07-23T04:59:48.318Z",
"expires_at": "2026-07-24T04:59:48.318Z"
}
}/inboxes/:id/messages/:messageIdFetch a single message including full HTML and plain-text body.
Parameters
idInbox ID (uuid) — requiredmessageIdMessage ID (uuid) — required
curl -H "Authorization: Bearer bm_live_..." \ https://www.bansosmail.com/api/v1/inboxes/ib_abc123/messages/msg_abc
Response
{
"id": "msg_abc",
"from_address": "sender@example.com",
"subject": "Your verification code",
"text_body": "Your code is 428193",
"html_body": "<p>Your code is <b>428193</b></p>",
"received_at": "2026-07-22T10:30:00Z",
"expires_at": "2026-07-23T10:30:00Z"
}/inboxes/:id/messages/:messageIdPermanently delete a message and its metadata.
Parameters
idInbox ID (uuid) — requiredmessageIdMessage ID (uuid) — required
curl -X DELETE \ -H "Authorization: Bearer bm_live_..." \ https://www.bansosmail.com/api/v1/inboxes/ib_abc123/messages/msg_abc
Response
{ "deleted": true }Error Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad request |
| 401 | Missing/invalid API key |
| 403 | Insufficient permissions |
| 404 | Not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
429.