# Retrieve all workspaces

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/workspaces:
    get:
      summary: Retrieve all workspaces
      deprecated: false
      description: >-
        Use this endpoint to retrieve a list of all workspaces associated with
        the authenticated user. You can filter the results using pagination
        parameters and an optional search keyword.
      tags:
        - workspaces
      parameters:
        - name: page
          in: query
          description: ''
          required: true
          example: 1,2,3...
          schema:
            type: string
        - name: limit
          in: query
          description: ''
          required: true
          example: 10, 50, 100
          schema:
            type: string
        - name: contains
          in: query
          description: ''
          required: false
          example: tryzapmail.com
          schema:
            type: string
        - 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
      responses:
        '200':
          description: >-
            Default sort order: ascending by creation time (oldest first, newest
            last).
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                status: 200
                message: Workspaces fetched successfully
                data:
                  - id: 123e4567-e89b-12d3-a456-426614174000
                    name: John's Workspace
                    domainCount: '15'
                    mailboxCount: '8'
                    billingDetails:
                      id: 987f6543-b21a-43c8-9876-543210fedcba
                      userId: 123e4567-e89b-12d3-a456-426614174000
                      firstName: John
                      lastName: Doe
                      workspaceId: 123e4567-e89b-12d3-a456-426614174000
                      company: TechCorp
                      addressLineOne: 123 Main Street
                      addressLineTwo: Suite 400
                      addressLineThree: null
                      city: Metropolis
                      state: California
                      country: US
                      postalCode: '90210'
                      phoneCc: '1'
                      phone: '5551234567'
                      languagePreference: en
                  - id: 789d1234-e56b-78c9-a123-098765432112
                    name: Jane's Workspace
                    domainCount: '25'
                    mailboxCount: '12'
                    billingDetails:
                      id: 54321fed-cba9-8765-4321-0fedcba98765
                      userId: 789d1234-e56b-78c9-a123-098765432112
                      firstName: Jane
                      lastName: Smith
                      workspaceId: 789d1234-e56b-78c9-a123-098765432112
                      company: Innovatech
                      addressLineOne: 456 Elm Street
                      addressLineTwo: Apt 101
                      addressLineThree: null
                      city: Gotham
                      state: New York
                      country: US
                      postalCode: '10001'
                      phoneCc: '1'
                      phone: '5559876543'
                      languagePreference: en
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: workspaces
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-13489896-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
