# dataImports.preview

Read every row of the database with a column mapping and group the rows: ready, needs a decision (a new or ambiguous customer or contractor, an invoice number already in Oatmilk, or a possible duplicate payment), already imported, can't import (with the reason), or left out. Nothing is saved. Payment and tax columns are never read, and what they hold is hidden anywhere else in the preview.

`GET | POST /api/v1/accounting/dataImports.preview`

Permissions: `accounting:read` · Roles: admin, finance

MCP tool: `accounting_data_imports_preview`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `target` | enum | Yes | One of: `invoices`, `contractor_payments`. |
| `source` | enum |  | Where the record came from. One of: `notion`. Default `"notion"`. |
| `databaseId` | string | Yes | 1–200 characters. |
| `mapping` | object | Yes | No other fields. |
| `mapping.columns` | map | Yes |  |
| `mapping.statusMap` | map |  | Default `{}`. |
| `mapping.defaultCurrency` | string or null |  | Default `null`. |
| `mapping.dateOrder` | enum or null |  | One of: `mdy`, `dmy`. Default `null`. |
| `mapping.reviewCustomers` | boolean |  |  |
| `mapping.customerRelationPath` | array of strings |  | at most 3 items; each 1–100 characters. |
| `mapping.customerRelationDirect` | boolean |  |  |
| `mapping.rowOverrides` | map |  |  |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/dataImports.preview \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "target": "invoices",
  "databaseId": "example",
  "mapping": {
    "columns": {}
  }
}'
```

Reference page: https://app.getoatmilk.com/docs/api/dataImports.preview
