# Retrieve All Mailboxes

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/mailboxes/list:
    get:
      summary: Retrieve All Mailboxes
      deprecated: false
      description: This endpoint lets you fetch a list of all mailboxes.
      tags:
        - mailbox
      parameters:
        - name: page
          in: query
          description: ''
          required: false
          example: '1'
          schema:
            type: string
        - name: limit
          in: query
          description: ''
          required: false
          example: '10'
          schema:
            type: string
        - name: contains
          in: query
          description: ''
          required: false
          example: example.com
          schema:
            type: string
        - name: x-auth-zapmail
          in: header
          description: ''
          required: true
          example: '{{x-auth-zapmail}}'
          schema:
            type: string
        - name: x-workspace-key
          in: header
          description: ''
          required: false
          example: '{{x-workspace-key}}'
          schema:
            type: string
        - name: x-service-provider
          in: header
          description: ''
          required: false
          example: '{{x-service-provider}}'
          schema:
            type: string
            examples:
              - GOOGLE
              - MICROSOFT
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      totalSearchedCount:
                        type: integer
                      currentPage:
                        type: integer
                      nextPage:
                        type: integer
                      totalPages:
                        type: integer
                      purchasedMailboxes:
                        type: integer
                      totalAssignedMailboxes:
                        type: integer
                      totalAssignedPreWarmedUpMailboxes:
                        type: integer
                      totalActiveMailboxes:
                        type: integer
                      totalActivePreWarmedUpMailboxes:
                        type: integer
                      availableMailboxes:
                        type: integer
                      domainMailboxCounts:
                        type: integer
                      scheduledMailboxes:
                        type: integer
                      expiredMailboxesCount:
                        type: integer
                      domains:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            domain:
                              type: string
                            status:
                              type: string
                            mailboxes:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  username:
                                    type: string
                                  email:
                                    type: string
                                  firstName:
                                    type: string
                                  lastName:
                                    type: string
                                  password:
                                    type: string
                                  appPassword:
                                    type: string
                                    nullable: true
                                  secret:
                                    type: string
                                    nullable: true
                                  recoveryEmail:
                                    type: string
                                  status:
                                    type: string
                                  profilePicture:
                                    type: 'null'
                                  domain:
                                    type: string
                                  domainId:
                                    type: string
                                  assignedOn:
                                    type: string
                                  expireOn:
                                    type: string
                                  createdAt:
                                    type: string
                                  isWarmedUp:
                                    type: boolean
                                required:
                                  - id
                                  - username
                                  - email
                                  - firstName
                                  - lastName
                                  - password
                                  - appPassword
                                  - secret
                                  - recoveryEmail
                                  - status
                                  - profilePicture
                                  - domain
                                  - domainId
                                  - assignedOn
                                  - expireOn
                                  - createdAt
                                  - isWarmedUp
                                x-apidog-orders:
                                  - id
                                  - username
                                  - email
                                  - firstName
                                  - lastName
                                  - password
                                  - appPassword
                                  - secret
                                  - recoveryEmail
                                  - status
                                  - profilePicture
                                  - domain
                                  - domainId
                                  - assignedOn
                                  - expireOn
                                  - createdAt
                                  - isWarmedUp
                            adminDetails:
                              type: object
                              properties:
                                domainId:
                                  type: string
                                email:
                                  type: string
                                newPassword:
                                  type: string
                                secret:
                                  type: string
                                recoveryEmail:
                                  type: string
                              x-apidog-orders:
                                - domainId
                                - email
                                - newPassword
                                - secret
                                - recoveryEmail
                              required:
                                - domainId
                                - email
                                - newPassword
                                - secret
                                - recoveryEmail
                          required:
                            - id
                            - domain
                            - status
                            - mailboxes
                            - adminDetails
                          x-apidog-orders:
                            - id
                            - adminDetails
                            - domain
                            - status
                            - mailboxes
                    required:
                      - totalSearchedCount
                      - currentPage
                      - nextPage
                      - totalPages
                      - purchasedMailboxes
                      - totalAssignedMailboxes
                      - totalActiveMailboxes
                      - availableMailboxes
                      - domains
                      - totalAssignedPreWarmedUpMailboxes
                      - totalActivePreWarmedUpMailboxes
                      - domainMailboxCounts
                      - scheduledMailboxes
                      - expiredMailboxesCount
                    x-apidog-orders:
                      - totalSearchedCount
                      - currentPage
                      - nextPage
                      - totalPages
                      - purchasedMailboxes
                      - totalAssignedMailboxes
                      - totalActiveMailboxes
                      - availableMailboxes
                      - domains
                      - totalAssignedPreWarmedUpMailboxes
                      - totalActivePreWarmedUpMailboxes
                      - domainMailboxCounts
                      - scheduledMailboxes
                      - expiredMailboxesCount
                required:
                  - status
                  - message
                  - data
                x-apidog-orders:
                  - status
                  - message
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    status: 200
                    message: Mailboxes fetched successfully
                    data:
                      totalSearchedCount: 50
                      currentPage: 1
                      nextPage: 2
                      totalPages: 2
                      purchasedMailboxes: 500
                      totalAssignedMailboxes: 20
                      totalActiveMailboxes: 10
                      availableMailboxes: 480
                      domains:
                        - id: 12345abc-defg-6789-hijk-lmnopqrstu12
                          domain: example1.com
                          status: ACTIVE
                          adminDetails:
                            domainId: 12345abc-defg-6789-hijk-lmnopqrstu12
                            email: admin@example1.com
                            newPassword: Wq7$nLpX2vTm
                            secret: JBSWY3DPEHPK3PXP
                            recoveryEmail: recovery.example1.com@example1.com
                          mailboxes:
                            - id: abcd1234-5678-90ef-ghij-klmn12345678
                              username: john.doe
                              email: john.doe@example1.com
                              firstName: John
                              lastName: Doe
                              password: password123
                              appPassword: nfd2 jk43 4jas hfdj
                              secret: gger u434 ebt6 kktm st4d hj41 62tz fe24
                              recoveryEmail: john.doe@example1.com
                              status: ACTIVE
                              profilePicture: null
                              domain: example1.com
                              domainId: 12345abc-defg-6789-hijk-lmnopqrstu12
                              assignedOn: '2025-01-10T09:00:00.000Z'
                              expireOn: '2025-02-10T09:00:00.000Z'
                              createdAt: '2025-01-10T09:00:00.000Z'
                              isWarmedUp: false
                        - id: 6789xyz-wxyz-4567-klmn-7890abcdef12
                          domain: example2.net
                          status: ACTIVE
                          mailboxes:
                            - id: xyz1234-5678-90ab-cdef-ghijk9876543
                              username: jane.smith
                              email: jane.smith@example2.net
                              firstName: Jane
                              lastName: Smith
                              password: password456
                              appPassword: null
                              secret: null
                              recoveryEmail: jane.smith@example2.net
                              status: IN_PROGRESS
                              profilePicture: null
                              domain: example2.net
                              domainId: 6789xyz-wxyz-4567-klmn-7890abcdef12
                              assignedOn: '2025-01-12T11:00:00.000Z'
                              expireOn: '2025-02-12T11:00:00.000Z'
                              createdAt: '2025-01-12T11:00:00.000Z'
                              isWarmedUp: false
                '2':
                  summary: Example 1
                  value:
                    status: 403
                    message: >-
                      You must be the owner or admin of this workspace to access
                      this API
                    errorId: 463259c2-3137-41f1-a330-daba6f42978e
          headers: {}
          x-apidog-name: Success
        '403':
          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: Unauthorized
      security: []
      x-apidog-folder: mailbox
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-13490172-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
