> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raptora.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Чатуудыг жагсаах

> Чатууд, шинэ нь эхэндээ.

Шаардлагатай эрх: `chats:read`



## OpenAPI

````yaml /api-reference/openapi.json get /v1/chats
openapi: 3.1.0
info:
  title: Raptora API
  version: 1.0.0
  description: >-
    Агент, утасны дугаар, дуудлага, чат, үнэлгээгээ өөрийн системээс унших,
    агент болон үнэлгээний шалгуураа удирдах API.
servers:
  - url: https://api.raptora.io
security:
  - apiKey: []
tags:
  - name: Утасны дугаар
  - name: Агент
  - name: Дуудлага
  - name: Чат
  - name: Үнэлгээ
  - name: Үнэлгээний шалгуур
  - name: Төсөл
paths:
  /v1/chats:
    get:
      tags:
        - Чат
      summary: Чатуудыг жагсаах
      description: |-
        Чатууд, шинэ нь эхэндээ.

        Шаардлагатай эрх: `chats:read`
      operationId: chats.list
      parameters:
        - name: limit
          in: query
          required: false
          description: Нэг хуудасны мөрийн тоо, 100 хүртэл.
          schema:
            default: 20
            type: integer
            minimum: 1
            maximum: 100
        - name: cursor
          in: query
          required: false
          description: Өмнөх хуудасны `nextCursor`.
          schema:
            type: string
            maxLength: 200
        - name: agentId
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - ONGOING
              - ENDED
              - TRANSFERRED
              - ABANDONED
              - FAILED
        - name: channel
          in: query
          required: false
          schema:
            type: string
            enum:
              - WEB
              - MESSENGER
              - INSTAGRAM
              - SMS
        - $ref: '#/components/parameters/RaptoraProject'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatPage'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
components:
  parameters:
    RaptoraProject:
      name: Raptora-Project
      in: header
      required: false
      description: >-
        Байгууллагын API key аль төсөл дээр ажиллахыг заана. Өгөхгүй бол үндсэн
        төсөл. Төслийн API key зөвхөн өөрийн төслийг заана.
      schema:
        type: string
        format: uuid
  schemas:
    ChatPage:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Chat'
        nextCursor:
          description: Дараагийн хуудасны `cursor`. Сүүлийн хуудас бол null.
          type:
            - string
            - 'null'
      required:
        - data
        - nextCursor
    Chat:
      type: object
      properties:
        object:
          type: string
          const: chat
        id:
          type: string
          format: uuid
        agentId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        channel:
          $ref: '#/components/schemas/ChatChannel'
        status:
          $ref: '#/components/schemas/ChatStatus'
        sentiment:
          anyOf:
            - $ref: '#/components/schemas/Sentiment'
            - type: 'null'
        outcome:
          anyOf:
            - $ref: '#/components/schemas/Outcome'
            - type: 'null'
        endedReason:
          anyOf:
            - $ref: '#/components/schemas/EndedReason'
            - type: 'null'
        startedAt:
          type: string
          format: date-time
        endedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        durationMs:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
      required:
        - object
        - id
        - agentId
        - channel
        - status
        - sentiment
        - outcome
        - endedReason
        - startedAt
        - endedAt
        - durationMs
    Problem:
      type: object
      properties:
        type:
          type: string
          description: Алдааны төрлийг тодорхойлох URL.
        title:
          type: string
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        detail:
          type: string
        requestId:
          type: string
          description: Тусламж хүсэхдээ энэ дугаарыг хэлнэ.
        errors:
          description: Буруу утгатай талбарууд.
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
              - path
              - message
        requiredScope:
          type: string
        retryAfter:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - type
        - title
        - status
        - detail
        - requestId
      description: RFC 9457 алдааны хариу.
    ChatChannel:
      type: string
      enum:
        - WEB
        - MESSENGER
        - INSTAGRAM
        - SMS
    ChatStatus:
      type: string
      enum:
        - ONGOING
        - ENDED
        - TRANSFERRED
        - ABANDONED
        - FAILED
    Sentiment:
      type: string
      enum:
        - VERY_POSITIVE
        - POSITIVE
        - NEUTRAL
        - NEGATIVE
        - VERY_NEGATIVE
    Outcome:
      type: string
      enum:
        - RESOLVED
        - ESCALATED
        - FAILED
        - ABANDONED
        - UNKNOWN
    EndedReason:
      type: string
      enum:
        - AGENT_ENDED
        - CALLER_ENDED
        - TRANSFERRED
        - FAILED
  responses:
    Error400:
      description: Параметр буруу.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error401:
      description: API key байхгүй эсвэл хүчингүй.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error403:
      description: API key-д энэ эрх байхгүй.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error429:
      description: >-
        Хэт олон хүсэлт. `Retry-After` header-т заасан секундын дараа дахин
        оролдоно.
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error500:
      description: Серверийн алдаа.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: '`rpt_live_` эсвэл `rpt_test_`-ээр эхэлсэн нууц API key.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.