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

# Create Location



## OpenAPI

````yaml POST /api/v1/mgt/workspaces/{workspaceId}/locations
openapi: 3.1.0
info:
  title: Xenia API - Create Location
  version: 1.0.0
  description: Create a new location with optional sublocations in a workspace.
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/mgt/workspaces/{workspaceId}/locations:
    post:
      tags:
        - Locations
      summary: Create Location with Sublocations
      description: >-
        Creates a new location and optionally sublocations. Also attaches
        members, QR settings, and attachments.
      parameters:
        - name: workspaceId
          in: path
          required: true
          description: UUID of the workspace.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                  nullable: true
                ParentId:
                  type: string
                  format: uuid
                  nullable: true
                LevelId:
                  type: string
                  format: uuid
                  nullable: true
                attachments:
                  type: array
                  items:
                    type: string
                    format: uri
                Sublocations:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                    required:
                      - name
                isQREnable:
                  type: boolean
                memberIds:
                  type: array
                  items:
                    type: string
                    format: uuid
                longitude:
                  type: number
                  nullable: true
                latitude:
                  type: number
                  nullable: true
                address:
                  type: string
                  nullable: true
              required:
                - name
            example:
              LevelId: 98329f39-e263-484d-8fa7-e951fcddb9c1
              name: test location add
              ParentId: 6c826259-28ea-4e16-8869-b16cbc147633
              memberIds:
                - dfea8b8a-5b22-4668-b68d-dc641eb3a101
                - e25dd448-7ae7-4588-8767-7e1a316547e5
              description: location description
              isQREnable: true
              attachments:
                - https://cdn.xenia.team/.../screenshot-1.png
                - https://cdn.xenia.team/.../screenshot-2.png
              Sublocations:
                - name: sub location name
                  description: ''
      responses:
        '200':
          description: Location created successfully.
          content:
            application/json:
              example:
                data:
                  id: 9300f92a-299b-4a55-9953-e96bc4a6954e
                  workspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                  name: test location add
                  description: location description
                  slugCode: test-location-add
                  Members: []
                  Sublocations: []
                  Level:
                    id: 98329f39-e263-484d-8fa7-e951fcddb9c1
                    title: Store
                    isSite: true
                  ParentLocation:
                    id: 6c826259-28ea-4e16-8869-b16cbc147633
                    name: site a2
                meta: {}
        '400':
          description: Bad Request - Invalid input data.
        '401':
          description: Unauthorized - Missing or invalid authentication.
        '403':
          description: Forbidden - Insufficient permissions to create locations.
        '404':
          description: Not Found - Workspace does not exist.
        '409':
          description: Conflict - Location with the same name already exists.
        '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

````