Account

Register new account

Registers new IMAP account to be synced<br/><br/>Credentials are not verified while handling this request. The account connects afterwards, and an authentication failure surfaces as an authenticationError state rather than an error here. Use the account verification endpoint to test credentials up front.

post/v1/account

Request

  • Base URL: https://your-emailengine-host
  • URL: https://your-emailengine-host/v1/account
  • Auth: HTTP bearer

Headers

x-ee-timeoutinteger

Request timeout in milliseconds. Raises the command timeout above the EENGINE_TIMEOUT default for a long-running request; a value below the default has no effect

Example:30000

Request body

accountstring nullable required

Account ID. If set to null, a unique ID will be generated automatically

namestring required

Display name for the account

emailstring

Default email address of the account

expectedEmailstring

Pins the account to an email address

pathstring[] nullable

Mailbox folders to monitor for changes (IMAP only). Use "*" to monitor all folders (default)

subconnectionsstring[]

Additional mailbox paths to monitor with dedicated IMAP connections for faster change detection. Use sparingly as connection limits are strict.

webhooksstring

Account-specific webhook URL

copyboolean nullable

Copy submitted messages to Sent folder. Set to null to unset and use provider specific default.

logsboolean

Store recent logs

notifyFromstring date-time nullable

Only send webhooks for messages received after this date. Defaults to account creation time. IMAP only.

proxystring

Proxy for this account, used instead of the instance-wide proxy: its IMAP and SMTP connections and, for an OAuth2 account, its token requests and Gmail API or MS Graph API calls

smtpEhloNamestring nullable

Hostname to use in SMTP EHLO/HELO commands (defaults to system hostname)

imapIndexer'full' | 'fast' nullable

Override the global IMAP indexing strategy for this account

localestring

Optional locale

tzstring

Optional timezone

Example request

{
  "account": "example",
  "name": "Nyan Cat",
  "email": "nyan.cat@example.com",
  "imap": {
    "auth": {
      "user": "nyan.cat",
      "pass": "sercretpass"
    },
    "host": "mail.example.com",
    "port": 993,
    "secure": true
  },
  "smtp": {
    "auth": {
      "user": "nyan.cat",
      "pass": "secretpass"
    },
    "host": "mail.example.com",
    "port": 465,
    "secure": true
  }
}

Response

Returns the registered account, including the generated account ID when one was not supplied.

accountstring

Unique identifier for the email account

state'existing' | 'new'

Whether the account was created or updated. Not present when a redirect URL is returned

redirectstring

OAuth2 authorization URL. Returned instead of account and state when the request used oauth2.authorize=true - send the user to this URL to complete the OAuth2 flow

Example response

{
  "account": "user123",
  "state": "new",
  "redirect": "https://emailengine.example.com/oauth?account=example"
}

Changes

No recorded changes to this operation across all 1 revision of this API.