> ## 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.

# Get Locations - No Sub Locations Hierarchy

> Fetches all locations for a given workspace as a flat array by using `notree=true` query param. Useful for dropdowns, filters, or simple listings.



## OpenAPI

````yaml GET /api/v1/mgt/workspaces/{workspaceId}/locations?notree=true
openapi: 3.1.0
info:
  title: Xenia Team API - Get Locations (Flat List)
  description: >-
    Returns all locations in a flat (non-hierarchical) list for a given
    workspace. The response does not include nested `Sublocations`.
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/mgt/workspaces/{workspaceId}/locations?notree=true:
    get:
      tags:
        - Locations
      summary: Get Flat Locations List
      description: >-
        Fetches all locations for a given workspace as a flat array by using
        `notree=true` query param. Useful for dropdowns, filters, or simple
        listings.
      parameters:
        - name: workspaceId
          in: path
          required: true
          description: UUID of the workspace.
          schema:
            type: string
            format: uuid
        - name: notree
          in: query
          required: false
          description: If true, returns a flat list instead of a hierarchical tree.
          schema:
            type: boolean
          example: true
      responses:
        '200':
          description: Locations retrieved successfully in flat format.
          content:
            application/json:
              example:
                data:
                  - id: 8099a742-c9bb-40a7-976e-1963a07e77b6
                    HotelId: cb363f7e-c52a-4478-911d-f6a6f791090e
                    name: Testing 1
                    description: ''
                    avatar:
                      color: '#B2DFDB'
                    ParentId: 2f169333-21f1-4197-8cac-cd0860a83515
                    LevelId: null
                    slugCode: testing-1
                    isQREnable: false
                    locationNumber: 226
                    attachments: []
                    deletedTimestamp: '0'
                    CreatedBy: dfea8b8a-5b22-4668-b68d-dc641eb3a101
                    UpdatedBy: dfea8b8a-5b22-4668-b68d-dc641eb3a101
                    DeletedBy: null
                    timezone: Asia/Karachi
                    coordinates:
                      type: Point
                      coordinates:
                        - null
                        - null
                    address: null
                    createdAt: '2025-06-18T11:39:28.164Z'
                    updatedAt: '2025-06-18T11:39:28.164Z'
                    deletedAt: null
                    Members:
                      - photo: >-
                          https://cdn.xenia.team/00158aa1-f9d0-4b68-ba11-6dee2ce89aa1/2024/1/16/12218415/a-137917-d-ae-2-a-4-baf-8-b-40-4914-c-697-e-6-f-8.jpg
                        fullName: Full User (China)
                        id: e25dd448-7ae7-4588-8767-7e1a316547e5
                        firstName: Full User
                        lastName: (China)
                        emailId: nihad2@yopmail.com
                        phoneNo: '+923345020366'
                        deletedAt: null
                        timezone: Asia/Karachi
                        RoleId: 4ccf0b65-fb99-40da-92d6-3f98730df8b2
                        defaultLocationId: a13ddb59-3e5c-4bdd-8673-fc913b93b9db
                        type: user
                    Level: null
                    assetCount: 0
                extra_meta:
                  message: ''
        '400':
          description: Bad Request - Invalid workspace ID format.
        '401':
          description: Unauthorized - Missing or invalid authentication.
        '403':
          description: Forbidden - Insufficient permissions to access locations.
        '404':
          description: Not Found - Workspace does not exist.
        '500':
          description: Internal Server Error.
      security:
        - clientKey: []
          clientSecret: []
components:
  securitySchemes:
    clientKey:
      type: apiKey
      in: header
      name: x-client-key
    clientSecret:
      type: apiKey
      in: header
      name: x-client-secret

````