# Facility Layout API Reference

## Base URL

`/api/layout`

## Properties

- `GET /properties`: Get all properties with full Building -> Floor -> Room hierarchy.
- `POST /properties`: Create a new property. Automatically creates "Main Building" and "Floor 1".

## Buildings

- `POST /buildings`: Create a new building under a property.

## Floors

- `GET /floors/:id`: Get specific floor with its rooms and sections.
- `POST /floors`: Create a new floor.
- `POST /floors/:id/layout`: Bulk save layout (upsert/delete rooms) for a floor.

## Rooms

- `POST /rooms`: Create a single room.
- `PUT /rooms/:id`: Update room details (position, size, type).
- `DELETE /rooms/:id`: Delete a room.

## Sections

- `POST /sections`: Create a section (rack/table) within a room. Auto-generates positions.
- `GET /sections/:id`: Get section details including individual positions and plant assignments.

## Positions

- `GET /positions/:id/address`: Generate the full hierarchical address string (e.g., `WOLF.MAIN.F1.VEG.T1.R1.C1`) for a position.
