> ## Documentation Index
> Fetch the complete documentation index at: https://api-documentation.kare-app.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Parent units with their children nested, for one organization (BO)



## OpenAPI

````yaml /api/bo/openapi.json get /bo/units/v1/tree
openapi: 3.0.3
info:
  title: KARE API
  description: Backend API for the KARE platform
  version: dev
servers:
  - url: http://localhost:3000
    description: Local dev
security: []
tags:
  - name: better-auth
    description: >-
      Better Auth's own endpoints (sign-in, session, MFA, password) - generated
      from the audience's live config via `generateOpenAPISchema()`, not
      hand-written.
paths:
  /bo/units/v1/tree:
    get:
      tags:
        - units
      summary: Parent units with their children nested, for one organization (BO)
      operationId: listUnitsTreeBOV1
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: query
          name: organizationId
          required: true
        - schema:
            anyOf:
              - type: boolean
              - type: string
            example: true
          in: query
          name: whereIncludeArchived
          required: false
          description: Filter value as a boolean
        - schema:
            anyOf:
              - type: boolean
              - type: string
            example: true
          in: query
          name: whereIncludeDeleted
          required: false
          description: Filter value as a boolean
        - schema:
            type: array
            items:
              not: {}
          in: query
          name: extend
          required: false
          description: No extend options available for this route.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    unit:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        ref:
                          type: string
                          maxLength: 40
                          pattern: ^[A-Z]+-[1-9]\d*(?:-[A-Z]+-[1-9]\d*)*$
                        name:
                          type: string
                          minLength: 1
                          maxLength: 150
                        type:
                          type: string
                          enum:
                            - parent
                            - child
                        classifications:
                          type: array
                          items:
                            type: string
                            enum:
                              - erp
                              - ert
                              - igh
                              - icpe
                              - hab
                              - other
                        category:
                          nullable: true
                          type: string
                          enum:
                            - '1'
                            - '2'
                            - '3'
                            - '4'
                            - '5'
                      required:
                        - id
                        - ref
                        - name
                        - type
                        - classifications
                        - category
                      additionalProperties: false
                    children:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          ref:
                            type: string
                            maxLength: 40
                            pattern: ^[A-Z]+-[1-9]\d*(?:-[A-Z]+-[1-9]\d*)*$
                          name:
                            type: string
                            minLength: 1
                            maxLength: 150
                          type:
                            type: string
                            enum:
                              - parent
                              - child
                          sortOrder:
                            nullable: true
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                        required:
                          - id
                          - ref
                          - name
                          - type
                          - sortOrder
                        additionalProperties: false
                  required:
                    - unit
                    - children
                  additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false

````