---
title: "Upload table document"
method: POST
path: "/v1alpha1/public/knowledge-base/document/upload/table"
tags: ["KBPublicApiDocument", "Public-Docs"]
---

# Upload table document

`POST /v1alpha1/public/knowledge-base/document/upload/table`

Upload a structured document to the knowledge base.

## Query parameters

- `overwrite` union — If set to true, the existing table with the same name will be overwritten.
  - boolean
  - 'true' | 'false'
- `markdownConversion` union — When enabled, HTML is automatically converted to markdown to generate better chunks.
  - boolean
  - 'true' | 'false'
- `llmBasedChunks` union
  - boolean
  - 'true' | 'false'
- `llmGeneratedQ` union — When enabled, an LLM will be used to generate a question based on the document context and specific chunk, then prepend it to the chunk. This enhances retrieval by aligning chunks with potential user queries.
  - boolean
  - 'true' | 'false'
- `llmContentSummarization` union — When enabled, an LLM summarizes and rewrites the content, removing unnecessary information and focusing on important parts to optimize for retrieval. Limited to 15 rows per table upload.
  - boolean
  - 'true' | 'false'
- `llmPrependContext` union — When enabled, an LLM generates a context summary based on the document and chunk context, and prepends it to each chunk. This improves retrieval by providing additional context to each chunk. Note: If both llmGeneratedQ and llmPrependContext are set to true, llmGeneratedQ takes precedence, and the context summarization will not be applied.
  - boolean
  - 'true' | 'false'

## Request body

- object
  - `data` object, required
    - `name` string, required — A unique name identifying the table.
    - `schema` object
      - `searchableFields` string[], required
      - `metadataFields` string[]
    - `items` object[], required — An array of items to be included in the table. Each item can have completely custom fields of various types including string, number, array, or object.
    - `folderID` string
    - `url` string — The source URL of the document.
    - `documentMetadata` object[] — An array of document metadata fields. > **💡 Tip:** This metadata can be used in agent KB metadata filter conditions. [Learn more about metadata filtering](/documentation/build/querying-the-knowledge-base#meta-data-filtering).
      - `key` string, required
      - `values` string[], required
    - `projectEnvironmentIDOrAlias` string — The alias of the environment to target (ie. `main`). You can find this in the environments page of your agent. > **💡 Tip:** [Learn more about Environments](/documentation/deploy/environments).

## Response `200`

The document was uploaded successfully.

- DocumentFindOnePublicResponse
  - `chunks` KBDocumentChunk[]
    - `chunkID` string, required
    - `content` string, required
    - `metadata` object
  - `data` object, nullable, required
    - `documentID` string, required
    - `data` union, required
      - KBDocumentUrlData
        - `type` 'url', required
        - `name` string, required
        - `url` string, required
        - `refreshRate` 'daily' | 'weekly' | 'monthly' | 'never'
        - `lastSuccessUpdate` string
        - `accessTokenID` number
        - `integrationExternalID` string
        - `source` 'zendesk' | 'shopify'
      - KBDocumentDocxData
        - `type` 'docx', required
        - `name` string, required
        - `url` string, nullable
      - KBDocumentPDFData
        - `type` 'pdf', required
        - `name` string, required
        - `url` string, nullable
      - KBDocumentTextData
        - `type` 'text', required
        - `name` string, required
        - `canEdit` boolean
        - `url` string, nullable
      - KBDocumentMarkdownData
        - `type` 'md', required
        - `name` string, required
        - `url` string, nullable
      - KBDocumentCSVData
        - `type` 'csv', required
        - `name` string, required
        - `rowsCount` number
        - `url` string, nullable
      - KBDocumentXLSXData
        - `type` 'xlsx', required
        - `name` string, required
        - `rowsCount` number
        - `url` string, nullable
      - KBDocumentTableData
        - `type` 'table', required
        - `name` string, required
        - `rowsCount` number, required
        - `url` string, nullable
    - `updatedAt` string, date-time, required
    - `status` KBDocumentStatus, required
      - `type` 'ERROR' | 'PENDING' | 'SUCCESS' | 'INITIALIZED', required
      - `data` unknown
  - `metadata` DocumentMetadataFields[]
    - `key` string, required
    - `values` string[], required

---

[API](https://skmtc.dev/voiceflow/apis/general-runtime.md) · [All operations](https://skmtc.dev/voiceflow/apis/general-runtime/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/voiceflow/general-runtime/revisions/6b1c4f778c56/schema)
