---
title: "Preview Shelter Definition"
method: POST
path: "/v1/shelter-definitions/preview"
tags: ["shelter-definitions"]
---

# Preview Shelter Definition

`POST /v1/shelter-definitions/preview`

## Request

- Base URL: `https://api.shapemaker.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.shapemaker.io/v1/shelter-definitions/preview`
- Auth: OAuth 2
  - Password
  - Token URL: `/v1/auth`

This endpoint renders a shelter type in 3D without saving it, so the
library dialog can show the type being created or edited. It reads and
writes nothing: the geometry comes from the request body and the shapes
are the same ones the site scene builds.

## Request body

- ShelterDefinitionUpdateInput
  - `name` string, required
  - `widthM` number, required
  - `depthM` number, required
  - `heightM` number, required
  - `roofHeightM` number, required
  - `doorWall` 'FRONT' | 'BACK' | 'LEFT' | 'RIGHT': Which shelter wall the door, or the feeder tray, sits in. Named from the shelter's own shape rather than the site: the duopitch ridge runs along the width axis, so FRONT and BACK are the gable ends and LEFT and RIGHT are the long eave walls. In shelter-local axes (x along the width, y along the depth), the wall each name refers to is: - FRONT: the +x gable end - BACK: the -x gable end - LEFT: the -y long wall - RIGHT: the +y long wall shelter_wall_axes in app/modules/geometry_definitions/shelter/position.py is the single source of these directions; keep the two in step. Alembic does not detect changes in enums, so the enum constraint has to be manually migrated when changing this enum
  - `doorOffsetM` number, nullable
  - `doorWidthM` number, nullable
  - `trayWall` 'FRONT' | 'BACK' | 'LEFT' | 'RIGHT': Which shelter wall the door, or the feeder tray, sits in. Named from the shelter's own shape rather than the site: the duopitch ridge runs along the width axis, so FRONT and BACK are the gable ends and LEFT and RIGHT are the long eave walls. In shelter-local axes (x along the width, y along the depth), the wall each name refers to is: - FRONT: the +x gable end - BACK: the -x gable end - LEFT: the -y long wall - RIGHT: the +y long wall shelter_wall_axes in app/modules/geometry_definitions/shelter/position.py is the single source of these directions; keep the two in step. Alembic does not detect changes in enums, so the enum constraint has to be manually migrated when changing this enum
  - `trayOffsetM` number, nullable
  - `partitionOffsetM` number, nullable
  - `partitionDoorWidthM` number, nullable
  - `partitionDoorOffsetM` number, nullable
  - `partitionHasDoor` boolean

## Response `200`

Successful Response

- ShelterDefinitionPreviewView: The 3D shapes of a shelter type on its own, for the library thumbnail. Stood at the scene origin: no site, so no feeder tray and no tower.
  - `shapes` RenderableShape3D[], required
    - `type` 'box' | 'pipe' | 'prism' | 'cylinder' | 'tapered_cylinder', required
    - `geometry` union, required
      - BoxDimension
        - `height` number, required
        - `width` number, required
        - `depth` number, required
      - CylinderDimension
        - `length` number, required
        - `diameter` number, required
      - PolylineDimension
        - `points` Point[], required
          - `x` number, required
          - `y` number, required
          - `z` number, required
          - `point_number` integer
        - `is_closed` boolean, required
      - TaperedCylinderDimension
        - `length` number, required
        - `diameter_bottom` number, required
        - `diameter_top` number, required
        - `sides` integer, required
      - NoDimension
    - `matrix` number[], required
    - `material` Material, required
      - `color` string, required
      - `opacity` number
      - `roughness` number
      - `metalness` number

## Other responses

- `400`: Bad Request
- `422`: Validation Error

---

[API](https://skmtc.dev/shapemaker/apis/shapemaker-api.md) - [All operations](https://skmtc.dev/shapemaker/apis/shapemaker-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shapemaker/apis/shapemaker-api/revisions/b8461cf1236c?raw)
