> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fuseai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import SMTP/IMAP mailboxes

> Connects up to 250 SMTP/IMAP mailboxes in one request, as the app's CSV import does; each mailbox takes the fields of POST /business/accounts/email/smtp. Mailboxes refused before any login come back at once in `skipped`, by their place in `mailboxes`: an address repeated in the request (the first one is kept), one connected through Gmail or Outlook or as a mailbox bought through Fuse, a Microsoft SMTP host, and new mailboxes past what your plan's seats leave room for. A background job then connects the rest one by one exactly as POST /business/accounts/email/smtp does (a mailbox you already connected over SMTP is updated), and a notification in the app says how many connected; a mailbox whose login fails is left out, so check GET /business/accounts?channel=email once GET /business/accounts/email/smtp/bulk/status reads `isImporting: false`. Your imports run one at a time: one sent while another, or a connect of mailboxes bought through Fuse, is still running answers 409 `MAILBOX_IMPORT_IN_PROGRESS` and imports nothing; send it again once the import status reads `isImporting: false`. Passwords are stored encrypted and never returned or logged. Answers 202. Send an `X-Idempotency-Key` header of 8 to 200 characters to make retries safe: the same request with the same key within 24 hours answers the first import's answer and imports nothing again, and the key on a different request answers 409. A first request refused before anything was imported (any 4xx) can be retried under its key; one that failed with a server error answers 409 `IDEMPOTENCY_KEY_OUTCOME_UNKNOWN`: check GET /business/accounts/email/smtp/bulk/status and the account list before importing again with a new key. Rate limit: 5 requests per minute, 20 per day.

Errors:
- `403` `EMAIL_ACCOUNT_LIMIT_REACHED` — Your plan's mailbox seats are all in use and every mailbox in the request would be a new one, so none can be connected.
- `409` `SMTP_INBOX_SYNC_DISABLED` — Inbox syncing for SMTP mailboxes is switched off, so imported mailboxes could not receive replies. Nothing was imported.
- `409` `MAILBOX_IMPORT_IN_PROGRESS` — An import of yours, or a connect of mailboxes bought through Fuse, is still running. Nothing was imported; send it again once the import status reads `isImporting: false`.
- `422` `VALIDATION_FAILED` — `mailboxes` is missing, empty or longer than 250, or a mailbox misses a required field, has a host that is not a host name or a port that is not a port, or carries an unknown field, or the `X-Idempotency-Key` header was sent with a value outside 8-200 characters.
- `409` `IDEMPOTENCY_KEY_IN_USE` — A request with this `X-Idempotency-Key` is still being processed; retry it shortly to get its result. If it keeps answering this, the first request stopped before its result was recorded: check the import status before importing again with a new key.
- `409` `IDEMPOTENCY_KEY_REUSED` — This `X-Idempotency-Key` was sent in the last 24 hours with a different request; nothing was imported.
- `409` `IDEMPOTENCY_KEY_OUTCOME_UNKNOWN` — The first request with this `X-Idempotency-Key` failed with a server error after it may have started the import, so nothing more was done. Check the import status and the account list before importing again with a new key.
- `429` `RATE_LIMITED` — More than 5 imports in a minute, or 20 in a day, for this token owner: the app's own import limit. Retry after the Retry-After / RateLimit-Reset seconds.

Requires one of the following token scopes: accounts.



## OpenAPI

````yaml /openapi.json post /business/accounts/email/smtp/bulk
openapi: 3.1.0
info:
  title: Fuse Business API
  version: 1.0.0
  description: >-
    External API for lists, campaigns, prospect search and contacts.
    Authenticate with your API token as HTTP Basic. All paths are under /api/v1.
servers:
  - url: https://api.tryfuse.ai/api/v1
    description: Production
security:
  - basicAuth: []
tags:
  - name: Lists
  - name: Custom columns
  - name: Smart columns
  - name: Exports
  - name: Campaigns
  - name: Knowledge hubs
  - name: Analytics
  - name: Website intent
  - name: LinkedIn
  - name: Conversations
  - name: Account
  - name: Sending accounts
  - name: Data
  - name: Prospect search
  - name: Campaign steps
  - name: Scheduled sends
  - name: Campaign templates
  - name: Tracking domains
  - name: Agents
  - name: Research
  - name: Company search
  - name: Saved searches
  - name: Folders
  - name: Exclusions
  - name: Contacts
paths:
  /business/accounts/email/smtp/bulk:
    post:
      tags:
        - Sending accounts
      summary: Import SMTP/IMAP mailboxes
      description: >-
        Connects up to 250 SMTP/IMAP mailboxes in one request, as the app's CSV
        import does; each mailbox takes the fields of POST
        /business/accounts/email/smtp. Mailboxes refused before any login come
        back at once in `skipped`, by their place in `mailboxes`: an address
        repeated in the request (the first one is kept), one connected through
        Gmail or Outlook or as a mailbox bought through Fuse, a Microsoft SMTP
        host, and new mailboxes past what your plan's seats leave room for. A
        background job then connects the rest one by one exactly as POST
        /business/accounts/email/smtp does (a mailbox you already connected over
        SMTP is updated), and a notification in the app says how many connected;
        a mailbox whose login fails is left out, so check GET
        /business/accounts?channel=email once GET
        /business/accounts/email/smtp/bulk/status reads `isImporting: false`.
        Your imports run one at a time: one sent while another, or a connect of
        mailboxes bought through Fuse, is still running answers 409
        `MAILBOX_IMPORT_IN_PROGRESS` and imports nothing; send it again once the
        import status reads `isImporting: false`. Passwords are stored encrypted
        and never returned or logged. Answers 202. Send an `X-Idempotency-Key`
        header of 8 to 200 characters to make retries safe: the same request
        with the same key within 24 hours answers the first import's answer and
        imports nothing again, and the key on a different request answers 409. A
        first request refused before anything was imported (any 4xx) can be
        retried under its key; one that failed with a server error answers 409
        `IDEMPOTENCY_KEY_OUTCOME_UNKNOWN`: check GET
        /business/accounts/email/smtp/bulk/status and the account list before
        importing again with a new key. Rate limit: 5 requests per minute, 20
        per day.


        Errors:

        - `403` `EMAIL_ACCOUNT_LIMIT_REACHED` — Your plan's mailbox seats are
        all in use and every mailbox in the request would be a new one, so none
        can be connected.

        - `409` `SMTP_INBOX_SYNC_DISABLED` — Inbox syncing for SMTP mailboxes is
        switched off, so imported mailboxes could not receive replies. Nothing
        was imported.

        - `409` `MAILBOX_IMPORT_IN_PROGRESS` — An import of yours, or a connect
        of mailboxes bought through Fuse, is still running. Nothing was
        imported; send it again once the import status reads `isImporting:
        false`.

        - `422` `VALIDATION_FAILED` — `mailboxes` is missing, empty or longer
        than 250, or a mailbox misses a required field, has a host that is not a
        host name or a port that is not a port, or carries an unknown field, or
        the `X-Idempotency-Key` header was sent with a value outside 8-200
        characters.

        - `409` `IDEMPOTENCY_KEY_IN_USE` — A request with this
        `X-Idempotency-Key` is still being processed; retry it shortly to get
        its result. If it keeps answering this, the first request stopped before
        its result was recorded: check the import status before importing again
        with a new key.

        - `409` `IDEMPOTENCY_KEY_REUSED` — This `X-Idempotency-Key` was sent in
        the last 24 hours with a different request; nothing was imported.

        - `409` `IDEMPOTENCY_KEY_OUTCOME_UNKNOWN` — The first request with this
        `X-Idempotency-Key` failed with a server error after it may have started
        the import, so nothing more was done. Check the import status and the
        account list before importing again with a new key.

        - `429` `RATE_LIMITED` — More than 5 imports in a minute, or 20 in a
        day, for this token owner: the app's own import limit. Retry after the
        Retry-After / RateLimit-Reset seconds.


        Requires one of the following token scopes: accounts.
      operationId: importSmtpMailboxes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mailboxes:
                  type: array
                  items:
                    type: object
                    properties:
                      emailAddress:
                        type: string
                        format: email
                        maxLength: 320
                        description: >-
                          The mailbox's address. Stored trimmed and lower-cased;
                          it becomes the account's `id`.
                      name:
                        type: string
                        maxLength: 200
                        description: >-
                          Sender name for a new mailbox, up to 200 characters.
                          Reconnecting an existing mailbox keeps its current
                          name.
                      smtpHost:
                        type: string
                        description: >-
                          Outgoing (SMTP) server host name, for example
                          `smtp.zoho.com`.
                      smtpPort:
                        type: number
                        default: 465
                        description: >-
                          Outgoing server port: 465 for implicit TLS (default),
                          587 for STARTTLS.
                      smtpSecure:
                        type: boolean
                        default: true
                        description: >-
                          true (default) for implicit TLS (port 465), false for
                          STARTTLS (port 587).
                      imapHost:
                        type: string
                        description: >-
                          Incoming (IMAP) server host name, for example
                          `imap.zoho.com`.
                      imapPort:
                        type: number
                        default: 993
                        description: 'Incoming server port: 993 (default) for implicit TLS.'
                      imapSecure:
                        type: boolean
                        default: true
                        description: true (default) for implicit TLS.
                      authUser:
                        type: string
                        maxLength: 320
                        description: >-
                          Login user name when it differs from `emailAddress`;
                          omitted or empty logs in as `emailAddress`.
                      password:
                        type: string
                        minLength: 1
                        maxLength: 1024
                        description: >-
                          The mailbox password, or an app password where the
                          provider requires one (2-step verification on).
                          Verified with a live login, stored encrypted, never
                          returned or logged.
                    required:
                      - emailAddress
                      - smtpHost
                      - imapHost
                      - password
                  minItems: 1
                  maxItems: 250
                  description: >-
                    The mailboxes to connect, 1-250, each with the fields of
                    POST /business/accounts/email/smtp. A refused one is
                    reported by its place in this array (`index`, from 0).
              required:
                - mailboxes
      responses:
        '202':
          description: Success
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Requests permitted in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: integer
                    description: The mailboxes in the request.
                  connectingRows:
                    type: integer
                    description: >-
                      The mailboxes the background job is connecting; 0 when
                      every one was refused.
                  skipped:
                    type: array
                    description: The mailboxes refused before any login was tried.
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                          description: The mailbox's place in `mailboxes`, from 0.
                        reason:
                          type: string
                          enum:
                            - DUPLICATE_IN_REQUEST
                            - EMAIL_ACCOUNT_ALREADY_CONNECTED
                            - PURCHASED_MAILBOX
                            - MICROSOFT_OAUTH_REQUIRED
                            - EMAIL_ACCOUNT_LIMIT_REACHED
                          description: >-
                            `DUPLICATE_IN_REQUEST`: the address appears earlier
                            in `mailboxes`, which is the one connected.
                            `EMAIL_ACCOUNT_ALREADY_CONNECTED`: the address is
                            connected through Gmail or Outlook.
                            `PURCHASED_MAILBOX`: the address is connected as a
                            mailbox bought through Fuse, which reconnects from
                            the app's Domain Management.
                            `MICROSOFT_OAUTH_REQUIRED`: a Microsoft SMTP host
                            (smtp.office365.com and the like), whose IMAP
                            refuses password logins.
                            `EMAIL_ACCOUNT_LIMIT_REACHED`: past the new
                            mailboxes your plan's seats leave room for.
                      required:
                        - index
                        - reason
                required:
                  - totalRows
                  - connectingRows
                  - skipped
              example:
                totalRows: 4
                connectingRows: 2
                skipped:
                  - index: 2
                    reason: DUPLICATE_IN_REQUEST
                  - index: 3
                    reason: MICROSOFT_OAUTH_REQUIRED
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - basicAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            param:
              type:
                - string
                - 'null'
            doc_url:
              type:
                - string
                - 'null'
            request_id:
              type:
                - string
                - 'null'
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Your API token (`af_…`) as the Basic-auth username, with an empty
        password.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.