Documents
Upload Documents
Upload one or more documents for a lead. Uses the same pipeline as the in-app Document Vault: S3 storage, action logs, Mastra memory, and document workflow.
POST
This endpoint uploads documents for a lead. Behavior matches the in-app Document Vault: files are stored in S3, a SYSTEM_NOTE and DOCUMENT_UPLOAD action log are created, documents are saved to Mastra memory, and the document workflow runs (validation, extraction, etc.). You can optionally associate uploads with a checklist item via
leadChecklistItemId. Maximum 10 files per request; each file up to 100MB.
Authentication
Requires thex-api-key header with a valid workspace API key.
Request Body (multipart/form-data)
string
required
The Omni lead ID. The lead must exist and belong to your workspace.
file
required
One or more files to upload. Use the form field name
files. Up to 10 files;
each file up to 100MB.string
Optional. Omni lead checklist item ID to associate the uploaded documents
with. The item must belong to the lead.
object[]
Optional. Per-file metadata, index-aligned with
files. When provided, its
length must match the number of files. With multipart/form-data,
send as a JSON-stringified form field.Each entry supports:externalId(string, optional): your own identifier to persist on the document. Returned on the response.name(string, optional): overrides the uploaded filename.
Response
boolean
Whether the request succeeded
array
Array of uploaded document objects: id, externalId, filename, size, url
(presigned), mimeType, uploadedAt, associatedChecklistItemId.
string
The ID of the DOCUMENT_UPLOAD action log entry for this upload