# imports.commit

Import an RBC CSV with accountId, csv, filename, mapping and idempotencyKey. Preserves the original and deduplicates transactions. Autopilot classifies the new lines afterwards unless skipAi is true.

`POST /api/v1/accounting/imports.commit`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required

MCP tool: `accounting_commit_bank_import`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accountId` | string (ID) | Yes | The ID of a bank, card or payment account, from accounts.list. |
| `csv` | string | Yes | at most 5000000 characters. |
| `filename` | string |  | The file's name, including its extension. 1–255 characters. Default `"statement.csv"`. |
| `currency` | string | Yes | Three-letter currency code, such as CAD or USD. |
| `mapping` | object | Yes | No other fields. |
| `mapping.date` | string | Yes | A date, as YYYY-MM-DD. at least 1 characters. |
| `mapping.description` | string | Yes | A short description. at least 1 characters. |
| `mapping.amount` | string |  |  |
| `mapping.debit` | string |  |  |
| `mapping.credit` | string |  |  |
| `mapping.reference` | string |  |  |
| `mapping.dateFormat` | enum | Yes | One of: `YYYY-MM-DD`, `MM/DD/YYYY`, `DD/MM/YYYY`. |
| `mapping.columns` | array of strings |  | 2–50 items; each 1–100 characters. |
| `idempotencyKey` | string | Yes | 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. |
| `skipAi` | boolean |  |  |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/imports.commit \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "accountId": "4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
  "csv": "example",
  "currency": "CAD",
  "mapping": {
    "date": "2026-09-30",
    "description": "Synthetic example from the docs",
    "dateFormat": "YYYY-MM-DD"
  }
}'
```

Reference page: https://app.getoatmilk.com/docs/api/imports.commit
