Ingestion

Query Document

Run an on-demand Gemini document query with optional structured output and ingestion.

Args: file: Uploaded source document (PDF or another supported MIME type). prompt: Natural-language instruction to execute against the document. schema: Optional JSON schema enforcing structured Gemini output. ingestion_options: JSON object controlling ingestion follow-up (keys: ingest, use_colpali, folder_name, end_user_id, metadata).

Returns: DocumentQueryResponse containing Gemini outputs, original metadata, and ingestion status details.

post/ingest/document/query

Headers

authorizationstring

Response

Successful Response

{"stackTrail":"components:schemas:DocumentQueryResponse:properties:structured_output:anyOf","oasType":"schema","type":"unknown","title":"Structured Output","description":"Raw structured output returned from Gemini (may be list/dict)","nullable":true}
extracted_metadataobject nullable

Structured output coerced to metadata when possible

text_outputstring nullable

Raw text returned from Gemini when no schema is provided

ingestion_enqueuedboolean

True when the document was queued for ingestion after extraction

input_metadataobject

Original metadata supplied alongside the request

combined_metadataobject

Metadata that would be used if ingestion is performed

ingestion_optionsobject

Normalized ingestion options applied to this request

Changes