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

# Chronological, paginated feed of commissions and building works for one establishment.



## OpenAPI

````yaml /api/rs/openapi.json get /rs/security-register/v1/control-events
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/security-register/v1/control-events:
    get:
      tags:
        - security-register
      summary: >-
        Chronological, paginated feed of commissions and building works for one
        establishment.
      operationId: listControlEventsRSV1
      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:
            minItems: 1
            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: whereUnitIds
          required: false
          description: >-
            Restrict to these units. Omitted, the register spans every unit the
            caller can read.
        - schema:
            type: array
            items:
              type: string
              enum:
                - commission
                - buildingWork
          in: query
          name: types
          required: false
          description: >-
            Event kinds to include. Defaults to both. Available: commission,
            buildingWork
        - schema:
            anyOf: []
            example:
              start: '2026-01-01'
              end: '2026-01-31'
          in: query
          name: whereOccurredAt
          required: false
          description: >-
            Restrict to the commission's heldAt / the building work's startAt
            date range.
        - schema:
            default: desc
            type: string
            enum:
              - asc
              - desc
          in: query
          name: orderBy
          required: false
          description: Sort direction on the displayed date.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - commission
                            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
                            comment:
                              nullable: true
                              type: string
                              maxLength: 2000
                            report:
                              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*)*$
                              required:
                                - id
                                - ref
                              additionalProperties: false
                            buildingWorks:
                              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*)*$
                                  authorizationNumber:
                                    type: string
                                    minLength: 1
                                    maxLength: 200
                                required:
                                  - id
                                  - ref
                                  - authorizationNumber
                                additionalProperties: false
                            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
                          required:
                            - kind
                            - id
                            - ref
                            - visitType
                            - status
                            - decision
                            - heldAt
                            - comment
                            - report
                            - buildingWorks
                            - units
                          additionalProperties: false
                        - type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - buildingWork
                            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
                            workNature:
                              nullable: true
                              type: string
                              maxLength: 200
                            description:
                              nullable: true
                              type: string
                              maxLength: 2000
                            status:
                              type: string
                              enum:
                                - rejected
                                - pending
                                - approved
                                - partially_received
                                - received
                            startAt:
                              nullable: true
                              type: string
                              format: date-time
                            endAt:
                              nullable: true
                              type: string
                              format: date-time
                            receivedAt:
                              nullable: true
                              type: string
                              format: date-time
                            contractorName:
                              nullable: true
                              type: string
                              maxLength: 200
                            architectName:
                              nullable: true
                              type: string
                              maxLength: 200
                            commissions:
                              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*)*$
                                required:
                                  - id
                                  - ref
                                additionalProperties: false
                            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
                            documentsCount:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                          required:
                            - kind
                            - id
                            - ref
                            - authorizationNumber
                            - workNature
                            - description
                            - status
                            - startAt
                            - endAt
                            - receivedAt
                            - contractorName
                            - architectName
                            - commissions
                            - units
                            - documentsCount
                          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

````