> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-fix-template-upload-size-guidance.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List Knowledge Bases

> Returns a paginated list of knowledge bases, optionally filtered by keyword or tags.



## OpenAPI

````yaml /en/api-reference/openapi_service.json get /datasets
openapi: 3.0.1
info:
  description: >-
    REST API for Dify applications and knowledge bases. Application endpoints
    authenticate with an app API key; knowledge endpoints authenticate with a
    dataset API key.
  title: Dify Service API
  version: 1.0.0
servers:
  - description: >-
      Base URL of the Dify Service API. For self-hosted deployments, replace it
      with your own API base URL.
    url: https://{api_base_url}
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: Host and path of the API base URL, without the `https://` prefix.
security:
  - ApiKeyAuth: []
tags:
  - description: Operations related to chat messages and interactions.
    name: Chat Messages
  - description: File upload and preview operations.
    name: Files
  - description: Operations related to end user information.
    name: End Users
  - description: User feedback operations.
    name: Feedback
  - description: Operations related to managing conversations.
    name: Conversations
  - description: Text-to-Speech and Speech-to-Text operations.
    name: Audio
  - description: Operations to retrieve application settings and information.
    name: Applications
  - description: Operations related to managing annotations for direct replies.
    name: Annotations
  - description: Endpoints for resuming paused workflows that require human input.
    name: Human Input
  - description: Operations for executing and managing workflows.
    name: Workflow Runs
  - description: Operations related to text generation and completion.
    name: Completion Messages
  - description: >-
      Operations for managing knowledge bases, including creation,
      configuration, and retrieval.
    name: Knowledge Bases
  - description: >-
      Operations for creating, updating, and managing documents within a
      knowledge base.
    name: Documents
  - description: Operations for managing document chunks and child chunks.
    name: Chunks
  - description: >-
      Operations for managing knowledge base metadata fields and document
      metadata values.
    name: Metadata
  - description: Operations for managing knowledge base tags and tag bindings.
    name: Tags
  - description: Operations for retrieving available models.
    name: Models
  - description: >-
      Operations for managing and running knowledge pipelines, including
      datasource plugins and pipeline execution.
    name: Knowledge Pipeline
paths:
  /datasets:
    get:
      tags:
        - Knowledge Bases
      summary: List Knowledge Bases
      description: >-
        Returns a paginated list of knowledge bases, optionally filtered by
        keyword or tags.
      operationId: listDatasets
      parameters:
        - description: Page number.
          in: query
          name: page
          schema:
            default: 1
            type: integer
        - description: Number of items per page.
          in: query
          name: limit
          schema:
            default: 20
            type: integer
        - description: Search keyword to filter by name.
          in: query
          name: keyword
          schema:
            type: string
        - description: Whether to include all knowledge bases regardless of permissions.
          in: query
          name: include_all
          schema:
            default: false
            type: boolean
        - description: >-
            Tag IDs to filter by. Get tag IDs from [List Knowledge Type
            Tags](/en/api-reference/tags/list-knowledge-tags).
          explode: true
          in: query
          name: tag_ids
          schema:
            items:
              type: string
            type: array
          style: form
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  summary: Response Example
                  value:
                    data:
                      - app_count: 0
                        author_name: admin
                        built_in_field_enabled: true
                        chunk_structure: null
                        created_at: 1741267200
                        created_by: ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4
                        data_source_type: null
                        description: Technical documentation for the product API
                        doc_form: text_model
                        doc_metadata: []
                        document_count: 0
                        embedding_available: true
                        embedding_model: text-embedding-3-small
                        embedding_model_provider: langgenius/openai/openai
                        enable_api: true
                        external_knowledge_info: null
                        external_retrieval_model: null
                        icon_info: null
                        id: c42e2a6e-40b3-4330-96f8-f1e4d768e8c9
                        indexing_technique: high_quality
                        is_multimodal: false
                        is_published: false
                        maintainer: admin
                        name: Product Documentation
                        permission: only_me
                        pipeline_id: null
                        provider: vendor
                        retrieval_model_dict:
                          reranking_enable: false
                          reranking_mode: null
                          reranking_model:
                            reranking_model_name: ''
                            reranking_provider_name: ''
                          score_threshold: null
                          score_threshold_enabled: false
                          search_method: semantic_search
                          top_k: 3
                          weights: null
                        runtime_mode: null
                        summary_index_setting: null
                        tags: []
                        total_available_documents: 0
                        total_documents: 0
                        updated_at: 1741267200
                        updated_by: ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4
                        word_count: 0
                    has_more: false
                    limit: 20
                    page: 1
                    total: 1
              schema:
                properties:
                  data:
                    description: Array of knowledge base objects.
                    items:
                      $ref: '#/components/schemas/Dataset'
                    type: array
                  has_more:
                    description: Whether more items exist on the next page.
                    type: boolean
                  limit:
                    description: Number of items per page.
                    type: integer
                  page:
                    description: Current page number.
                    type: integer
                  total:
                    description: Total number of matching items.
                    type: integer
                type: object
          description: List of knowledge bases.
components:
  schemas:
    Dataset:
      properties:
        app_count:
          description: Number of applications currently using this knowledge base.
          type: integer
        author_name:
          description: Display name of the creator.
          type: string
        built_in_field_enabled:
          description: >-
            Whether built-in metadata fields (e.g., `document_name`, `uploader`)
            are enabled.
          type: boolean
        chunk_structure:
          description: Chunk structure configuration.
          nullable: true
          type: string
        created_at:
          description: Creation timestamp (Unix epoch in seconds).
          type: number
        created_by:
          description: ID of the user who created the knowledge base.
          type: string
        data_source_type:
          description: Data source type of the documents, `null` if not yet configured.
          type: string
        description:
          description: >-
            Optional text describing the purpose or contents of the knowledge
            base.
          type: string
        doc_form:
          description: >-
            Document chunking mode. `text_model` for standard text chunking,
            `hierarchical_model` for parent-child structure, `qa_model` for QA
            pair extraction.
          type: string
        doc_metadata:
          description: Metadata field definitions for the knowledge base.
          items:
            properties:
              id:
                description: Metadata field identifier.
                type: string
              name:
                description: Metadata field name.
                type: string
              type:
                description: Metadata field value type.
                type: string
            type: object
          type: array
        document_count:
          description: Total number of documents in the knowledge base.
          type: integer
        embedding_available:
          description: Whether the configured embedding model is currently available.
          type: boolean
        embedding_model:
          description: Name of the embedding model used for indexing.
          type: string
        embedding_model_provider:
          description: >-
            Embedding model provider identifier, formatted as
            `organization/plugin_name/provider_name` (e.g.
            `langgenius/openai/openai`). Legacy knowledge bases may return the
            bare short form (e.g. `openai`).
          type: string
        enable_api:
          description: Whether API access is enabled for this knowledge base.
          type: boolean
        external_knowledge_info:
          description: >-
            Connection details for external knowledge bases. Present when
            `provider` is `external`.
          nullable: true
          properties:
            external_knowledge_api_endpoint:
              description: Endpoint URL of the external knowledge API.
              type: string
            external_knowledge_api_id:
              description: ID of the external knowledge API connection.
              type: string
            external_knowledge_api_name:
              description: Display name of the external knowledge API.
              type: string
            external_knowledge_id:
              description: ID of the external knowledge base.
              type: string
          type: object
        external_retrieval_model:
          description: >-
            Retrieval settings for external knowledge bases. `null` for internal
            knowledge bases.
          nullable: true
          properties:
            score_threshold:
              description: Minimum similarity score threshold.
              type: number
            score_threshold_enabled:
              description: Whether score threshold filtering is enabled.
              type: boolean
            top_k:
              description: >-
                Maximum number of results to return from the external knowledge
                base.
              type: integer
          type: object
        icon_info:
          description: Icon display configuration for the knowledge base.
          nullable: true
          properties:
            icon:
              description: Icon identifier or emoji.
              type: string
            icon_background:
              description: Background color for the icon.
              type: string
            icon_type:
              description: Type of icon.
              type: string
            icon_url:
              description: URL of a custom icon image.
              type: string
          type: object
        id:
          description: Unique identifier of the knowledge base.
          type: string
        indexing_technique:
          description: >-
            `high_quality` uses embedding models for precise search; `economy`
            uses keyword-based indexing.
          type: string
        is_multimodal:
          description: Whether multimodal content processing is enabled.
          type: boolean
        is_published:
          description: Whether the knowledge base is published.
          type: boolean
        maintainer:
          description: Display name of the knowledge base maintainer. `null` if not set.
          nullable: true
          type: string
        name:
          description: Display name of the knowledge base. Unique within the workspace.
          type: string
        partial_member_list:
          description: >-
            Account IDs of members granted access when `permission` is
            `partial_members`. Always present on the update response; on the
            detail response, present only when `permission` is
            `partial_members`.
          items:
            type: string
          nullable: true
          type: array
        permission:
          description: >-
            Controls who can access this knowledge base. Possible values:
            `only_me`, `all_team_members`, `partial_members`.
          type: string
        pipeline_id:
          description: Pipeline ID, if a custom processing pipeline is configured.
          nullable: true
          type: string
        provider:
          description: >-
            Provider type. `vendor` for internally managed, `external` for
            external knowledge base connections.
          type: string
        retrieval_model_dict:
          description: Retrieval configuration for the knowledge base.
          properties:
            reranking_enable:
              description: Whether reranking is enabled.
              type: boolean
            reranking_mode:
              description: >-
                Reranking mode. `reranking_model` for model-based reranking,
                `weighted_score` for score-based weighting. `null` if reranking
                is disabled.
              nullable: true
              type: string
            reranking_model:
              description: Reranking model configuration.
              properties:
                reranking_model_name:
                  description: Name of the reranking model.
                  type: string
                reranking_provider_name:
                  description: >-
                    Reranking model provider identifier, formatted as
                    `organization/plugin_name/provider_name` (e.g.
                    `langgenius/cohere/cohere`). Legacy knowledge bases may
                    return the bare short form (e.g. `cohere`).
                  type: string
              type: object
            score_threshold:
              description: >-
                Minimum similarity score for results. Only effective when
                `score_threshold_enabled` is `true`.
              type: number
            score_threshold_enabled:
              description: Whether score threshold filtering is enabled.
              type: boolean
            search_method:
              description: >-
                Search method used for retrieval. `keyword_search` for keyword
                matching, `semantic_search` for embedding-based similarity,
                `full_text_search` for full-text indexing, `hybrid_search` for a
                combination of semantic and keyword approaches.
              type: string
            top_k:
              description: Maximum number of results to return.
              type: integer
            weights:
              description: Weight configuration for hybrid search.
              nullable: true
              properties:
                keyword_setting:
                  description: Keyword search weight settings.
                  properties:
                    keyword_weight:
                      description: Weight assigned to keyword search results.
                      type: number
                  type: object
                vector_setting:
                  description: Semantic search weight settings.
                  properties:
                    embedding_model_name:
                      description: Name of the embedding model used for vector search.
                      type: string
                    embedding_provider_name:
                      description: Provider of the embedding model used for vector search.
                      type: string
                    vector_weight:
                      description: Weight assigned to semantic (vector) search results.
                      type: number
                  type: object
                weight_type:
                  description: Strategy for balancing semantic and keyword search weights.
                  type: string
              type: object
          type: object
        runtime_mode:
          description: Runtime processing mode.
          nullable: true
          type: string
        summary_index_setting:
          description: Summary index configuration.
          nullable: true
          properties:
            enable:
              description: Whether summary indexing is enabled.
              type: boolean
            model_name:
              description: Name of the model used for generating summaries.
              type: string
            model_provider_name:
              description: Provider of the summary generation model.
              type: string
            summary_prompt:
              description: Prompt template used for summary generation.
              type: string
          type: object
        tags:
          description: Tags associated with this knowledge base.
          items:
            properties:
              id:
                description: Tag identifier.
                type: string
              name:
                description: Tag name.
                type: string
              type:
                description: Tag type. Always `knowledge` for knowledge base tags.
                type: string
            type: object
          type: array
        total_available_documents:
          description: Number of documents that are enabled and available.
          type: integer
        total_documents:
          description: Total number of documents.
          type: integer
        updated_at:
          description: Last update timestamp (Unix epoch in seconds).
          type: number
        updated_by:
          description: ID of the user who last updated the knowledge base.
          type: string
        word_count:
          description: Total word count across all documents.
          type: integer
      type: object
  securitySchemes:
    ApiKeyAuth:
      bearerFormat: API_KEY
      description: >-
        Every request authenticates with an API key: `Authorization: Bearer
        {API_KEY}`. App endpoints take an app API key; knowledge endpoints take
        a knowledge base API key ([Get
        Started](/en/api-reference/guides/get-started)).


        Keep keys server-side; never embed them in client code. Requests with a
        missing or invalid key fail with HTTP `401` (`unauthorized`).
      scheme: bearer
      type: http

````