Account management
Connect mailboxes, read your usage and watch account health from code.
The same API keys, with three extra permissions: email.manage, account.usage and account.health, all off by default. WhatsApp accounts are managed with whatsapp.manage — see the WhatsApp page.
Rules worth knowing
- Delete means deactivate. Through the API, DELETE switches an account off: sending is refused, polling stops, nothing is erased. PATCH with
is_active: truebrings it back. Permanent deletion is only available in the dashboard. - Scope.
email.manageneeds at least one SMTP account bound to the key, or “all SMTP accounts” — pick the latter to create the very first one. An account outside the key's bindings answers 403ACCOUNT_NOT_AUTHORIZED. A key bound to specific accounts is bound to the accounts it creates. - Connection first. An SMTP or IMAP account is saved only once its connection test succeeds (
SMTP_CONNECTION_FAILED,IMAP_CONNECTION_FAILED). The host must be a public mail server (INVALID_HOSTotherwise). - Plan limits apply as in the dashboard: creating beyond your plan's SMTP account limit returns 403.
- Passwords are accepted, stored encrypted, and never returned. Request fields are snake_case, responses camelCase, like the rest of the API.
Endpoints
| Method | Path | Permission | |
|---|---|---|---|
| GET | List the SMTP accounts this key may use | any email binding | |
| POST | Create an SMTP account (connection tested first) | email.manage | |
| GET | Get an SMTP account and its IMAP side | email.manage | |
| PATCH | Update an SMTP account (is_active: true re-enables it) | email.manage | |
| DELETE | Deactivate an SMTP account and its IMAP side — nothing is erased | email.manage | |
| POST | Test the SMTP connection | email.manage | |
| GET | Get the IMAP receiving side | email.manage | |
| POST | Add IMAP receiving (connection tested first) | email.manage | |
| PATCH | Update the IMAP side (is_active: true re-enables it) | email.manage | |
| DELETE | Deactivate IMAP polling — nothing is erased | email.manage | |
| POST | Test the IMAP connection | email.manage | |
| GET | List the folders of the mailbox | email.manage | |
| POST | Fetch new e-mail now | email.manage | |
| GET | Plan, monthly usage and account limits | account.usage | |
| GET | Health of the e-mail accounts | account.health |
Connect a mailbox (SMTP)
POST /api/v1/smtp-accounts
Request
{
"success": true,
"data": {
"id": "7c1f…",
"name": "Support",
"host": "smtp.example.com",
"port": 587,
"username": "support@example.com",
"fromEmail": "support@example.com",
"fromName": "Example Support",
"tls": false,
"dailyLimit": null,
"hourlyLimit": null,
"unsubscribeFooter": false,
"isActive": true,
"backupSmtpAccountId": null,
"createdAt": "2026-10-16T09:00:00.000Z",
"updatedAt": "2026-10-16T09:00:00.000Z",
"imap": null
}
}Receive e-mail (IMAP)
POST /api/v1/smtp-accounts/:id/imap
One IMAP side per SMTP account. Incoming mail then reaches the inbox, the AI agents and your webhooks; polling starts immediately.
curl -X POST https://sendy.cloud/api/v1/smtp-accounts/SMTP_ACCOUNT_ID/imap \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "host": "imap.example.com", "port": 993, "username": "support@example.com", "password": "app-password" }'Usage
GET /api/v1/account/usage
The counters the monthly quota is enforced on, and how many accounts you have against your plan. limit: null means unlimited.
{
"success": true,
"data": {
"period": "2026-10",
"plan": { "name": "Starter", "slug": "starter" },
"monthly": {
"emails": { "used": 3200, "limit": 10000 },
"whatsapp": { "used": 140, "limit": 1000 },
"sms": { "used": 0, "limit": 500 },
"aiCredits": { "used": 87, "limit": 500 }
},
"resources": {
"smtpAccounts": { "used": 2, "limit": 2 },
"whatsappAccounts": { "used": 1, "limit": 1 },
"smsGateways": { "used": 0, "limit": 1 },
"aiAgents": { "used": 1, "limit": 1 }
}
}
}Health
GET /api/v1/account/health
One entry per SMTP account within the key's scope, with a summary status: error (open critical incident or last SMTP check down), warning (open warning, blacklist listing, SPF/DKIM/DMARC not passing, IMAP failing), inactive or ok.
{
"success": true,
"data": {
"smtpAccounts": [
{
"id": "7c1f…",
"name": "Support",
"fromEmail": "support@example.com",
"isActive": true,
"status": "warning",
"smtp": { "status": "up", "responseTimeMs": 182, "error": null, "checkedAt": "2026-10-16T08:55:00.000Z" },
"imap": { "isActive": true, "lastPolledAt": "2026-10-16T08:58:12.000Z", "consecutiveFailures": 0 },
"dns": { "domain": "example.com", "spf": "pass", "dkim": "missing", "dmarc": "pass", "checkedAt": "2026-10-16T03:00:00.000Z" },
"blacklist": { "listedOn": [], "totalChecked": 12, "checkedAt": "2026-10-16T06:00:00.000Z" },
"warmup": null,
"alerts": []
}
]
}
}