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

# Get a unit (parent or child) by id (BO)



## OpenAPI

````yaml /api/bo/openapi.json get /bo/units/v1/{id}
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/{id}:
    get:
      tags:
        - units
      summary: Get a unit (parent or child) by id (BO)
      operationId: getUnitBOV1
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - actions-info
                - updatable-fields
                - parent
                - nb-children
                - organization
                - created-by
                - logo-url
              description: >-
                Extend options (JSON-encoded array, e.g.
                `?extend=["category"]`):

                - "actions-info": Projects `{ canBeUpdated, canBeDeleted,
                canBeArchived, canBeUnarchived }`.

                - "updatable-fields": Per-field write rules for this unit in its
                current state.

                - "parent": Parent unit summary (null on a parent unit).

                - "nb-children": Number of non-deleted children (always 0 on a
                child unit) and QR codes.

                - "organization": The unit's organization (id, name, type,
                accessStatus).

                - "created-by": The BO admin who created this unit.

                - "logo-url": Presigned download URL for the unit logo (null
                when no logo).
          in: query
          name: extend
          required: false
        - 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: path
          name: id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                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*)*$
                  type:
                    type: string
                    enum:
                      - parent
                      - child
                  name:
                    type: string
                    minLength: 1
                    maxLength: 150
                  description:
                    nullable: true
                    type: string
                    maxLength: 1000
                  serialNumber:
                    nullable: true
                    type: string
                    minLength: 1
                    maxLength: 20
                  openedAt:
                    nullable: true
                    type: string
                    format: date-time
                  logo:
                    nullable: true
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        maxLength: 255
                      mimeType:
                        type: string
                        minLength: 1
                        maxLength: 100
                      size:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        maximum: 1073741824
                      storageKey:
                        type: string
                        minLength: 1
                        maxLength: 512
                    required:
                      - name
                      - mimeType
                      - size
                      - storageKey
                    additionalProperties: false
                  activityTypes:
                    type: array
                    items:
                      type: string
                      enum:
                        - J
                        - L
                        - M
                        - 'N'
                        - O
                        - P
                        - R
                        - S
                        - T
                        - U
                        - V
                        - W
                        - X
                        - 'Y'
                        - PA
                        - CTS
                        - SG
                        - OA
                        - REF
                        - PS
                        - GHA
                        - GHO
                        - GHR
                        - GHS
                        - GHTC
                        - GHU
                        - GHW1
                        - GHW2
                        - GHZ
                        - ITGH
                  classifications:
                    type: array
                    items:
                      type: string
                      enum:
                        - erp
                        - ert
                        - igh
                        - icpe
                        - hab
                        - other
                  totalSurfaceArea:
                    nullable: true
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    maximum: 9007199254740991
                  publicCapacity:
                    nullable: true
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  privateCapacity:
                    nullable: true
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  pinCode:
                    type: string
                    pattern: ^\d{6}$
                  pinCodeRequired:
                    type: boolean
                  accessInstructions:
                    nullable: true
                    type: string
                    maxLength: 1000
                  leafletDispatchedAt:
                    nullable: true
                    type: string
                    format: date-time
                  onboardingStatus:
                    nullable: true
                    type: string
                    enum:
                      - pending
                      - in_progress
                      - on_hold
                      - completed
                  organizationId:
                    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)$
                  createdByBoUserId:
                    nullable: true
                    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)$
                  addressCountry:
                    nullable: true
                    type: string
                    minLength: 1
                    maxLength: 200
                  addressCity:
                    nullable: true
                    type: string
                    minLength: 1
                    maxLength: 200
                  addressPostalCode:
                    nullable: true
                    type: string
                    minLength: 1
                    maxLength: 20
                  addressStreet:
                    nullable: true
                    type: string
                    minLength: 1
                    maxLength: 200
                  category:
                    nullable: true
                    type: string
                    enum:
                      - '1'
                      - '2'
                      - '3'
                      - '4'
                      - '5'
                  commissionPeriodicityYears:
                    nullable: true
                    anyOf:
                      - type: number
                        enum:
                          - 3
                      - type: number
                        enum:
                          - 5
                  parentId:
                    nullable: true
                    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)$
                  sortOrder:
                    nullable: true
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  archivedAt:
                    nullable: true
                    type: string
                    format: date-time
                  deletedAt:
                    nullable: true
                    type: string
                    format: date-time
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                  actions:
                    type: object
                    properties:
                      canBeUpdated:
                        type: boolean
                      canBeDeleted:
                        type: boolean
                      canBeArchived:
                        type: boolean
                      canBeUnarchived:
                        type: boolean
                    required:
                      - canBeUpdated
                      - canBeDeleted
                      - canBeArchived
                      - canBeUnarchived
                    additionalProperties: false
                  updatableFields:
                    type: object
                    properties:
                      name:
                        type: boolean
                      description:
                        type: boolean
                      serialNumber:
                        type: boolean
                      openedAt:
                        type: boolean
                      accessInstructions:
                        type: boolean
                      activityTypes:
                        type: boolean
                      classifications:
                        type: boolean
                      totalSurfaceArea:
                        type: boolean
                      publicCapacity:
                        type: boolean
                      privateCapacity:
                        type: boolean
                      pinCodeRequired:
                        type: boolean
                      pinCode:
                        type: boolean
                      addressCountry:
                        type: boolean
                      addressCity:
                        type: boolean
                      addressPostalCode:
                        type: boolean
                      addressStreet:
                        type: boolean
                      category:
                        type: boolean
                      commissionPeriodicityYears:
                        type: boolean
                      onboardingStatus:
                        type: boolean
                      leafletDispatchedAt:
                        type: boolean
                    required:
                      - name
                      - description
                      - serialNumber
                      - openedAt
                      - accessInstructions
                      - activityTypes
                      - classifications
                      - totalSurfaceArea
                      - publicCapacity
                      - privateCapacity
                      - pinCodeRequired
                      - pinCode
                      - addressCountry
                      - addressCity
                      - addressPostalCode
                      - addressStreet
                      - category
                      - commissionPeriodicityYears
                      - onboardingStatus
                      - leafletDispatchedAt
                    additionalProperties: false
                  parent:
                    nullable: true
                    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
                    required:
                      - id
                      - ref
                      - name
                      - type
                    additionalProperties: false
                  nbChildren:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  nbQrCodes:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  organization:
                    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)$
                      name:
                        type: string
                      type:
                        type: string
                      accessStatus:
                        type: string
                    required:
                      - id
                      - name
                      - type
                      - accessStatus
                    additionalProperties: false
                  createdBy:
                    nullable: true
                    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)$
                      name:
                        type: string
                      email:
                        type: string
                    required:
                      - id
                      - name
                      - email
                    additionalProperties: false
                  logoUrl:
                    nullable: true
                    type: string
                    format: uri
                required:
                  - id
                  - ref
                  - type
                  - name
                  - description
                  - serialNumber
                  - openedAt
                  - logo
                  - activityTypes
                  - classifications
                  - totalSurfaceArea
                  - publicCapacity
                  - privateCapacity
                  - pinCode
                  - pinCodeRequired
                  - accessInstructions
                  - leafletDispatchedAt
                  - onboardingStatus
                  - organizationId
                  - createdByBoUserId
                  - addressCountry
                  - addressCity
                  - addressPostalCode
                  - addressStreet
                  - category
                  - commissionPeriodicityYears
                  - parentId
                  - sortOrder
                  - archivedAt
                  - deletedAt
                  - createdAt
                  - updatedAt
                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

````