Skip to main content
POST
Upload Knowledge Base Document
Changes state - verify before retry Upload a knowledge base document to store and index a PDF or TXT file for agent retrieval. The knowledge base must already exist in the authenticated workspace.

Before you begin

  • Create a knowledge base and keep its kb_ ID.
  • Prepare a PDF or TXT file no larger than 100 MB (104857600 bytes).
  • Choose a non-empty title unique within that knowledge base. Each knowledge base allows 25 non-deleted documents.

Upload Knowledge Base Document Request

Optional description and source fields describe the file. Let your HTTP client set the multipart boundary.

Verify the result

A 201 response contains the created document in data, including its ID, title, knowledge base ID, file type, and size. List Knowledge Base Documents and confirm the file is present. Attach the knowledge base to the intended agent and ask a test question covered by the document.

Errors and recovery

Uploading stores a file and indexes its content. It is not an idempotent replacement operation. After an uncertain response, list documents before retrying; changing the title can create duplicate content. To replace an existing document, use dashboard document management.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required

PDF or TXT file, at most 100 MB (104857600 bytes).

title
string
required
Minimum string length: 1
knowledge_base_id
string
required
description
string
source
string

Response

Successful response.

success
boolean
required
error
boolean
required
statusCode
integer
required
message
string
required
data
object
required
timestamp
string<date-time>
required