> ## 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 mail threads with provider contacts



## OpenAPI

````yaml /api/rs/openapi.json get /rs/conversations/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/conversations/v1/:
    get:
      tags:
        - conversations
      summary: List the mail threads with provider contacts
      operationId: listConversationsRSV1
      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:
                - intervention
                - contact
                - last-message
                - actions-info
              description: >-
                Extend options (JSON-encoded array, e.g.
                `?extend=["category"]`):

                - "intervention": Include the intervention the thread is
                attached to (null for other kinds).

                - "contact": Include the provider contact the thread is with
                (null for a thread opened by a mail from an unreferenced
                sender).

                - "last-message": Adds `lastMessage`: the most recent message of
                the thread.

                - "actions-info": Adds `actions` { canBeReplied, canBeClosed,
                canBeReopened }.
          in: query
          name: extend
          required: false
        - schema:
            type: array
            items:
              type: object
              properties:
                field:
                  type: string
                  enum:
                    - updatedAt
                    - createdAt
                  description: >-
                    OrderBy options (JSON-encoded array, e.g.
                    `?orderBy=[{"field":"name","direction":"asc"}]`):

                    - "updatedAt": Order by last activity date.

                    - "createdAt": Order by creation date.
                direction:
                  type: string
                  enum:
                    - asc
                    - desc
                  description: Sort direction
                  example: asc
              required:
                - field
                - direction
          in: query
          name: orderBy
          required: false
        - 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: whereIds
          required: false
          description: Filter by one or more conversation ids.
        - schema:
            type: string
            maxLength: 200
            example: lobby
          in: query
          name: whereSearch
          required: false
          description: >-
            Case-insensitive partial match on the subject, the recipient
            address, or the body of any message in the thread.
        - schema:
            type: array
            items:
              type: string
            example:
              - intervention
              - inbound
          in: query
          name: whereKind
          required: false
          description: Filter by what the thread is about.
        - schema:
            type: array
            items:
              type: string
            example:
              - open
              - closed
          in: query
          name: whereStatus
          required: false
          description: Filter by thread status - only `open` threads accept messages.
        - 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: whereInterventionIds
          required: false
          description: Filter by the intervention the thread is attached to.
        - 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: whereContactIds
          required: false
          description: Filter by the provider contact the thread is with.
        - 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: whereUpdatedAt
          required: false
          description: Filter by last activity date.
      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)$
                        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)$
                        interventionId:
                          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)$
                        contactId:
                          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)$
                        kind:
                          type: string
                          enum:
                            - intervention
                            - inbound
                        status:
                          type: string
                          enum:
                            - open
                            - closed
                        subject:
                          type: string
                          minLength: 1
                          maxLength: 300
                        toEmail:
                          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,}$
                        createdAt:
                          type: string
                          format: date-time
                        updatedAt:
                          type: string
                          format: date-time
                        intervention:
                          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
                            status:
                              type: string
                          required:
                            - id
                            - ref
                            - status
                          additionalProperties: false
                        contact:
                          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
                            email:
                              nullable: true
                              type: string
                          required:
                            - id
                            - name
                            - email
                          additionalProperties: false
                        lastMessage:
                          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)$
                            conversationId:
                              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)$
                            direction:
                              type: string
                              enum:
                                - inbound
                                - outbound
                            fromEmail:
                              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,}$
                            body:
                              nullable: true
                              type: string
                              maxLength: 10000
                            createdByUserId:
                              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)$
                            inboxMailId:
                              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)$
                            sentAt:
                              type: string
                              format: date-time
                          required:
                            - id
                            - conversationId
                            - direction
                            - fromEmail
                            - body
                            - createdByUserId
                            - inboxMailId
                            - sentAt
                          additionalProperties: false
                        actions:
                          type: object
                          properties:
                            canBeReplied:
                              type: boolean
                            canBeClosed:
                              type: boolean
                            canBeReopened:
                              type: boolean
                          required:
                            - canBeReplied
                            - canBeClosed
                            - canBeReopened
                          additionalProperties: false
                      required:
                        - id
                        - organizationId
                        - interventionId
                        - contactId
                        - kind
                        - status
                        - subject
                        - toEmail
                        - createdAt
                        - updatedAt
                      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

````