documents
Document upload, processing, and data retrieval
limai documents <subcommand>Upload documents, trigger extraction processing, retrieve extracted data, and submit corrections.
--jsonOutput raw JSON--verboseEnable debug loggingSubcommands
limai documents upload <extractionSchemaId> <file>
Upload a single document for extraction.
limai documents upload <extractionSchemaId> <file>Upload a single document for extraction.
--allow-duplicatesUpload a file whose content the project already stores as a new document instead of skipping itThe file's content is hashed and matched against the documents the project already stores. A match is skipped: no bytes are uploaded, nothing is queued for extraction, and the exit code stays 0, because a duplicate is not an error. The command prints:
Duplicate of existing file <fileId> (<filename>); skipped. Pass --allow-duplicates to upload it as a new document, or run 'limai documents process <extractionSchemaId> <fileId>' to re-extract the existing one.When the match lives in another model the message names it instead, and drops the limai documents process suggestion — that command would fail here, so --allow-duplicates is the only way forward.
With --json it reports {"fileId": "<existing id>", "filename": "...", "isDuplicate": true, "bytesUploaded": 0, "skipped": true, "existingDeploymentId": "<model id or null>", "existingInSameModel": true}.
isDuplicate means the document is already stored in the project, not that it has been extracted. With --allow-duplicates the file uploads as a new document with its own fileId.
limai documents process <extractionSchemaId> <fileId>
Trigger extraction processing on an uploaded document.
limai documents process <extractionSchemaId> <fileId>Process a document for extraction. Runs synchronously by default.
--asyncProcess asynchronously (returns job ID)--waitWait for completion (implies --async)Running this on a document that already has data is a normal, supported action and needs no extra flag. A fresh extraction replaces the document's rows and cells and clears its reviewed flag, so data a person reviewed or corrected is discarded.
limai documents get <fileId>
Get the extracted data for a file.
limai documents get <fileId>Get extracted file data.
--extraction-schema-id <id>The model's extraction schema ID--job-id <id>Validate the read against a specific extraction job (the jobId from process). A wrong or stale ID fails with 404 instead of silently reading another document's job; COMPLETED guarantees the data is present; a queued job reports PROCESSING.--include <options>Comma-separated enrichments: confidence, boundingBoxes, grounding, validations, metadatalimai documents data <deploymentId> <fileIds...>
Get flat, slug-keyed data for one or more documents in a model. The ID may be the model's, a deployment's, or the model's extraction schema ID.
limai documents data <deploymentId> <fileIds...>Get flat slug-keyed data for one or more documents.
--include <options>Comma-separated enrichments: confidence, boundingBoxes, grounding, validations, metadata--include metadata
--include takes a comma-separated list of enrichments and passes it to the API, which rejects an unrecognized value with a 400 naming the allowed ones.
limai documents get <fileId> --include metadata --json
limai documents data <deploymentId> <fileId> --include metadata --jsonmetadata is the one enrichment that touches no cell. It adds a _meta block describing the document the data came from — on the response envelope for documents get, on each entry of documents for documents data:
"_meta": {
"documentId": "cmm3k7r2v0007",
"fileName": "broker-quote-2026-09.pdf",
"submittedAt": "2026-09-01T10:12:33.000Z",
"submittedBy": { "id": "usr_8a2f", "name": "Jane Doe", "email": "jane@acme.com" },
"extractedAt": "2026-09-01T10:14:02.000Z"
}| Field | Description |
|---|---|
documentId | The file's ID. |
fileName | The uploaded file name. |
submittedAt | When the file was uploaded. |
submittedBy | The user who uploaded the document. null when the uploader is unknown. |
extractedAt | When the latest extraction run completed. null when no run has completed. |
The same fields limai schema data --include metadata reports per row. A document carries _meta whatever its status; a file ID the deployment does not have carries none.
limai documents correct <extractionSchemaId> <fileId>
Submit corrections for extracted data.
limai documents correct <extractionSchemaId> <fileId>Submit corrections for extracted data.
--corrections <file>JSON file with corrections (required)Examples
Upload and process synchronously
limai documents upload es_abc123 ./invoice.pdf
limai documents process es_abc123 file_xyz789Upload a second copy of a document the project already stores
limai documents upload es_abc123 ./invoice.pdf --allow-duplicatesProcess asynchronously and wait
limai documents process es_abc123 file_xyz789 --waitGet extracted data as JSON
limai documents get file_xyz789 --jsonGet flat data for several documents with document metadata
limai documents data dep_abc123 file_xyz789 file_uvw456 --include metadata --jsonSubmit corrections
limai documents correct es_abc123 file_xyz789 --corrections fixes.json