Skip to content

Create Document

Create a new document record in Last Mile Intelligence.

createDocument

document

ParameterTypeRequiredDefaultDescription
Document DataJSONYes-Document object with required fields
FieldTypeRequiredDescription
namestringYesDocument name
typestringYesDocument type (receipt, pod, invoice, etc.)
entityTypestringNoAssociated entity type (order, task, etc.)
entityIdstringNoAssociated entity ID
contentbinaryNoFile content (base64 encoded)
{
"id": "doc_new123",
"name": "New Document",
"type": "receipt",
"mimeType": "application/pdf",
"url": "https://storage.lmi.com/documents/doc_new123.pdf",
"createdAt": "2024-06-21T09:00:00Z"
}
{
"success": false,
"error": "Validation failed",
"details": {
"name": "Name is required"
}
}
  • Missing API Token: LMI credential is missing API token
  • Validation Error: Required fields missing or invalid
  • File Too Large: Document exceeds maximum file size
  • Permission Denied: API token lacks permission for this operation