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.

WhoAgents can call this
RESTPOST /v1/imports/history/preview
MCP toolimports_historyPreview
Writesno
AreaImports, 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

FieldTypeRequired
shop_idstring (uuid)yes
kindstring (one of jobs, quotes, invoices, pricebook)yes
csvstringyes
sourcestringno
on_matchstring (one of skip, update)no
mappingarrayno
mapping[].columnstringyes
mapping[].fieldstringyes
presetstring (one of jobber, housecall_pro)no

Example

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

FieldTypeAlways there
kindstringyes
sourcestringyes
on_matchstringyes
headersarrayyes
mappingarrayyes
preview_hashstringyes
recordsintegeryes
createintegeryes
updateintegeryes
skipintegeryes
skip_closedintegeryes
failedintegeryes
row_errorsarrayyes
itemsarrayyes
{
  "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

CodeStatusWhat to do
invalid_input, invalid_token, rate_limitedCan happen on any call. See errors.