# Update workspace

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/workspaces:
    put:
      summary: Update workspace
      deprecated: false
      description: >-
        Use this endpoint to update an existing workspace’s name. Make sure the
        workspace ID is correct and that the new name does not conflict with
        another workspace in your 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:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
              x-apidog-orders:
                - id
                - name
            example:
              id: b9085239-6bb1-479b-8a30-271f7d6f904e
              name: New Workspace
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      userId:
                        type: string
                      name:
                        type: string
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      deletedAt:
                        type: 'null'
                    required:
                      - id
                      - userId
                      - name
                      - createdAt
                      - updatedAt
                      - deletedAt
                    x-apidog-orders:
                      - id
                      - userId
                      - name
                      - createdAt
                      - updatedAt
                      - deletedAt
                required:
                  - status
                  - message
                  - data
                x-apidog-orders:
                  - status
                  - message
                  - data
              example:
                status: 200
                message: Workspace updated successfully
                data:
                  id: b9085239-6bb1-479b-8a30-271f7d6f904e
                  userId: fbf34af0-be3b-4add-bd97-462e2471f65d
                  name: New Workspace
                  createdAt: '2024-08-09T06:08:47.459Z'
                  updatedAt: '2024-08-09T06:17:20.331Z'
                  deletedAt: 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
              example:
                status: 404
                message: Workspace not found
                errorId: 86bb4730-a0f5-4568-9075-cddb8d00ba20
          headers: {}
          x-apidog-name: Not Found
        '409':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  errorId:
                    type: string
                required:
                  - status
                  - message
                  - errorId
              example:
                status: 409
                message: Workspace with the same name already exists
                errorId: f57315b8-96ca-460b-9f23-0965d0885d98
          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-13489975-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
