Documents
Add documents, follow their processing, and remove them.
Base URL https://futuresmart.ai/document-intelligence/api · every request sends x-api-key. Samples read the key from DOCUMENT_INTELLIGENCE_API_KEY. All endpoints
Get an upload URL
/v1/{knowledge_id}/upload-urlCredential Document Intelligence API key (x-api-key)
Path parameters
| Name | Type | Description |
|---|---|---|
knowledge_idrequired | string |
Request body · application/x-www-form-urlencoded
| Name | Type | Description |
|---|---|---|
file_namerequired | string | |
content_typerequired | string |
Other responses
422Validation Error
List documents
/v1/{knowledge_id}/documentsCredential Document Intelligence API key (x-api-key)
Path parameters
| Name | Type | Description |
|---|---|---|
knowledge_idrequired | string |
Query parameters
| Name | Type | Description |
|---|---|---|
content_type | string | null | |
metadata_filter | string | null | Optional JSON-encoded metadata filter dict |
include_source_id | boolean | When true (with metadata_filter), return [{object_id, source_id}] instead of bare object_ids |
include_metadata | boolean | When true (with metadata_filter), return [{object_id, metadata}] with full payload inline in a single call (avoids per-doc metadata fetches) |
limit | integer | null | Max docs for the filtered path (default 15; raise for full-folder reconcile sweeps) |
match_all | boolean | Optional. false (default) = loose OR (match at least one), preserving legacy behavior; true = strict AND (every metadata_filter field must match, e.g. to scope by space_id) |
Other responses
422Validation Error
Add a document
/v1/{knowledge_id}/documentsCredential Document Intelligence API key (x-api-key)
Path parameters
| Name | Type | Description |
|---|---|---|
knowledge_idrequired | string |
Request body · multipart/form-data (optional)
| Name | Type | Description |
|---|---|---|
text | string | null | |
file | file | null | |
file_url | string | null | |
weblink | string | null | |
use_llama_parse | boolean | null | |
document_processing_mode | string | null | What the document's content is like: auto (default — reads locally and detects), text_based, scanned, layout_aware, visual, or mixed. Ignored for plain text content, which has no scanned/layout/visual dimension. For a weblink it applies two ways: a URL that resolves to a file (PDF/DOCX/plain text) picks LlamaParse settings, exactly like an uploaded file; a URL that resolves to an HTML page picks the scraper (auto/text_based/scanned -> Newspaper, layout_aware/visual/mixed -> FireCrawl with boilerplate-stripping off) — see fs-agent-workers/docs/plan/document-processing/archive/design-weblink-modes.md for the full table. Omit to inherit the legacy use_llama_parse behaviour. |
transcript_provider | TranscribeUsing | |
scrape_using | ScrapeUsing | Deprecated, no effect. The scraper is now chosen from document_processing_mode. |
scraping_method | ScrapingMethod | |
max_depth | integer | null | |
chunk_size | integer | null | |
enable_chunking | boolean | null | |
extra_metadata | string | null | Optional JSON string of arbitrary key-value metadata |
Other responses
422Validation Error
List documents (paginated)
/v2/{knowledge_id}/documentsList documents with long-lived presigned URLs (7-day expiry with DB caching).
Supports the Knowledge Upload Status window: search uploaded items by file_name or object_id, and get direct links to both the original uploaded document and its parsed/extracted document. Also backs the Knowledge screen's document table — this endpoint previously returned every matching document in one response with no pagination or sort, which was fine at small counts and wrong at any real one.
Sorted and paginated here in Python, not in SQL: retrieve_chatbot_knowledge_v2 groups crawled sub-pages under their parent document (sub_urls) AFTER fetching every matching row, so a SQL-level OFFSET/LIMIT could split a parent from its own children across pages. Sorting/slicing the already-grouped result keeps every parent with its children on one page — the cost is holding the knowledge base's full filtered document set in memory for the sort, the same tradeoff the v2 tabular data view (get_data_view_tabular_v2) already makes for its multi-field sort. Presigned URLs are generated only for the returned page, not the whole set, so pagination is also what keeps this endpoint's S3 URL-signing cost bounded.
Returns: - source_presigned_url: Presigned URL for original uploaded file (7-day expiry, cached in DB) - extracted_s3_url: Presigned URL for extracted markdown text (7-day expiry) - source: where the document came from — "clickup" for a connector-synced page, otherwise the row's content_type value unchanged ("file" / "url" / "plain_text"). Only "clickup" is new: a synced page is posted through the ordinary file_url path, so content_type calls it a "file" and cannot tell the two apart; the connector's identity survives only in extra_metadata. - document_processing_mode: the mode the document was requested to be read in ("text_based", "scanned", "layout_aware", "visual", "mixed"). Requested, not effective — the worker may auto-shift a mode it finds wrong (an image-only PDF shifts to OCR) and does not report that back to this service. - total_count / current_page / total_pages: pagination metadata
Credential Document Intelligence API key (x-api-key)
Path parameters
| Name | Type | Description |
|---|---|---|
knowledge_idrequired | string |
Query parameters
| Name | Type | Description |
|---|---|---|
content_type | string | null | |
file_name | string | null | Search uploaded items by file name (case-insensitive partial match) |
object_id | string | null | Search uploaded items by object ID (case-insensitive partial match) |
page | integer | 1-indexed page number. |
page_size | integer | Documents per page. |
sort_by | string | One of: created_time, file_name, status, updated_time. |
order | string | 'asc' or 'desc'. |
Other responses
422Validation Error
Delete a document
/v1/{knowledge_id}/documents/{object_id}Credential Document Intelligence API key (x-api-key)
Path parameters
| Name | Type | Description |
|---|---|---|
knowledge_idrequired | string | |
object_idrequired | string |
Other responses
422Validation Error
Get a document's processing status
/v1/{knowledge_id}/documents/{object_id}/statusCredential Document Intelligence API key (x-api-key)
Path parameters
| Name | Type | Description |
|---|---|---|
knowledge_idrequired | string | |
object_idrequired | string |
Other responses
422Validation Error
Get a document's deletion status
/v1/{knowledge_id}/documents/{object_id}/deletion-statusCredential Document Intelligence API key (x-api-key)
Path parameters
| Name | Type | Description |
|---|---|---|
knowledge_idrequired | string | |
object_idrequired | string |
Other responses
422Validation Error
Get document summaries
/v1/{knowledge_id}/documents/summariesCredential Document Intelligence API key (x-api-key)
Path parameters
| Name | Type | Description |
|---|---|---|
knowledge_idrequired | string |
Query parameters
| Name | Type | Description |
|---|---|---|
query | string | null | Search query over document summaries |
mode | string | null | Search mode: 'hybrid' (default, RRF fusion) or 'semantic' (dense-only) |
metadata_filter | string | null | Optional JSON-encoded metadata filter dict |
match_all | boolean | Optional. Metadata-only path (no query): false (default) = loose OR; true = strict AND (e.g. to scope by space_id). The search path (query set) already applies filters as AND. |
limit | integer | null | Optional limit for number of documents |
include_metadata | boolean | Include document metadata with summaries |
include_summary | boolean | Include document summary in response (default: true) |
Request body · application/json (optional)
| Name | Type | Description |
|---|---|---|
object_idsrequired | array<string> |
Response · 200
| Name | Type | Description |
|---|---|---|
summariesrequired | object |
Other responses
422Validation Error
Example request body
{
"object_ids": [
"<object_ids>"
]
}Response shape (200)
{
"summaries": {}
}