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

# The plant as one tree.

> Sites, the locations inside them, the assets standing in those, the assets inside those, and each
asset's bill of materials. node_key/parent_key are the edges, sort_path is the reading order and
depth is the indent (UI spec §14.7).



## OpenAPI

````yaml /api-reference/openapi.json get /asset_hierarchy
openapi: 3.0.0
info:
  description: ''
  title: >-
    The only schema PostgREST exposes (ADR-014). Reads are security_invoker
    views; writes are SECURITY DEFINER functions. Rebuilt wholesale on every
    deploy — it holds no data.
  version: 12.2.3
servers:
  - url: https://app.assetinfinity.ai/api
security: []
tags:
  - name: Signing in
  - name: Profile
  - name: Assets
  - name: Asset lifecycle
  - name: Work lifecycle
  - name: Maintenance
  - name: Inventory
  - name: Inventory detail
  - name: Procurement
  - name: Contracts
  - name: Workforce
  - name: Capacity
  - name: Dispatch
  - name: Routing
  - name: Tools
  - name: Inspections
  - name: Verification
  - name: Reliability
  - name: Parts demand
  - name: Sensors and meters
  - name: Map
  - name: Floor plans
  - name: Labels
  - name: Lost and found
  - name: Root cause analysis
  - name: Reports
  - name: Audit center
  - name: Activity
  - name: Notifications
  - name: Channels
  - name: Search
  - name: Copilot
  - name: Import
  - name: Files
  - name: Sync
  - name: Support
  - name: Admin
  - name: Access
  - name: Lookups
  - name: Read models
  - name: Branding
  - name: Custom fields
  - name: Form studio
  - name: Workflows
  - name: Workflow studio
  - name: Rules
  - name: Statuses and transitions
  - name: Currencies and locales
  - name: Work configuration
  - name: Asset configuration
  - name: Inventory configuration
  - name: Tool configuration
  - name: Workforce configuration
  - name: Vendor and contract configuration
  - name: Document configuration
  - name: Inspection configuration
  - name: Sites, locations and the organisation
  - name: Platform
  - name: Self verification
  - name: Setup
  - name: Tools on a job, and who has them out
  - name: Vendors and contracts
  - name: Work order execution
  - name: Workforce detail
externalDocs:
  description: PostgREST Documentation
  url: https://postgrest.org/en/v12/references/api.html
paths:
  /asset_hierarchy:
    get:
      tags:
        - Assets
      summary: The plant as one tree.
      description: >-
        Sites, the locations inside them, the assets standing in those, the
        assets inside those, and each

        asset's bill of materials. node_key/parent_key are the edges, sort_path
        is the reading order and

        depth is the indent (UI spec §14.7).
      parameters:
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.node_key'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.parent_key'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.node_kind'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.depth'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.sort_path'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.node_id'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.site_id'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.location_id'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.asset_id'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.part_id'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.code'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.name'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.type_name'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.status_label'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.status_category'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.criticality'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.criticality_rank'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.health_score'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.open_work_orders'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.asset_count'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.part_count'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.quantity'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.unit_of_measure'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.available_quantity'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.is_critical'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.position_label'
        - $ref: >-
            #/components/parameters/rowFilter.asset_hierarchy.replacement_interval_months
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.serial_number'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.manufacturer'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.model_name'
        - $ref: >-
            #/components/parameters/rowFilter.asset_hierarchy.parent_asset_number
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.site_code'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.location_name'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.is_active'
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.is_retired'
        - $ref: >-
            #/components/parameters/rowFilter.asset_hierarchy.primary_image_file_id
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.commissioning_date'
        - $ref: >-
            #/components/parameters/rowFilter.asset_hierarchy.warranty_expires_on
        - $ref: '#/components/parameters/rowFilter.asset_hierarchy.updated_at'
        - $ref: '#/components/parameters/select'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/range'
        - $ref: '#/components/parameters/rangeUnit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/preferCount'
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/asset_hierarchy'
                type: array
            application/vnd.pgrst.object+json:
              schema:
                items:
                  $ref: '#/components/schemas/asset_hierarchy'
                type: array
            application/vnd.pgrst.object+json;nulls=stripped:
              schema:
                items:
                  $ref: '#/components/schemas/asset_hierarchy'
                type: array
            text/csv:
              schema:
                items:
                  $ref: '#/components/schemas/asset_hierarchy'
                type: array
          description: OK
        '206':
          description: Partial Content
components:
  parameters:
    rowFilter.asset_hierarchy.node_key:
      in: query
      name: node_key
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.parent_key:
      in: query
      name: parent_key
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.node_kind:
      in: query
      name: node_kind
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.depth:
      in: query
      name: depth
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.sort_path:
      in: query
      name: sort_path
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.node_id:
      in: query
      name: node_id
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.site_id:
      in: query
      name: site_id
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.location_id:
      in: query
      name: location_id
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.asset_id:
      in: query
      name: asset_id
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.part_id:
      in: query
      name: part_id
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.code:
      in: query
      name: code
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.name:
      in: query
      name: name
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.type_name:
      in: query
      name: type_name
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.status_label:
      in: query
      name: status_label
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.status_category:
      in: query
      name: status_category
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.criticality:
      in: query
      name: criticality
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.criticality_rank:
      in: query
      name: criticality_rank
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.health_score:
      in: query
      name: health_score
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.open_work_orders:
      in: query
      name: open_work_orders
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.asset_count:
      in: query
      name: asset_count
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.part_count:
      in: query
      name: part_count
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.quantity:
      in: query
      name: quantity
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.unit_of_measure:
      in: query
      name: unit_of_measure
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.available_quantity:
      in: query
      name: available_quantity
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.is_critical:
      in: query
      name: is_critical
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.position_label:
      in: query
      name: position_label
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.replacement_interval_months:
      in: query
      name: replacement_interval_months
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.serial_number:
      in: query
      name: serial_number
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.manufacturer:
      in: query
      name: manufacturer
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.model_name:
      in: query
      name: model_name
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.parent_asset_number:
      in: query
      name: parent_asset_number
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.site_code:
      in: query
      name: site_code
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.location_name:
      in: query
      name: location_name
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.is_active:
      in: query
      name: is_active
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.is_retired:
      in: query
      name: is_retired
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.primary_image_file_id:
      in: query
      name: primary_image_file_id
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.commissioning_date:
      in: query
      name: commissioning_date
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.warranty_expires_on:
      in: query
      name: warranty_expires_on
      required: false
      schema:
        type: string
    rowFilter.asset_hierarchy.updated_at:
      in: query
      name: updated_at
      required: false
      schema:
        type: string
    select:
      description: Filtering Columns
      in: query
      name: select
      required: false
      schema:
        type: string
    order:
      description: Ordering
      in: query
      name: order
      required: false
      schema:
        type: string
    range:
      description: Limiting and Pagination
      in: header
      name: Range
      required: false
      schema:
        type: string
    rangeUnit:
      description: Limiting and Pagination
      in: header
      name: Range-Unit
      required: false
      schema:
        default: items
        type: string
    offset:
      description: Limiting and Pagination
      in: query
      name: offset
      required: false
      schema:
        type: string
    limit:
      description: Limiting and Pagination
      in: query
      name: limit
      required: false
      schema:
        type: string
    preferCount:
      description: Preference
      in: header
      name: Prefer
      required: false
      schema:
        enum:
          - count=none
        type: string
  schemas:
    asset_hierarchy:
      description: >-
        The plant as one tree.


        Sites, the locations inside them, the assets standing in those, the
        assets inside those, and each

        asset's bill of materials. node_key/parent_key are the edges, sort_path
        is the reading order and

        depth is the indent (UI spec §14.7).
      properties:
        asset_count:
          format: bigint
          type: integer
        asset_id:
          format: uuid
          type: string
        available_quantity:
          format: numeric
          type: number
        code:
          format: text
          type: string
        commissioning_date:
          format: date
          type: string
        criticality:
          format: text
          type: string
        criticality_rank:
          format: integer
          type: integer
        depth:
          format: integer
          type: integer
        health_score:
          format: numeric
          type: number
        is_active:
          format: boolean
          type: boolean
        is_critical:
          format: boolean
          type: boolean
        is_retired:
          format: boolean
          type: boolean
        location_id:
          format: uuid
          type: string
        location_name:
          format: text
          type: string
        manufacturer:
          format: text
          type: string
        model_name:
          format: text
          type: string
        name:
          format: text
          type: string
        node_id:
          format: uuid
          type: string
        node_key:
          format: text
          type: string
        node_kind:
          format: text
          type: string
        open_work_orders:
          format: bigint
          type: integer
        parent_asset_number:
          format: text
          type: string
        parent_key:
          format: text
          type: string
        part_count:
          format: bigint
          type: integer
        part_id:
          description: >-
            Note:

            This is a Foreign Key to `inventory_available.part_id`.<fk
            table='inventory_available' column='part_id'/>
          format: uuid
          type: string
        position_label:
          format: text
          type: string
        primary_image_file_id:
          format: uuid
          type: string
        quantity:
          format: numeric
          type: number
        replacement_interval_months:
          format: integer
          type: integer
        serial_number:
          format: text
          type: string
        site_code:
          format: text
          type: string
        site_id:
          format: uuid
          type: string
        sort_path:
          format: text[]
          items:
            type: string
          type: array
        status_category:
          format: text
          type: string
        status_label:
          format: text
          type: string
        type_name:
          format: text
          type: string
        unit_of_measure:
          format: text
          type: string
        updated_at:
          format: timestamp with time zone
          type: string
        warranty_expires_on:
          format: date
          type: string
      type: object

````

## Related topics

- [The capacity plan](/work/capacity.md)
- [Setting up the plant](/setup/overview.md)
- [The dispatch board](/work/dispatch.md)
- [Sites and organisation](/setup/sites.md)
- [Core concepts](/core-concepts.md)
