POST /api/v1/auth/intent. Your app shows its own form, collects the address and password, and sends them to the engine. To connect a mailbox without code, for example to test, use the dashboard.
For well-known providers you only need the address and password: the servers are filled in for you (below). For Gmail, see the step-by-step Gmail guide.
The engine checks the settings against both servers before saving the account, so a wrong password or host fails right away, and nothing is stored.
Request
string
required
imap.string
required
The mailbox address. Defaults to
imap_user when omitted.string
One password for both servers.
imap_password and smtp_password override it.IMAP settings
Top level, or inside
connection_params (top-level values win). imap_host is required, except for the providers filled in automatically. imap_user defaults to email.SMTP settings
smtp_host is required, except for the providers filled in automatically. smtp_user and smtp_password default to the IMAP ones.boolean
default:"true"
Copy sent mail into the Sent folder. Turn it off for servers that do it themselves. For
smtp.gmail.com it’s off by default.string
A display name for the account. Defaults to the address.
string
Your own value, sent back in the
account.add event.string
An
acc_… id, to change the settings of an existing IMAP account instead.object
{ "initial_sync_enable": true, "initial_sync_days": 30 } imports the mail already in the mailbox: the last 1 to 30 days (default and maximum 30), without email.new events. See Initial sync. Without it, only new mail is synced.Encryption
imap_encryption and smtp_encryption take SSL, STARTTLS or NONE. When omitted, the engine uses the standard one for the port:
Response
201 Created
account.add event is sent with your state. Passwords are never returned. With config.initial_sync_enable, the account also has an initial_sync object ("status": "pending") and the import starts within seconds: see Initial sync.
Common providers
For these addresses you can leave the servers out: the engine fills them in from the domain. Most of them need an app password, because the account’s normal password is refused.
Google Workspace (Gmail on a company domain) and other custom domains aren’t recognised from the address: pass the servers, for example
imap.gmail.com / smtp.gmail.com for Workspace.
When a known provider rejects the password, the 401 errors/invalid_credentials detail says what that provider needs, for example: “Gmail needs an app password: turn on 2-Step Verification, then create one at https://myaccount.google.com/apppasswords …”.
Outlook.com, Hotmail and Live addresses are refused with
400: Microsoft doesn’t allow password sign-in for them. They can’t be connected yet.Reconnect or change settings
To change the password or servers of an account, send the same request with the account’saccount_id:
200), it keeps its id and its emails, and an account.reconnect event is sent.
Use this to reconnect an account whose status is disconnected, for example after the user changed their password or revoked the app password. See Account status.
From the dashboard
A workspace admin can also connect a mailbox in the dashboard, without code:- Open Accounts → Add account.
- Enter the email address and the password (an app password for Gmail, Yahoo, iCloud and AOL).
- For providers that aren’t filled in automatically, open the server settings and enter the IMAP and SMTP servers.
- Optionally, turn on initial sync to import recent mail.