Create a new document

POST

Creates a new Document object from an input file, text content, or chunks. The chosen ingestion_mode determines how the ingestion process is configured:

Ingestion Modes:

  • hi-res: Comprehensive parsing and enrichment, including summaries and possibly more thorough parsing.
  • fast: Speed-focused ingestion that skips certain enrichment steps like summaries.
  • custom: Provide a full ingestion_config to customize the entire ingestion process.

Either a file or text content must be provided, but not both. Documents are shared through Collections which allow for tightly specified cross-user interactions.

The ingestion process runs asynchronously and its progress can be tracked using the returned task_id.

Request

This endpoint expects a multipart form.
filestringOptional

The file to ingest. Exactly one of file, raw_text, or chunks must be provided.

raw_textstringOptional

Raw text content to ingest. Exactly one of file, raw_text, or chunks must be provided.

chunksstringOptional

Pre-processed text chunks to ingest. Exactly one of file, raw_text, or chunks must be provided.

idstringOptional

The ID of the document. If not provided, a new ID will be generated.

collection_idsstringOptional

Collection IDs to associate with the document. If none are provided, the document will be assigned to the user’s default collection.

metadatastringOptional

Metadata to associate with the document, such as title, description, or custom fields.

ingestion_modeenumOptional

Ingestion modes:

  • hi-res: Thorough ingestion with full summaries and enrichment.
  • fast: Quick ingestion with minimal enrichment and no summaries.
  • custom: Full control via ingestion_config.

If filters or limit (in ingestion_config) are provided alongside hi-res or fast, they will override the default settings for that mode.

Allowed values: hi-resfastcustom
ingestion_configstringOptional

An optional dictionary to override the default chunking configuration for the ingestion process. If not provided, the system will use the default server-side chunking configuration.

run_with_orchestrationbooleanOptional

Whether or not ingestion runs with orchestration, default is True. When set to False, the ingestion process will run synchronous and directly return the result.

Response

Successful Response

resultsobject

Errors