Connectors and webhooks

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.

POST/api/v1/accounting/dataSources.importFiles

Permissions

accounting:readaccounting:write

Who can call it

admin, finance

Retries

Idempotency key required

MCP

accounting_data_sources_import_files

Fields

  • sourceenumRequired

    Where the record came from.

    notiongoogle_driveonedrive
  • targetenumRequired
    receiptstax_sourcessigning_filesexecuted_agreementscontractor_agreementscompany_documents
  • itemsarray of objectsRequired

    1–25 items

  • targetOptionsmap
  • idempotencyKeystringRequired

    Any 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"
    }
  ]
}'
Response
{
  "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.

POST/api/v1/accounting/dataSources.importFiles
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.