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

# List the organization documents (paginated)



## OpenAPI

````yaml /api/rs/openapi.json get /rs/documents/v1/
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/:
    get:
      tags:
        - documents
      summary: List the organization documents (paginated)
      operationId: listDocumentsRSV1
      parameters:
        - schema:
            default: 1
            type: integer
            minimum: 0
            exclusiveMinimum: true
            maximum: 9007199254740991
          in: query
          name: page
          required: false
        - schema:
            default: 50
            type: integer
            minimum: 0
            exclusiveMinimum: true
            maximum: 1000
          in: query
          name: pageSize
          required: false
        - schema:
            example: true
            anyOf:
              - type: boolean
          in: query
          name: countOnly
          required: false
          description: >-
            When true, answers `totalCount` with an empty `data`: the rows are
            never read, so no extend is selected and no transform runs. For a
            badge or a counter.
        - schema:
            type: array
            items:
              type: string
              enum:
                - folder
                - label
                - created-by
                - actions-info
                - versions-count
                - 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.

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

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

                - "versions-count": Adds `versionsCount`, the number of past
                replacement versions.

                - "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: array
            items:
              type: object
              properties:
                field:
                  type: string
                  enum:
                    - name
                    - type
                    - createdAt
                    - updatedAt
                  description: >-
                    OrderBy options (JSON-encoded array, e.g.
                    `?orderBy=[{"field":"name","direction":"asc"}]`):

                    - "name": Order by document name.

                    - "type": Order by document type.

                    - "createdAt": Order by creation date.

                    - "updatedAt": Order by last update date.
                direction:
                  type: string
                  enum:
                    - asc
                    - desc
                  description: Sort direction
                  example: asc
              required:
                - field
                - direction
          in: query
          name: orderBy
          required: false
        - schema:
            type: string
            maxLength: 200
            example: lobby
          in: query
          name: whereSearch
          required: false
          description: Case-insensitive search across name and ref.
        - schema:
            type: array
            items:
              type: string
            example:
              - cerfa
              - security_notice
          in: query
          name: whereType
          required: false
          description: Filter by one or more document types.
        - schema:
            type: array
            items:
              type: string
            example:
              - site_upload
              - building_work
          in: query
          name: whereOrigin
          required: false
          description: Filter by one or more document origins.
        - schema:
            anyOf:
              - 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)$
              - type: string
                enum:
                  - none
          in: query
          name: whereFolderId
          required: false
          description: >-
            Filter by folder id; the sentinel `"none"` means unclassified
            documents (no folder).
        - schema:
            type: array
            items:
              anyOf:
                - 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)$
                - type: string
                  enum:
                    - none
                - type: string
                  enum:
                    - any
          in: query
          name: whereUnitId
          required: false
          description: >-
            Filter by one or more unit ids; the sentinel `"none"` matches
            documents linked to no unit, and `"any"` those linked to one.
        - schema:
            type: array
            items:
              anyOf:
                - 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)$
                - type: string
                  enum:
                    - none
                - type: string
                  enum:
                    - any
          in: query
          name: whereTechnicalInstallationId
          required: false
          description: >-
            Filter by one or more technical installation ids; the sentinel
            `"none"` matches documents linked to no technical installation, and
            `"any"` those linked to one.
        - schema:
            type: array
            items:
              anyOf:
                - 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)$
                - type: string
                  enum:
                    - none
                - type: string
                  enum:
                    - any
          in: query
          name: whereBuildingWorkId
          required: false
          description: >-
            Filter by one or more building-work ids; the sentinel `"none"`
            matches documents linked to no building-work, and `"any"` those
            linked to one.
        - schema:
            type: array
            items:
              anyOf:
                - 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)$
                - type: string
                  enum:
                    - none
          in: query
          name: whereLabelIds
          required: false
          description: >-
            Filter by one or more label ids; the sentinel `"none"` matches
            documents with no label.
        - schema:
            maxItems: 250
            type: array
            items:
              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)$
            example:
              - 550e8400-e29b-41d4-a716-446655440000
              - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
          in: query
          name: whereCreatedById
          required: false
          description: Filter by one or more author user ids.
        - schema:
            anyOf:
              - type: boolean
              - type: string
            example: true
          in: query
          name: whereArchived
          required: false
          description: >-
            When `true`, only archived documents; when `false`, only
            non-archived.
        - schema:
            anyOf:
              - type: object
                properties:
                  start:
                    type: string
                  end:
                    type: string
              - type: object
                properties:
                  gte:
                    type: string
                  lte:
                    type: string
            example:
              start: '2026-01-01'
              end: '2026-01-31'
          in: query
          name: whereCreatedAt
          required: false
          description: Filter by the creation-date range.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    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
                        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
                        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
                        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
                        versionsCount:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        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
                  totalCount:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  pagination:
                    type: object
                    properties:
                      page:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        maximum: 9007199254740991
                      pageSize:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        maximum: 9007199254740991
                      totalPages:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                    required:
                      - page
                      - pageSize
                      - totalPages
                    additionalProperties: false
                required:
                  - data
                  - totalCount
                  - pagination
                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

````