dataSources.importFiles
Import up to 25 files from a data source into Oatmilk: receipts (processed like uploaded receipts), tax_sources (supporting originals, no expense), signing_files (documents to send for signature), executed_agreements (agreements signed elsewhere; targetOptions parties, executedOn, title) contractor_agreements (draft documents; optional targetOptions contractorId, expectedContractorRevision and title create the draft agreement) or company_documents (incorporation papers and other company records: each is filed through intake as a company record, read, and fills the company profile's empty fields; the record is the document id). Sources are notion and google_drive. Each file is downloaded server-side, checked against its target's size limit and file types by its contents, and run through that target's usual upload path. Importing the same file into the same place again returns the existing record. Returns a result for each file. Supply idempotencyKey.
/api/v1/accounting/dataSources.importFilesPermissions
Who can call it
Retries
MCP
accounting_data_sources_import_filesFields
sourceenumRequiredWhere the record came from.
notiongoogle_driveonedrivetargetenumRequiredreceiptstax_sourcessigning_filesexecuted_agreementscontractor_agreementscompany_documentsitemsarray of objectsRequired1–25 items
targetOptionsmapidempotencyKeystringRequiredAny unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match.
8–200 characters
Example
curl https://app.getoatmilk.com/api/v1/accounting/dataSources.importFiles \
-H "Authorization: Bearer $OATMILK_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"source": "notion",
"target": "receipts",
"items": [
{
"itemId": "item_id",
"fileId": "file_id"
}
]
}'{
"data": { … }
}Try it
Try it
Checks your input with this action’s real schema and answers like the API, with synthetic data. No key needed, and nothing changes.
curl https://app.getoatmilk.com/api/v1/accounting/dataSources.importFiles \
-H "Authorization: Bearer $OATMILK_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"source": "notion",
"target": "receipts",
"items": [
{
"itemId": "item_id",
"fileId": "file_id"
}
]
}'More in Connectors and webhooks.