Maintain Knowledge Base via API
Authentication and invocation methods are consistent with the application Service API. The difference is that a single knowledge base API token can operate on all knowledge bases.
Advantages of Using Knowledge Base API
Synchronize your data system with Dify knowledge bases to create powerful workflows.
Provide knowledge base list, document list, and detail queries to facilitate building your own data management page.
Support both plain text and file uploads and updates for documents, and support batch addition and modification at the segment level to streamline your synchronization process.
Reduce the time spent on manual document processing and synchronization, enhancing your visibility into Dify's software and services.
How to Use
Navigate to the knowledge base page, and you can switch to the API ACCESS page from the left navigation. On this page, you can view the dataset API documentation provided by Dify and manage the credentials for accessing the dataset API in API Keys.
API Call Examples
Create an Empty Dataset
Only used to create an empty dataset
Dataset List
Create Document by Text
Create Document by File
Get Document Embedding Status (Progress)
Delete Document
Dataset Document List
Add Segments
Delete Document Segment
Error Messages
document_indexing
: Document indexing failedprovider_not_initialize
: Embedding model not configurednot_found
: Document not founddataset_name_duplicate
: Dataset name duplicateprovider_quota_exceeded
: Model quota exceededdataset_not_initialized
: Dataset not initializedunsupported_file_type
: Unsupported file typeCurrently supported: txt, markdown, md, pdf, html, htm, xlsx, docx, csv
too_many_files
: Too many files, currently only single file uploads are supportedfile_too_large
: File too large, supports files under 15MB
Last updated