# Export mailboxes

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/exports/mailboxes:
    post:
      summary: Export mailboxes
      deprecated: false
      description: >
        This endpoint allows you to export mailboxes to a third-party
        application or as a CSV file.


        ## Request Body


        | Name         | Type    | Description |

        |-------------|--------|-------------|

        | `apps`      | `array` | Name of third-party apps where mailboxes
        should be exported. To export as a CSV file, use `["MANUAL"]`. |

        | `ids` (Optional) | `array` | IDs of mailboxes to export. |

        | `excludeIds` (Optional) | `array` | IDs of mailboxes that should not
        be exported. |

        | `tagIds` (Optional) | `array` | Tag IDs of domains. |

        | `contains` (Optional) | `string` | Search filter for mailbox fields
        matching specific text. |

        | `status` (Optional) | `string` | Specify the status of mailboxes to
        export. |

        | `thirdPartyAccountId` (Optional) | `string` | Pin export to a specific
        third-party account. Required when multiple accounts of the same app
        exist in the workspace. |


        ## Example Request


        ```json

        {
            "apps": ["MANUAL"],
            "ids": ["a4333491-23dd-3d2q-8523-8eccfc2e82a6b", "4333491-23dd-3d2q-4333491-23dd"],
            "excludeIds": ["4333491-23dd-3d2q-8523-8eccfc2e82a6b"],
            "tagIds": ["tag1", "tag2"],
            "contains": "example",
            "status": "active",
            "thirdPartyAccountId": "3f9c2a7e-6d14-4b8a-9f2e-1c7d5e8b4a91"
        }
      tags:
        - export
      parameters:
        - name: x-auth-zapmail
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
        - name: x-workspace-key
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
        - name: ' x-service-provider'
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                apps:
                  type: array
                  items:
                    type: string
                    enum:
                      - REACHINBOX
                      - INSTANTLY
                      - SMARTLEAD
                      - REPLY_IO
                      - EMELIA
                      - FIRSTQUADRANT
                      - WARMY
                      - SUPERAGI
                      - LEMLIST
                      - PIPL
                      - LUELLA
                      - MASTER_INBOX
                      - SNOV
                      - EMAILGUARD
                      - EMAILBISON
                    x-apidog-enum:
                      - value: REACHINBOX
                        name: REACHINBOX
                        description: ''
                      - value: INSTANTLY
                        name: INSTANTLY
                        description: ''
                      - value: SMARTLEAD
                        name: SMARTLEAD
                        description: ''
                      - value: REPLY_IO
                        name: REPLY_IO
                        description: ''
                      - value: EMELIA
                        name: EMELIA
                        description: ''
                      - value: FIRSTQUADRANT
                        name: FIRSTQUADRANT
                        description: ''
                      - value: WARMY
                        name: WARMY
                        description: ''
                      - value: SUPERAGI
                        name: SUPERAGI
                        description: ''
                      - value: LEMLIST
                        name: LEMLIST
                        description: ''
                      - value: PIPL
                        name: PIPL
                        description: ''
                      - value: LUELLA
                        name: LUELLA
                        description: ''
                      - value: MASTER_INBOX
                        name: MASTER_INBOX
                        description: ''
                      - value: SNOV
                        name: SNOV
                        description: ''
                      - value: EMAILGUARD
                        name: EMAILGUARD
                        description: ''
                      - value: EMAILBISON
                        name: EMAILBISON
                        description: ''
                ids:
                  type: array
                  items:
                    type: string
                excludeIds:
                  type: array
                  items:
                    type: string
                tagIds:
                  type: array
                  items:
                    type: string
                status:
                  type: string
                  enum:
                    - ACTIVE
                    - IN_PROGRESS
                    - CREATING_PASSWORD
                    - EXPIRED
                    - FAILED
                  x-apidog-enum:
                    - value: ACTIVE
                      name: ACTIVE
                      description: ''
                    - value: IN_PROGRESS
                      name: IN PROGRESS
                      description: ''
                    - value: CREATING_PASSWORD
                      name: CREATING_PASSWORD
                      description: ''
                    - value: EXPIRED
                      name: EXPIRED
                      description: ''
                    - value: FAILED
                      name: FAILED
                      description: ''
                contains:
                  type: string
                thirdPartyAccountId:
                  type: string
                  description: >
                    Pin export to a specific third-party account. Required when
                    multiple accounts of the same app exist in the workspace.
              required:
                - apps
                - ids
                - excludeIds
                - tagIds
                - status
                - contains
              x-apidog-orders:
                - apps
                - ids
                - excludeIds
                - tagIds
                - status
                - contains
                - thirdPartyAccountId
            example:
              apps:
                - REACHINBOX
              ids:
                - a66ccca7-d465-464a-887b-90bce6d09bbb
              excludeIds: []
              tagIds: []
              status: ''
              contains: ''
              thirdPartyAccountId: 3f9c2a7e-6d14-4b8a-9f2e-1c7d5e8b4a91
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                status: 200
                message: Mailboxes export is started. It may take sometime to export
                data: null
          headers: {}
          x-apidog-name: Success
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  errorId:
                    type: string
                required:
                  - status
                  - message
                  - errorId
          headers: {}
          x-apidog-name: No mailbox found
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  data:
                    type: 'null'
                required:
                  - status
                  - message
                  - data
                x-apidog-orders:
                  - status
                  - message
                  - data
              example:
                status: 422
                message: >-
                  Multiple <APP> accounts exist for this workspace —
                  <accountId|thirdPartyAccountId> is required.
                data: null
          headers: {}
          x-apidog-name: Unprocessable Entity
      security: []
      x-apidog-folder: export
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-13490737-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
