> ## Documentation Index
> Fetch the complete documentation index at: https://developer.kinbox.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# List all sessions



## OpenAPI

````yaml get /v1/sessions
openapi: 3.0.0
info:
  title: Kinbox API
  description: Kinbox public API
  version: '2.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/sessions:
    get:
      tags:
        - v1Sessions
      summary: List all sessions
      operationId: getAllSessions
      parameters:
        - name: limit
          required: false
          in: query
          description: >-
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100.
          schema:
            default: 10
            type: number
        - name: cursor
          required: false
          in: query
          description: >-
            A cursor for use in pagination. The cursor is the id of the last
            object returned in the previous request.
          schema:
            type: string
        - name: campaign_id
          required: false
          in: query
          description: Filter sessions by campaign id.
          schema:
            type: string
        - name: contact_id
          required: false
          in: query
          description: >-
            Filter sessions by the id of the contact associated with the
            session.
          schema:
            type: string
        - name: call_id
          required: false
          in: query
          description: Filter sessions by the id of the call associated with the session.
          schema:
            type: string
        - name: updated_at_from
          required: false
          in: query
          description: Only return sessions that were updated after this date.
          schema:
            type: string
        - name: updated_at_to
          required: false
          in: query
          description: Only return sessions that were updated before this date.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionSummaryCursorPaginatedResponseDto'
components:
  schemas:
    SessionSummaryCursorPaginatedResponseDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SessionSummaryPublicDto'
        nextCursor:
          type: string
          nullable: true
          description: Cursor for the next page. Null if there are no more results.
      required:
        - data
        - nextCursor
    SessionSummaryPublicDto:
      type: object
      properties:
        id:
          type: string
          example: 66e2f1c9a1b2c3d4e5f60718
          description: Id da sessão (ObjectId)
        _id:
          type: string
          example: 66e2f1c9a1b2c3d4e5f60718
        workspaceId:
          type: number
          example: 1
        call:
          $ref: '#/components/schemas/SessionCallDto'
        contact:
          $ref: '#/components/schemas/SessionContactDto'
        conversation:
          $ref: '#/components/schemas/SessionConversationDto'
        lastMessage:
          $ref: '#/components/schemas/SessionLastMessageDto'
        rating:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SessionRatingDto'
        trails:
          description: Histórico de quem assumiu a sessão
          type: array
          items:
            $ref: '#/components/schemas/SessionTrailDto'
        interactions:
          type: array
          items:
            $ref: '#/components/schemas/SessionInteractionDto'
        interactionDates:
          example:
            - '2026-09-14'
          type: array
          items:
            type: string
        tags:
          example:
            - 3
            - 8
          description: Ids das tags da sessão
          type: array
          items:
            type: number
        followers:
          description: Ids dos operadores seguindo a conversa
          type: array
          items:
            type: number
        scheduledMessages:
          description: Ids das mensagens agendadas
          type: array
          items:
            type: number
        deals:
          type: object
          nullable: true
          description: Negócios (deals) vinculados
        operatorMessagesCount:
          type: number
          example: 4
        assignedOperatorMessagesCount:
          type: number
          example: 4
        botMessagesCount:
          type: number
          example: 2
        contactMessagesCount:
          type: number
          example: 5
        totalMessagesCount:
          type: number
          example: 11
        messagesCountByDate:
          type: object
          description: >-
            Contagem de mensagens por dia: { "2026-09-14": { bot, operator,
            contact } }
          example:
            '2026-09-14':
              bot: 2
              operator: 4
              contact: 5
        tma:
          type: number
          nullable: true
          example: 1800
          description: Tempo médio de atendimento, em segundos
        tme:
          type: number
          nullable: true
          example: 120
          description: Tempo médio de espera, em segundos
        tmp:
          type: number
          nullable: true
          example: 90
          description: Tempo de primeira resposta, em segundos
        tmpResetOnNewAssignment:
          type: boolean
          example: false
        summary:
          type: string
          nullable: true
          description: Resumo da sessão gerado por IA
        campaignId:
          type: string
          nullable: true
          description: Id da campanha que originou a sessão
        mergedFromCustomerId:
          type: string
          nullable: true
        createdAt:
          type: string
          example: '2026-09-14T11:58:00.000Z'
        updatedAt:
          type: string
          example: '2026-09-14T12:30:00.000Z'
      required:
        - id
        - _id
        - workspaceId
        - call
        - createdAt
        - updatedAt
    SessionCallDto:
      type: object
      properties:
        id:
          type: number
          example: 987654
          description: Id da sessão de atendimento (call)
        customerPlatformId:
          type: number
          example: 1234567
          description: >-
            Id da conversa (contato no canal). Use em GET
            /v1/conversations/{id}/messages.
        workspacePlatformId:
          type: number
          example: 103
          nullable: true
          description: Id do canal
        operatorId:
          type: number
          example: 42
          nullable: true
        groupId:
          type: number
          example: 10
          nullable: true
        chatBotId:
          type: number
          nullable: true
        lastBotId:
          type: number
          nullable: true
        lastCallMessageId:
          type: number
          nullable: true
        protocol:
          type: string
          example: '2026091412345'
          nullable: true
        uniqueIdentifier:
          type: string
          nullable: true
        isFinished:
          type: boolean
          example: false
        isChatBotActive:
          type: boolean
          example: false
        isFromIntegration:
          type: boolean
          example: false
        isHidden:
          type: boolean
          example: false
        isImported:
          type: boolean
          example: false
        isReopened:
          type: boolean
          example: false
        isWithoutOperatorAnswer:
          type: boolean
          example: false
        isWithoutClientAnswer:
          type: boolean
          example: false
        isCreatedByActiveChat:
          type: boolean
          example: false
        isRatingActive:
          type: boolean
          example: false
        isNewContact:
          type: boolean
          example: false
        isNewConversation:
          type: boolean
          example: false
        hasScheduledAutomation:
          type: boolean
          example: false
        botLoopCount:
          type: number
          nullable: true
        extraData:
          type: object
          nullable: true
          description: 'Dados extras do canal (ex.: anúncio de origem)'
        referral:
          type: object
          nullable: true
          description: Referral do WhatsApp (click-to-chat), quando houver
        customFields:
          type: object
          description: 'Campos customizados da sessão no formato { chave: { value } }'
          example:
            origem:
              value: site
        createdAt:
          type: string
          example: '2026-09-14T11:58:00.000Z'
        answeredAt:
          type: string
          nullable: true
          example: '2026-09-14T12:00:00.000Z'
        finishedAt:
          type: string
          nullable: true
          example: '2026-09-14T12:30:00.000Z'
        callExpiresAt:
          type: string
          nullable: true
        firstOperatorMessageAt:
          type: string
          nullable: true
        lastOperatorMessageAt:
          type: string
          nullable: true
        firstCustomerMessageAt:
          type: string
          nullable: true
        lastCustomerMessageAt:
          type: string
          nullable: true
      required:
        - id
        - customerPlatformId
    SessionContactDto:
      type: object
      properties:
        id:
          type: number
          example: 555
        name:
          type: string
          example: João Silva
        avatar:
          type: string
          nullable: true
        email:
          type: string
          example: joao@gmail.com
          nullable: true
        phone:
          type: string
          example: '5585988887777'
          nullable: true
        notes:
          type: string
          nullable: true
        newContact:
          type: boolean
          example: false
        isPrivate:
          type: boolean
          example: false
        createdAt:
          type: string
          example: '2026-01-10T10:00:00.000Z'
        customFields:
          type: object
          description: 'Campos customizados do contato no formato { chave: { value } }'
          example:
            cpf:
              value: 000.000.000-00
    SessionConversationDto:
      type: object
      properties:
        id:
          type: number
          example: 1234567
          description: Id da conversa (customerPlatformId)
        customerId:
          type: number
        platformId:
          type: number
        workspacePlatformId:
          type: number
          example: 103
        identifier:
          type: string
          example: '5585988887777'
          description: Identificador do contato no canal (telefone, id do Instagram etc.)
        uniqueIdentifier:
          type: string
          nullable: true
        lastCallId:
          type: number
          nullable: true
        origin:
          type: string
          nullable: true
        newCustomer:
          type: boolean
          example: false
        hasNewMessages:
          type: boolean
          example: false
        showPending:
          type: boolean
          example: false
        wasImported:
          type: boolean
          example: false
        isDbMigrated:
          type: boolean
          example: false
        isBlocked:
          type: boolean
          example: false
        isGroup:
          type: boolean
          example: false
        importationTimestamp:
          type: number
          nullable: true
        createdAt:
          type: string
          nullable: true
        lastSeen:
          type: string
          nullable: true
        customerLastSeen:
          type: string
          nullable: true
        lastMessageAt:
          type: string
          nullable: true
        customerLastMessageAt:
          type: string
          nullable: true
        operatorLastMessageAt:
          type: string
          nullable: true
        operatorLastMessageTriggerAt:
          type: string
          nullable: true
        pendingAt:
          type: string
          nullable: true
        expirationDate:
          type: string
          nullable: true
          description: Fim da janela de 24h do WhatsApp, quando aplicável
    SessionLastMessageDto:
      type: object
      properties:
        idMessage:
          type: number
          example: 37826587
          description: Id da mensagem. Use em GET /v1/messages/{id}.
        _id:
          type: string
          description: ObjectId da mensagem
        operatorId:
          type: number
          nullable: true
        content:
          type: string
          example: '[{"insert":"Olá"}]'
        type:
          type: number
          example: 0
          description: 0 comum, 1 sistema, 2 nota interna, 3 bot, 4 e-mail
        createdAt:
          type: string
          example: '2026-09-14T12:30:00.000Z'
    SessionRatingDto:
      type: object
      properties:
        value:
          type: number
          example: 5
        operatorId:
          type: number
          nullable: true
        operatorName:
          type: string
          nullable: true
      required:
        - value
    SessionTrailDto:
      type: object
      properties:
        date:
          type: string
          example: '2026-09-14T12:00:00.000Z'
        isodate:
          type: string
          example: '2026-09-14T12:00:00.000Z'
        type:
          type: string
          enum:
            - operator
            - bot
            - contact
            - automation
            - assignmentRule
            - group
          example: operator
        id:
          type: number
          example: 42
          description: Id do operador, bot, grupo ou regra
      required:
        - date
        - isodate
        - type
        - id
    SessionInteractionDto:
      type: object
      properties:
        date:
          type: string
          example: '2026-09-14T12:00:00.000Z'
        operatorId:
          type: number
          example: 42
      required:
        - date
        - operatorId

````