--- title: imports.historyPreview | Doing Work API description: Dry run of a history import (kind jobs, quotes, invoices or pricebook). Writes nothing. Returns a suggested mapping, what each record would do (create, upd url: https://doingwork.work/docs/reference/imports-historypreview/ --- # imports.historyPreview Dry run of a history import (kind jobs, quotes, invoices or pricebook). Writes nothing. Returns a suggested mapping, what each record would do (create, update, skip, skip_closed or error) with how its customer matched, and a preview_hash. Show it to the owner; imports.historyRun needs the same hash. | | | |---|---| | Who | Agents can call this | | REST | `POST /v1/imports/history/preview` | | MCP tool | `imports_historyPreview` | | Writes | no | | Area | [Imports, custom fields, tags and search](https://doingwork.work/docs/reference/#imports-custom-fields-tags-and-search) | ## When to use it Move a shop's customer list in from a CSV, including files exported from Jobber, Housecall Pro and CompanyCam. Ask imports.fields what can be filled, run imports.preview to see how each column maps and what would go wrong, show that to the owner, and only then call imports.run with the mapping they confirmed. ## What to tell the owner Tell them what you found in plain words. Don't read back raw fields. ## Input | Field | Type | Required | |---|---|---| | `shop_id` | string (uuid) | yes | | `kind` | string (one of jobs, quotes, invoices, pricebook) | yes | | `csv` | string | yes | | `source` | string | no | | `on_match` | string (one of skip, update) | no | | `mapping` | array | no | | `mapping[].column` | string | yes | | `mapping[].field` | string | yes | | `preset` | string (one of jobber, housecall_pro) | no | ## Example ```http POST https://doingwork.work/v1/imports/history/preview content-type: application/json Idempotency-Key: 3f1c... { "shop_id": "00000000-0000-4000-8000-000000000000", "kind": "jobs", "csv": "..." } ``` ## Output | Field | Type | Always there | |---|---|---| | `kind` | string | yes | | `source` | string | yes | | `on_match` | string | yes | | `headers` | array | yes | | `mapping` | array | yes | | `preview_hash` | string | yes | | `records` | integer | yes | | `create` | integer | yes | | `update` | integer | yes | | `skip` | integer | yes | | `skip_closed` | integer | yes | | `failed` | integer | yes | | `row_errors` | array | yes | | `items` | array | yes | ```json { "kind": "...", "source": "...", "on_match": "...", "headers": [ "..." ], "mapping": [ {} ], "preview_hash": "...", "records": 1, "create": 1, "update": 1, "skip": 1, "skip_closed": 1, "failed": 1, "row_errors": [ {} ], "items": [ {} ] } ``` ## Errors | Code | Status | What to do | |---|---|---| | `invalid_input`, `invalid_token`, `rate_limited` | | Can happen on any call. See [errors](https://doingwork.work/docs/errors/). |