Batch upload

Add up to 50 documents in one call.

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 upload URLs for many files

POST/v1/{knowledge_id}/upload-urls/batch

Generate presigned S3 URLs for multiple files in a single request. Returns a batch_id for tracking.

Credential Document Intelligence API key (x-api-key)

Path parameters

NameTypeDescription
knowledge_idrequiredstring

Request body · application/json

NameTypeDescription
filesrequiredarray<BatchUploadFileRequest>List of files to generate upload URLs for (1-50 items)
↳ file_namerequiredstringName of the file
↳ content_typerequiredstringMIME type of the file
user_idstring | nullUser identifier (optional)

Response · 200

NameTypeDescription
uploadsrequiredarray<BatchUploadFileResponse>List of upload URLs for each file
↳ object_idrequiredstringUnique object identifier for the file
↳ file_namerequiredstringName of the file
↳ presigned_urlrequiredstringPresigned URL for uploading the file
↳ download_presigned_urlrequiredstringPresigned URL for downloading the file

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/document-intelligence/api"
API_KEY = os.environ["DOCUMENT_INTELLIGENCE_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/YOUR_COLLECTION_ID/upload-urls/batch",
    headers={"x-api-key": API_KEY},
    json={
        "files": [{
            "file_name": "<file_name>",
            "content_type": "<content_type>",
        }],
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "files": [
    {
      "file_name": "<file_name>",
      "content_type": "<content_type>"
    }
  ]
}

Response shape (200)

JSON
{
  "uploads": [
    {
      "object_id": "<object_id>",
      "file_name": "<file_name>",
      "presigned_url": "<presigned_url>",
      "download_presigned_url": "<download_presigned_url>"
    }
  ]
}

Add many documents

POST/v1/{knowledge_id}/documents/batch

Process multiple files with shared configuration. All files inherit identical processing settings.

Can process files via direct upload (files parameter) or via URLs (file_urls parameter). Files can be uploaded via batch_upload_urls endpoint first, then their URLs are provided here for processing.

All configuration parameters are provided as form fields. If not provided, default values will be used.

Credential Document Intelligence API key (x-api-key)

Path parameters

NameTypeDescription
knowledge_idrequiredstring

Request body · multipart/form-data (optional)

NameTypeDescription
filesarray<file> | nullOptional collection of files to upload and process
file_urlsstring | nullComma-separated file URLs to process
enable_chunkingbooleanEnable chunking (default: true)Default: true
use_llama_parseboolean | nullDeprecated — use document_processing_mode. Defaults to None so 'not sent' stays distinguishable from an explicit false.
document_processing_modestring | nullWhat the documents' content is like: auto (default — reads locally and detects), text_based, scanned, layout_aware, visual, or mixed. Applies to every file in the batch.One of: auto, text_based, scanned, layout_aware, visual, mixed
chunk_sizeintegerChunk size for processing (default: 2000)Default: 2000
transcript_providerTranscribeUsingTranscript provider: 'openai' or 'groq' (default: 'openai')One of: openai, groqDefault: openai

Response · 200

NameTypeDescription
batch_idrequiredstringUnique batch identifier
statusrequiredstringBatch status: 'processing' if any document is being processed, 'failed' if all failed
messagerequiredstringStatus message
documentsrequiredarray<BatchDocumentStatus>List of documents with their status
↳ object_idrequiredstringObject identifier for the document
↳ file_namerequiredstringFile name of the document
↳ statusrequiredstringProcessing status of the document
↳ processing_duration_msnumber | nullProcessing duration in milliseconds (completed_at - created_at)
↳ error_detailstring | nullError detail if status is 'failed'

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/document-intelligence/api"
API_KEY = os.environ["DOCUMENT_INTELLIGENCE_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/YOUR_COLLECTION_ID/documents/batch",
    headers={"x-api-key": API_KEY},
    data={"files": "<files>", "file_urls": "<file_urls>", "enable_chunking": "<enable_chunking>", "use_llama_parse": "<use_llama_parse>", "document_processing_mode": "<document_processing_mode>", "chunk_size": "<chunk_size>", "transcript_provider": "<transcript_provider>"},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Response shape (200)

JSON
{
  "batch_id": "<batch_id>",
  "status": "<status>",
  "message": "<message>",
  "documents": [
    {
      "object_id": "<object_id>",
      "file_name": "<file_name>",
      "status": "<status>"
    }
  ]
}

Get a batch's status

GET/v1/{knowledge_id}/batch/{batch_id}/status

Check processing status for all documents in a batch. Returns aggregated counts and individual document statuses.

Credential Document Intelligence API key (x-api-key)

Path parameters

NameTypeDescription
knowledge_idrequiredstring
batch_idrequiredstringBatch identifier

Response · 200

NameTypeDescription
batch_idrequiredstringUnique batch identifier
totalrequiredintegerTotal number of documents in the batch
completedrequiredintegerNumber of completed documents
processingrequiredintegerNumber of documents currently processing
failedrequiredintegerNumber of failed documents
documentsrequiredarray<BatchDocumentStatus>List of documents with their status
↳ object_idrequiredstringObject identifier for the document
↳ file_namerequiredstringFile name of the document
↳ statusrequiredstringProcessing status of the document
↳ processing_duration_msnumber | nullProcessing duration in milliseconds (completed_at - created_at)
↳ error_detailstring | nullError detail if status is 'failed'
elapsed_since_created_msnumber | nullMilliseconds elapsed from batch creation to now

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/document-intelligence/api"
API_KEY = os.environ["DOCUMENT_INTELLIGENCE_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/YOUR_COLLECTION_ID/batch/YOUR_BATCH_ID/status",
    headers={"x-api-key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Response shape (200)

JSON
{
  "batch_id": "<batch_id>",
  "total": 0,
  "completed": 0,
  "processing": 0,
  "failed": 0,
  "documents": [
    {
      "object_id": "<object_id>",
      "file_name": "<file_name>",
      "status": "<status>"
    }
  ]
}