> ## 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 one document



## OpenAPI

````yaml /api/rs/openapi.json get /rs/documents/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/documents/v1/{id}:
    get:
      tags:
        - documents
      summary: Get one document
      operationId: getDocumentRSV1
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - folder
                - label
                - unit
                - technical-installation
                - created-by
                - versions
                - actions-info
                - source
              description: >-
                Extend options (JSON-encoded array, e.g.
                `?extend=["category"]`):

                - "folder": Include the containing folder (id, name), null when
                unclassified.

                - "label": Include the linked label (id, name, color) when
                present.

                - "unit": Include the linked unit (id, name), null for an
                org-level document.

                - "technical-installation": Include the linked technical
                installation (id, name), null when not linked.

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

                - "versions": Adds `versions`, the append-only replacement
                history, most recent first, each with a presigned `downloadUrl`
                and the resolved `replacedBy` user.

                - "actions-info": Adds `actions` (canBe* flags) and
                `isConstitutive` (owned by a report/plan/contract).

                - "source": Include the carrier entity (report, contract, plan,
                building work) the document comes from, null for a plain upload.
          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*)*$
                  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
                  origin:
                    type: string
                    enum:
                      - site_upload
                      - building_work
                      - report
                      - plan
                      - contract
                      - safety_instructions
                  mimeType:
                    type: string
                    minLength: 1
                    maxLength: 100
                  size:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    maximum: 1073741824
                  folderId:
                    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)$
                  unitId:
                    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)$
                  technicalInstallationId:
                    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)$
                  buildingWorkId:
                    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)$
                  archivedAt:
                    nullable: true
                    type: string
                    format: date-time
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                  downloadUrl:
                    type: string
                    format: uri
                  folder:
                    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
                        minLength: 1
                        maxLength: 100
                    required:
                      - id
                      - name
                    additionalProperties: false
                  label:
                    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
                        minLength: 1
                        maxLength: 100
                      color:
                        type: string
                        pattern: ^#[0-9a-fA-F]{6}$
                    required:
                      - id
                      - name
                      - color
                    additionalProperties: false
                  unit:
                    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
                        minLength: 1
                        maxLength: 150
                    required:
                      - id
                      - name
                    additionalProperties: false
                  technicalInstallation:
                    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
                        minLength: 1
                        maxLength: 150
                    required:
                      - id
                      - name
                    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
                  versions:
                    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)$
                        name:
                          type: string
                          minLength: 1
                          maxLength: 255
                        mimeType:
                          type: string
                          minLength: 1
                          maxLength: 100
                        size:
                          type: integer
                          minimum: 0
                          exclusiveMinimum: true
                          maximum: 1073741824
                        replacedBy:
                          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
                        createdAt:
                          type: string
                          format: date-time
                        downloadUrl:
                          type: string
                          format: uri
                      required:
                        - id
                        - name
                        - mimeType
                        - size
                        - replacedBy
                        - createdAt
                        - downloadUrl
                      additionalProperties: false
                  actions:
                    type: object
                    properties:
                      canBeUpdated:
                        type: boolean
                      canBeReplaced:
                        type: boolean
                      canBeArchived:
                        type: boolean
                      canBeUnarchived:
                        type: boolean
                      canBeDeleted:
                        type: boolean
                    required:
                      - canBeUpdated
                      - canBeReplaced
                      - canBeArchived
                      - canBeUnarchived
                      - canBeDeleted
                    additionalProperties: false
                  isConstitutive:
                    type: boolean
                  source:
                    nullable: true
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - report
                          - contract
                          - plan
                          - building_work
                      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:
                        nullable: true
                        type: string
                    required:
                      - type
                      - id
                      - ref
                      - name
                    additionalProperties: false
                required:
                  - id
                  - ref
                  - name
                  - type
                  - origin
                  - mimeType
                  - size
                  - folderId
                  - unitId
                  - technicalInstallationId
                  - buildingWorkId
                  - archivedAt
                  - createdAt
                  - updatedAt
                  - downloadUrl
                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

````