# Mailboxes

> Connect, test and tune the mailboxes you send from. 10 REST endpoints with parameters, permissions and curl examples. Each is also an MCP tool.

Canonical: https://ballast.to/docs/api/mailboxes

[API reference](https://ballast.to/docs/api)

Connect, test and tune the mailboxes you send from. 10 endpoints, each also a tool for your AI through [MCP](https://ballast.to/docs/mcp). Authentication and errors are on the [overview](https://ballast.to/docs/api#authentication).

## List mailboxes

GET

/api/v1/mailboxes

Connected sending mailboxes with today's limit, ramp-up and the DNS health of their domain.

MCP tool

list\_mailboxes

Read-only

Returns

- **`mailboxes` required object\[\]**
- **`microsoftEnabled` required boolean**

cURL

```
curl https://ballast.to/api/v1/mailboxes \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```

## Suggest connection settings for an email address

GET

/api/v1/mailboxes/detect

Read-only

Parameters

- **`email` required query · string**

Returns

- **`domain` required string**
- **`provider` required "google" | "microsoft" | "other" | "none"**
- **`providerLabel` required string**
- **`smtp` required object | null**
- **`imap` required object | null**
- **`passwordHint` required object | null**: Where to make an app password, for providers that refuse the normal one

cURL

```
curl https://ballast.to/api/v1/mailboxes/detect?email=<email> \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```

## Test SMTP and IMAP login without saving

POST

/api/v1/mailboxes/test

Owners and admins

Returns

- **`ok` required boolean**
- **`smtp` required object**
- **`imap` required object**

cURL

```
curl -X POST https://ballast.to/api/v1/mailboxes/test \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Connect a mailbox

POST

/api/v1/mailboxes

Tests SMTP and IMAP login first and saves only when both pass. Google needs an app password. Microsoft 365 connects with OAuth from the dashboard.

MCP tool

add\_mailbox

Needs an active plan

Returns

- **`mailbox` required object | null**
- **`test` required object**
- **`waiting` required boolean**: Saved, but no sending IP has room yet: it is tested and starts once one does, usually within a day

cURL

```
curl -X POST https://ballast.to/api/v1/mailboxes \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Import SMTP/IMAP mailboxes in bulk

POST

/api/v1/mailboxes/import

Up to 200 mailboxes per call. Each one is tested and saved only if SMTP and IMAP login pass. Rows without servers get them from the domain's MX: Google Workspace with an app password, known hosts with their presets.

MCP tool

import\_mailboxes

Needs an active plan

MCP asks to confirm

Parameters

- **`rows` required object\[\]**

Returns

- **`added` required number**
- **`results` required object\[\]**

cURL

```
curl -X POST https://ballast.to/api/v1/mailboxes/import \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rows":[]}'
```

## Change a mailbox's limits, signature or status

PATCH

/api/v1/mailboxes/{id}

MCP tool

update\_mailbox

Owners and admins

Parameters

- **`id` required path · string**
- **`displayName` string | null**
- **`signature` string | null**
- **`timezone` string**
- **`status` "active" | "paused"**: Pause or resume sending from this mailbox
- **`limits` object**
- **`restartRamp` boolean**: Start the ramp again from day 1
- **`inboxPoll` boolean**: Read the inbox every 60 s instead of keeping a connection open (fewer simultaneous connections; offered for Google)
- **`credentials` object**: New password (and optionally servers). Tested before saving.

Returns

- **`mailbox` required object**
- **`test` required object | null**

cURL

```
curl -X PATCH https://ballast.to/api/v1/mailboxes/<id> \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"displayName":{},"signature":{}}'
```

## Test a connected mailbox again

POST

/api/v1/mailboxes/{id}/test

MCP tool

test\_mailbox

Owners and admins

Parameters

- **`id` required path · string**

Returns

- **`ok` required boolean**
- **`error` required string | null**

cURL

```
curl -X POST https://ballast.to/api/v1/mailboxes/<id>/test \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Disconnect a mailbox

DELETE

/api/v1/mailboxes/{id}

MCP tool

delete\_mailbox

Owners and admins

MCP asks to confirm

Parameters

- **`id` required path · string**

Returns

- **`ok` required true**

cURL

```
curl -X DELETE https://ballast.to/api/v1/mailboxes/<id> \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```

## Create a sign-in link for a Google or Microsoft mailbox

POST

/api/v1/mailboxes/oauth-sessions

Returns a URL to open in a browser and sign in as that mailbox. The link works once, for that address only, for 24 hours; poll the session for the result. 409 when the address is already connected in this workspace another way, or in another workspace you are a member of; a mailbox connected in any other Ballast workspace ends the session failed once the sign-in proves the mailbox is yours. Google needs the Workspace admin to mark Ballast's Google client as trusted first; Microsoft tenants that block third-party apps need admin consent for Ballast's app.

MCP tool

create\_mailbox\_sign\_in\_link

Needs an active plan

Parameters

- **`provider` required "google" | "microsoft"**
- **`email` required string**

Returns

- **`id` required string**
- **`provider` required "google" | "microsoft"**
- **`email` required string**
- **`status` required "pending" | "completed" | "failed" | "expired"**: pending until the mailbox signs in; completed with mailboxId; failed with error; expired after 24 hours
- **`error` required string | null**
- **`mailboxId` required string | null**
- **`expiresAt` required string**
- **`createdAt` required string**
- **`completedAt` required string | null**
- **`url` required string**

cURL

```
curl -X POST https://ballast.to/api/v1/mailboxes/oauth-sessions \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider":"google","email":"<email>"}'
```

## Read a mailbox sign-in link's status

GET

/api/v1/mailboxes/oauth-sessions/{id}

MCP tool

get\_mailbox\_sign\_in\_link

Read-only

Parameters

- **`id` required path · string**

Returns

- **`id` required string**
- **`provider` required "google" | "microsoft"**
- **`email` required string**
- **`status` required "pending" | "completed" | "failed" | "expired"**: pending until the mailbox signs in; completed with mailboxId; failed with error; expired after 24 hours
- **`error` required string | null**
- **`mailboxId` required string | null**
- **`expiresAt` required string**
- **`createdAt` required string**
- **`completedAt` required string | null**

cURL

```
curl https://ballast.to/api/v1/mailboxes/oauth-sessions/<id> \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```
