> ## 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's rs + na users



## OpenAPI

````yaml /api/rs/openapi.json get /rs/users/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/users/v1/:
    get:
      tags:
        - users
      summary: List the organization's rs + na users
      operationId: listUsersRSV1
      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:
                - roles
                - profession
                - activation-status
                - actions-info
                - units
                - responsibilities
              description: >-
                Extend options (JSON-encoded array, e.g.
                `?extend=["category"]`):

                - "roles": Adds each role assignment's `role` { id, name },
                `unitIds` and `itIds`.

                - "profession": Adds `profession` { id, name, color } (default
                select only has professionId).

                - "activation-status": Adds `pending` (true while the identity
                has not activated its account yet).

                - "actions-info": Adds `actions` { canBeArchived,
                canBeUnarchived } per row.

                - "units": Adds `units` { id, ref, name } - the units the user
                is posted to.

                - "responsibilities": Adds `responsibilities` - what this user
                is responsible for, with each target named.
          in: query
          name: extend
          required: false
        - schema:
            type: array
            items:
              type: object
              properties:
                field:
                  type: string
                  enum:
                    - name
                    - email
                    - createdAt
                    - ref
                  description: >-
                    OrderBy options (JSON-encoded array, e.g.
                    `?orderBy=[{"field":"name","direction":"asc"}]`):

                    - "name": Order by the identity name.

                    - "email": Order by the identity email.

                    - "createdAt": Order by creation date.

                    - "ref": Order by the user reference.
                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 the identity name and email.
        - schema:
            type: array
            items:
              type: string
            example:
              - rs
              - na
          in: query
          name: whereType
          required: false
          description: Filter by one or more user types (rs, na).
        - schema:
            type: array
            items:
              type: string
            example:
              - internal
              - external
          in: query
          name: whereAffiliation
          required: false
          description: Filter by one or more affiliations.
        - 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: whereProfessionId
          required: false
          description: Filter by one or more profession ids.
        - 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: whereRoleId
          required: false
          description: Filter by one or more assigned role ids.
        - 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: whereUnitIds
          required: false
          description: Filter by one or more units the user is posted to.
        - schema:
            anyOf:
              - type: boolean
              - type: string
            example: true
          in: query
          name: whereActivated
          required: false
          description: >-
            Filter by activation state (true = the identity has activated its
            account).
        - schema:
            anyOf:
              - type: boolean
              - type: string
            example: true
          in: query
          name: whereArchived
          required: false
          description: When `true`, only archived users; when `false`, only non-archived.
        - schema:
            type: array
            items:
              type: string
            example:
              - not_started
              - on_time
          in: query
          name: whereComplianceStatus
          required: false
          description: >-
            Filter by the derived status (not_started, on_time, at_risk,
            overdue) of the user’s own compliances (qualifications).
      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*)*$
                        type:
                          type: string
                          enum:
                            - rs
                            - na
                        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)$
                        archivedAt:
                          nullable: true
                          type: string
                          format: date-time
                        affiliation:
                          nullable: true
                          type: string
                          enum:
                            - internal
                            - external
                        professionId:
                          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)$
                        identity:
                          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
                            email:
                              nullable: true
                              type: string
                              format: email
                              pattern: >-
                                ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                            phone:
                              nullable: true
                              type: string
                              minLength: 1
                              maxLength: 30
                            lang:
                              type: string
                              enum:
                                - fr-FR
                                - en-US
                                - de-DE
                          required:
                            - id
                            - name
                            - email
                            - phone
                            - lang
                          additionalProperties: false
                        roles:
                          type: array
                          items:
                            type: object
                            properties:
                              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)$
                              role:
                                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: 80
                                required:
                                  - id
                                  - name
                                additionalProperties: false
                              unitIds:
                                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)$
                              itIds:
                                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)$
                            required:
                              - organizationId
                            additionalProperties: false
                        createdAt:
                          type: string
                          format: date-time
                        profession:
                          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
                        pending:
                          type: boolean
                        actions:
                          type: object
                          properties:
                            canBeArchived:
                              type: boolean
                            canBeUnarchived:
                              type: boolean
                          required:
                            - canBeArchived
                            - canBeUnarchived
                          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
                        responsibilities:
                          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)$
                              type:
                                type: string
                                enum:
                                  - unit
                                  - technical_installation
                                  - rule
                                  - compliance
                                  - equipment
                              target:
                                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
                            required:
                              - id
                              - type
                              - target
                            additionalProperties: false
                      required:
                        - id
                        - ref
                        - type
                        - organizationId
                        - archivedAt
                        - affiliation
                        - professionId
                        - identity
                        - createdAt
                      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

````