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

# List data sources

> List all data sources for an agent. This endpoint provides a unified view of all training data sources including websites, text, Q&A pairs, and uploaded files. It supports pagination, filtering, and search to help manage large datasets efficiently.



## OpenAPI

````yaml get /api/v2/data-sources
openapi: 3.0.1
info:
  title: LiveChatAI API v2
  description: >-
    LiveChatAI API v2 - Build powerful AI-powered customer support experiences.
    This API follows REST principles with predictable, resource-oriented URLs,
    JSON responses, and standard HTTP methods.
  version: 2.0.0
servers:
  - url: https://app.livechatai.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v2/data-sources:
    get:
      tags:
        - Data Sources
      summary: List data sources
      description: >-
        List all data sources for an agent. This endpoint provides a unified
        view of all training data sources including websites, text, Q&A pairs,
        and uploaded files. It supports pagination, filtering, and search to
        help manage large datasets efficiently.
      parameters:
        - in: query
          name: agentId
          schema:
            type: string
            example: clx1234567890abcdef
          required: true
          description: Unique identifier of the agent
        - in: query
          name: source
          schema:
            type: string
            example: ALL
            enum:
              - WEBSITE
              - TEXT
              - QA
              - PDF
              - DOCX
              - IMAGE
              - ALL
          required: false
          description: Filter by source type to get specific data source types
        - in: query
          name: page
          schema:
            type: integer
            example: 1
            minimum: 1
          required: false
          description: 'Page number for pagination (default: 1)'
        - in: query
          name: limit
          schema:
            type: integer
            example: 10
            minimum: 1
            maximum: 100
          required: false
          description: 'Number of data sources per page (default: 10, max: 100)'
        - in: query
          name: search
          schema:
            type: string
            example: product guide
          required: false
          description: >-
            Search query to filter data sources. Searches different fields based
            on source type: URL for websites, title for files (PDF/DOCX/IMAGE),
            title and content for text and Q&A sources, title and URL for
            YouTube videos.
      responses:
        '200':
          description: Successfully retrieved data sources list
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      agentId:
                        type: string
                        example: clx1234567890abcdef
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              example: ds_1234567890
                            title:
                              type: string
                              example: Company Overview
                            text:
                              type: string
                              example: Our company specializes in...
                            url:
                              type: string
                              nullable: true
                              example: https://example.com/about
                            source:
                              type: string
                              example: TEXT
                              enum:
                                - WEBSITE
                                - TEXT
                                - QA
                                - PDF
                                - DOCX
                                - IMAGE
                            status:
                              type: string
                              example: COMPLETED
                            characterCount:
                              type: integer
                              example: 1250
                            createdAt:
                              type: string
                              format: date-time
                              example: '2024-01-15T10:30:00Z'
                            updatedAt:
                              type: string
                              format: date-time
                              example: '2024-01-20T14:45:00Z'
                            isGeneratedByAI:
                              type: boolean
                              example: false
                              description: Whether this data source was generated by AI
                            isImprovedByAI:
                              type: boolean
                              example: false
                              description: >-
                                Whether this data source was improved/boosted by
                                AI
                      totalCount:
                        type: integer
                        example: 250
                        description: Total number of data sources across all pages
                      pages:
                        type: object
                        properties:
                          page:
                            type: integer
                            example: 1
                            description: Current page number
                          perPage:
                            type: integer
                            example: 10
                            description: Number of items per page
                          totalPages:
                            type: integer
                            example: 25
                            description: Total number of pages
                          hasPrevious:
                            type: boolean
                            example: false
                            description: Whether there is a previous page
                          hasNext:
                            type: boolean
                            example: true
                            description: Whether there is a next page
                          previous:
                            type: integer
                            nullable: true
                            example: null
                            description: Previous page number (null if no previous page)
                          next:
                            type: integer
                            nullable: true
                            example: 2
                            description: Next page number (null if no next page)
        '400':
          description: >-
            Bad request - Missing or invalid parameters (e.g., agentId is
            required, or invalid pagination parameters).
        '401':
          description: Unauthorized access
        '403':
          description: Access denied - Invalid agent access.
        '404':
          description: Chatbot not found or access denied.
        '500':
          description: An internal server error occurred.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````