> ## 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 building work



## OpenAPI

````yaml /api/rs/openapi.json get /rs/building-works/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:
  /rs/building-works/v1/{id}:
    get:
      tags:
        - building-works
      summary: Get a building work
      operationId: getBuildingWorkRSV1
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - units
                - commission
                - counts
                - created-by
                - documents
                - actions-info
                - updatable-fields
              description: >-
                Extend options (JSON-encoded array, e.g.
                `?extend=["category"]`):

                - "units": Adds `units` (the active units this building work
                targets).

                - "commission": Adds `commission` (the most recently held safety
                commission, or null).

                - "counts": Adds `_count` of linked documents, commissions and
                units.

                - "created-by": Adds the building work author (`createdByUser`
                with display name).

                - "documents": Adds `documents` (the files attached to this
                building work, with a presigned download URL each).

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

                - "updatable-fields": Per-field write rules for this building
                work in its current state.
          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*)*$
                  authorizationNumber:
                    type: string
                    minLength: 1
                    maxLength: 200
                  status:
                    type: string
                    enum:
                      - rejected
                      - pending
                      - approved
                      - partially_received
                      - received
                  description:
                    nullable: true
                    type: string
                    maxLength: 2000
                  workNature:
                    nullable: true
                    type: string
                    maxLength: 200
                  contractorName:
                    nullable: true
                    type: string
                    maxLength: 200
                  supervisingTechnicianName:
                    nullable: true
                    type: string
                    maxLength: 200
                  architectName:
                    nullable: true
                    type: string
                    maxLength: 200
                  receivedAt:
                    nullable: true
                    type: string
                    format: date-time
                  startAt:
                    nullable: true
                    type: string
                    format: date-time
                  endAt:
                    nullable: true
                    type: string
                    format: date-time
                  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
                  units:
                    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
                      required:
                        - id
                        - ref
                        - name
                      additionalProperties: false
                  commission:
                    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*)*$
                      visitType:
                        type: string
                        enum:
                          - vc
                          - vr
                          - vp
                          - vrp
                      status:
                        type: string
                        enum:
                          - to_schedule
                          - scheduled
                          - in_progress
                          - pending
                          - completed
                          - late
                      decision:
                        nullable: true
                        type: string
                        enum:
                          - favorable
                          - unfavorable
                          - no_opinion
                          - not_provided
                      heldAt:
                        nullable: true
                        type: string
                        format: date-time
                    required:
                      - id
                      - ref
                      - visitType
                      - status
                      - decision
                      - heldAt
                    additionalProperties: false
                  _count:
                    type: object
                    properties:
                      documents:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      commissions:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      units:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                    required:
                      - documents
                      - commissions
                      - units
                    additionalProperties: false
                  createdByUser:
                    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
                    required:
                      - id
                      - name
                    additionalProperties: false
                  documents:
                    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: 255
                        type:
                          type: string
                          enum:
                            - cerfa
                            - security_notice
                            - plan
                            - fire_safety_instructions
                            - evacuation_plan
                            - intervention_plan
                            - bl
                            - invoice
                            - quote
                            - schema
                            - pv
                            - rvre
                            - cr
                            - contract
                            - other
                        mimeType:
                          type: string
                          minLength: 1
                          maxLength: 100
                        size:
                          type: integer
                          minimum: 0
                          exclusiveMinimum: true
                          maximum: 1073741824
                        createdAt:
                          type: string
                          format: date-time
                        downloadUrl:
                          type: string
                          format: uri
                      required:
                        - id
                        - ref
                        - name
                        - type
                        - mimeType
                        - size
                        - createdAt
                        - downloadUrl
                      additionalProperties: false
                  actions:
                    type: object
                    properties:
                      canBeUpdated:
                        type: boolean
                      canBeReceived:
                        type: boolean
                      canBeArchived:
                        type: boolean
                      canBeUnarchived:
                        type: boolean
                      canBeDeleted:
                        type: boolean
                    required:
                      - canBeUpdated
                      - canBeReceived
                      - canBeArchived
                      - canBeUnarchived
                      - canBeDeleted
                    additionalProperties: false
                  updatableFields:
                    type: object
                    properties:
                      authorizationNumber:
                        type: boolean
                      status:
                        type: boolean
                      description:
                        type: boolean
                      workNature:
                        type: boolean
                      contractorName:
                        type: boolean
                      supervisingTechnicianName:
                        type: boolean
                      architectName:
                        type: boolean
                      startAt:
                        type: boolean
                      endAt:
                        type: boolean
                      unitIds:
                        type: boolean
                    required:
                      - authorizationNumber
                      - status
                      - description
                      - workNature
                      - contractorName
                      - supervisingTechnicianName
                      - architectName
                      - startAt
                      - endAt
                      - unitIds
                    additionalProperties: false
                required:
                  - id
                  - ref
                  - authorizationNumber
                  - status
                  - description
                  - workNature
                  - contractorName
                  - supervisingTechnicianName
                  - architectName
                  - receivedAt
                  - startAt
                  - endAt
                  - 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

````