# Create new workspace

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/workspaces:
    post:
      summary: Create new workspace
      deprecated: false
      description: >-
        Use this endpoint to create a new workspace for your Zapmail account.
        Each workspace can hold domains, mailboxes, and user-specific settings.
        Workspace names must be unique per account.
      tags:
        - workspaces
      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:
                name:
                  type: string
                billingDetails:
                  type: object
                  properties:
                    company:
                      type: string
                    firstName:
                      type: string
                    lastName:
                      type: string
                    addressLineOne:
                      type: string
                    addressLineTwo:
                      type: string
                    addressLineThree:
                      type: string
                    city:
                      type: string
                    state:
                      type: string
                    country:
                      type: string
                    postalCode:
                      type: string
                    phoneCc:
                      type: string
                    phone:
                      type: string
                    languagePreference:
                      type: string
                  required:
                    - company
                    - firstName
                    - lastName
                    - addressLineOne
                    - city
                    - state
                    - country
                    - postalCode
                    - phoneCc
                    - phone
                    - languagePreference
                  x-apidog-orders:
                    - company
                    - firstName
                    - lastName
                    - addressLineOne
                    - addressLineTwo
                    - addressLineThree
                    - city
                    - state
                    - country
                    - postalCode
                    - phoneCc
                    - phone
                    - languagePreference
              required:
                - name
              x-apidog-orders:
                - name
                - billingDetails
            example:
              name: New Workspace
              billingDetails:
                company: Tech Solutions Ltd.
                firstName: John
                lastName: Doe
                addressLineOne: 1234 Elm Street
                addressLineTwo: Apt 567
                addressLineThree: null
                city: San Francisco
                state: California
                country: USA
                postalCode: '94107'
                phoneCc: '+1'
                phone: '4151234567'
                languagePreference: en
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      userId:
                        type: string
                      updatedAt:
                        type: string
                      createdAt:
                        type: string
                      deletedAt:
                        type: 'null'
                    required:
                      - id
                      - name
                      - userId
                      - updatedAt
                      - createdAt
                      - deletedAt
                    x-apidog-orders:
                      - id
                      - name
                      - userId
                      - updatedAt
                      - createdAt
                      - deletedAt
                required:
                  - status
                  - message
                  - data
                x-apidog-orders:
                  - status
                  - message
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    status: 200
                    message: Workspace created successfully
                    data:
                      id: f69cde69-ab43-4168-b78b-77a50a02b8dd
                      name: New Workspace
                      userId: fbf34af0-be3b-4add-bd97-462e2471f65d
                      updatedAt: '2024-08-09T06:10:04.855Z'
                      createdAt: '2024-08-09T06:10:04.855Z'
                      deletedAt: null
                '2':
                  summary: 409 - Workspace already exists
                  value:
                    status: 409
                    message: Workspace with the same name already exists
                    errorId: 8b45f1a8-6ae8-47eb-8f99-b2eac942853e
          headers: {}
          x-apidog-name: Success
        '409':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  errorId:
                    type: string
                required:
                  - status
                  - message
                  - errorId
                x-apidog-orders:
                  - status
                  - message
                  - errorId
              example:
                status: 409
                message: Workspace with the same name already exists
                errorId: 5ec7b4e6-3693-49f5-ade3-84158c6c2daa
          headers: {}
          x-apidog-name: Conflict
      security: []
      x-apidog-folder: workspaces
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-13489947-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
