Knowledge Bases

Ingest uploaded files

Queues one or more uploaded files for indexing. Call this after uploading each file to the pre-signed URL from Generate a file upload URL. Indexing runs in the background, so the response returns immediately with a task per file.

post/knowledge-bases/{kb_id}/files/ingest

Request

  • Base URL: https://console.hyperstack.cloud/ai/api/v1
  • URL: https://console.hyperstack.cloud/ai/api/v1/knowledge-bases/{kb_id}/files/ingest
  • Auth: API key in header api_key

Path parameters

kb_idinteger required

Numeric ID of the knowledge base. Call the List knowledge bases API to retrieve the id of an existing knowledge base.

Request body

s3_keystring required

Storage key returned when you generated the upload URL. Call the Generate a file upload URL API to retrieve the s3_key for the uploaded file.

filenamestring required

Name of the uploaded file.

mime_type'text/plain' | 'text/markdown' required

MIME type of the file.

file_size_bytesinteger required

Size of the uploaded file, in bytes.

chunking_strategy'semantic'

How the file is split into chunks. Defaults to semantic.

Response

The files were queued for indexing.

file_namestring

Name of the queued file.

file_uuidstring

Stable identifier for the new file, prefixed with kbf-.

ingestion_task_idinteger

ID of the ingestion task. Pass this to the status endpoint.

status'pending'

Initial state of the file.

Changes

No recorded changes to this operation across all 1 revision of this API.