imports.historyRun

Owner only: write a history import the owner confirmed in imports.historyPreview (send its preview_hash, plus the same csv, kind, source, on_match and mapping). Records already imported are matched by old id and skipped or updated, never duplicated. Imported quotes and invoices are drafts and are not sent. mode all_or_nothing (default) or per_row.

WhoAgents can call this
RESTPOST /v1/imports/history/run
MCP toolimports_historyRun
Writesyes, send an Idempotency-Key
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

Say what you did in plain words and what happens next.

Input

FieldTypeRequired
shop_idstring (uuid)yes
kindstring (one of jobs, quotes, invoices, pricebook)yes
csvstringyes
sourcestringno
on_matchstring (one of skip, update)no
mappingarrayyes
mapping[].columnstringyes
mapping[].fieldstringyes
preview_hashstringyes
modestring (one of all_or_nothing, per_row)no

Example

POST https://doingwork.work/v1/imports/history/run
content-type: application/json
Idempotency-Key: 3f1c...

{
  "shop_id": "00000000-0000-4000-8000-000000000000",
  "kind": "jobs",
  "csv": "...",
  "mapping": [
    {
      "column": "...",
      "field": "..."
    }
  ],
  "preview_hash": "..."
}

Output

JSON. The response shape isn't published yet; read the fields you need and ignore the rest. Errors are {code, message, status}.

Errors

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