> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenia.team/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Location

> Updates details of an existing location including name, description, coordinates, and membership. Applies validation and business rules such as uniqueness of name within a parent location.



## OpenAPI

````yaml PATCH /api/v1/mgt/workspaces/{workspaceId}/locations/{locationId}
openapi: 3.1.0
info:
  title: Xenia Team API - Update Location
  description: Update an existing location within a workspace.
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/mgt/workspaces/{workspaceId}/locations/{locationId}:
    patch:
      tags:
        - Locations
      summary: Update Location
      description: >-
        Updates details of an existing location including name, description,
        coordinates, and membership. Applies validation and business rules such
        as uniqueness of name within a parent location.
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: UUID of the workspace.
        - name: locationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the location to be updated.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                avatar:
                  type: object
                  properties:
                    color:
                      type: string
                attachments:
                  type: array
                  items:
                    type: string
                    format: uri
                isQREnable:
                  type: boolean
                LevelId:
                  type: string
                  format: uuid
                ParentId:
                  type: string
                  format: uuid
                longitude:
                  type:
                    - number
                    - 'null'
                latitude:
                  type:
                    - number
                    - 'null'
                address:
                  type:
                    - string
                    - 'null'
                memberIds:
                  type: array
                  items:
                    type: string
                    format: uuid
            example:
              name: test location add
              description: location description
              avatar:
                color: '#C5CAE9'
              attachments:
                - https://cdn.xenia.team/.../image1.png
                - https://cdn.xenia.team/.../image2.png
              isQREnable: true
              LevelId: 98329f39-e263-484d-8fa7-e951fcddb9c1
              ParentId: 6c826259-28ea-4e16-8869-b16cbc147633
              latitude: null
              longitude: null
              address: null
              memberIds:
                - dfea8b8a-5b22-4668-b68d-dc641eb3a101
                - e25dd448-7ae7-4588-8767-7e1a316547e5
      responses:
        '200':
          description: Location updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Location'
                  meta:
                    type: object
        '400':
          description: Bad Request - Invalid input data.
        '401':
          description: Unauthorized - Missing or invalid authentication.
        '403':
          description: Forbidden - Insufficient permissions to update location.
        '404':
          description: Not Found - Location or workspace does not exist.
        '500':
          description: Internal Server Error.
      security:
        - clientKey: []
          clientSecret: []
components:
  schemas:
    Location:
      type: object
      properties:
        id:
          type: string
          format: uuid
        HotelId:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        avatar:
          type: object
          properties:
            color:
              type: string
        attachments:
          type: array
          items:
            type: string
            format: uri
        LevelId:
          type:
            - string
            - 'null'
          format: uuid
        ParentId:
          type:
            - string
            - 'null'
          format: uuid
        slugCode:
          type: string
        isQREnable:
          type: boolean
        locationNumber:
          type: integer
        timezone:
          type: string
        coordinates:
          type: object
          properties:
            type:
              type: string
              enum:
                - Point
            coordinates:
              type: array
              items:
                type:
                  - number
                  - 'null'
              minItems: 2
              maxItems: 2
        address:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
        Members:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              fullName:
                type: string
              emailId:
                type: string
              phoneNo:
                type:
                  - string
                  - 'null'
              RoleId:
                type: string
                format: uuid
              timezone:
                type: string
        Level:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            title:
              type: string
            isSite:
              type: boolean
        assetCount:
          type: integer
        Sublocations:
          type: array
          items:
            $ref: '#/components/schemas/Location'
        ParentLocation:
          $ref: '#/components/schemas/Location'
  securitySchemes:
    clientKey:
      type: apiKey
      in: header
      name: x-client-key
    clientSecret:
      type: apiKey
      in: header
      name: x-client-secret

````