API referenceEmail accounts
POST
/email/api/v1/accounts

IMAP/SMTP with a password (MAIL), or Google / Microsoft with your OAuth app's tokens (GOOGLE_OAUTH, OUTLOOK, with oauth_app_id), or a service app's delegated access (no token). Every host you name must be public (400 otherwise). A password login is checked first: a refused one is 401 errors/invalid_credentials and nothing is created. The mailbox starts CONNECTING; CREATION_SUCCESS arrives when the engine has connected it. No history is synced: events start from now. With a client key, connects, reconnects and login checks together are limited to 120 per 10 minutes per client (429 with retry_after_ms).

Authorization

X-API-KEY<token>

Your API key from the console (gw_live_…).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

The three kinds of connection in one body, plus Swarmhit's: oauth_app_id, email, name, expires_at, imap_tls / smtp_tls.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/email/api/v1/accounts" \  -H "Content-Type: application/json" \  -d '{    "provider": "MAIL",    "imap_user": "jane@acme.com",    "imap_password": "app-password",    "imap_host": "imap.acme.com",    "imap_port": 993,    "imap_encryption": "SSL",    "smtp_user": "jane@acme.com",    "smtp_password": "app-password",    "smtp_host": "smtp.acme.com",    "smtp_port": 465  }'
{  "object": "AccountCreated",  "account_id": "em_gX2kP9qL4mT7vB1nR8sW3yZ"}