API ReferenceDeployments
Document Detail
Get document details, pages, and content for a specific file
Get Document Detail
GET
/api/v1/deployments/{deploymentId}/documents/{fileId}Returns detailed information about a document including its metadata, row references, file conversions, and validation results.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
deploymentId | string | path | Yes | The model or deployment ID |
fileId | string | path | Yes | The file ID |
Request
const res = await fetch(
"https://app.limai.io/api/v1/deployments/dep_abc123/documents/file_001",
{
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
},
}
);
const doc = await res.json();Response
Response200
{
"id": "file_001",
"name": "invoice.pdf",
"originalExtension": "pdf",
"status": "EXTRACTED",
"extractionStatus": "COMPLETED",
"validationStatus": "pending",
"validationExpected": true,
"validationAttemptId": "clx8f2k9a0001",
"isReviewed": false,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:31:00.000Z",
"confidenceScore": 0.92,
"validationFailCount": 0,
"inExamplePool": false,
"alias": null,
"metadata": null,
"conversions": [
{
"extension": "md",
"status": "COMPLETED"
}
],
"rows": [
{
"rowId": "row_001",
"status": "PENDING",
"tableId": "tbl_001"
}
],
"validations": {
"crossField": [],
"row": [],
"document": []
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | The file ID. |
name | string | Original file name. |
originalExtension | string | Extension of the uploaded file. |
status | string | Upload-level file status (UPLOADED, EXTRACTED, FAILED, …). |
extractionStatus | COMPLETED | PROCESSING | FAILED | Derived from the latest extraction job for this document. COMPLETED when no job is in flight or failed. Matches the status returned by Document Data. |
validationStatus | pending | passed | failed | error | null | Document-wide aggregate over every validation check recorded for the document, across all attempts — it is not scoped to validationAttemptId. pending while any check is queued or running, failed when a check reports findings, error when a check could not run, null when no validation has ever been recorded for the document. |
validationExpected | boolean | Whether validation is configured for this document — enabled validation scripts on its schema, or a validator agent routed to the deployment. When true and validationStatus is null, validation has not been dispatched yet. |
validationAttemptId | string | null | Identifier of the most recent validation attempt. Correlates this document with the DOCUMENT_VALIDATION_STARTED, DOCUMENT_VALIDATION_FAILED, and DOCUMENT_VALIDATED webhook events of the same attempt. Use it for event correlation, not to interpret validationStatus: after a partial revalidation the two lanes can sit on different attempts, and validationStatus still answers the document-wide question "is this document validated?". |
isReviewed | boolean | Whether a human has reviewed the extraction. |
createdAt | string | ISO 8601 creation timestamp. |
updatedAt | string | ISO 8601 last-update timestamp. |
confidenceScore | number | null | Overall extraction confidence, null when not computed. |
validationFailCount | number | Number of failing validation checks recorded on the document. |
inExamplePool | boolean | Whether the document is part of the deployment's example pool. |
alias | string | null | User-assigned alias. |
metadata | object | null | Metadata attached at upload time. |
conversions | array | Derived artifacts, each {extension, status}. |
rows | array | Extracted rows, each {rowId, status, tableId}. |
validations | object | Rule-based validation results grouped by crossField, row, and document. |
Polling this endpoint alone is enough to follow a document end to end: extractionStatus covers extraction, and validationExpected plus validationStatus tell you whether to keep waiting for validation or that none is coming.
Get Document Pages
GET
/api/v1/deployments/{deploymentId}/documents/{fileId}/pagesReturns page-level access URLs for a document. For PDFs, returns a single PDF URL. For images, returns the image URL directly.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
deploymentId | string | path | Yes | The model or deployment ID |
fileId | string | path | Yes | The file ID |
Request
const res = await fetch(
"https://app.limai.io/api/v1/deployments/dep_abc123/documents/file_001/pages",
{
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
},
}
);
const pages = await res.json();Response
Response200
{
"fileId": "file_001",
"fileName": "invoice.pdf",
"type": "pdf",
"pageCount": 3,
"pdfUrl": "https://s3.amazonaws.com/...presigned-url...",
"pages": []
}Get Document Content
GET
/api/v1/deployments/{deploymentId}/documents/{fileId}/contentReturns the document content including markdown text, PDF URL, and source file URL.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
deploymentId | string | path | Yes | The model or deployment ID |
fileId | string | path | Yes | The file ID |
Request
const res = await fetch(
"https://app.limai.io/api/v1/deployments/dep_abc123/documents/file_001/content",
{
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
},
}
);
const content = await res.json();Response
Response200
{
"fileId": "file_001",
"fileName": "invoice.pdf",
"markdownContent": "# Invoice\\n\\nInvoice Number: INV-2025-001\\n...",
"pdfUrl": "https://s3.amazonaws.com/...pdf-url...",
"sourceFileUrl": "https://s3.amazonaws.com/...source-url...",
"hasMarkdown": true,
"hasPdf": true,
"originalExtension": "pdf"
}