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, include_won and mapping). Records already imported are matched by old id and skipped or updated, never duplicated. Imported open quotes and invoices are drafts and are not sent. With include_won, won and declined quotes are imported as history: they price later drafts, and they are never sent, invoiced, followed up, or shown as signed work to bill. Maintenance plans become service-due reminders (no invoice, no charge), or with plans_as billed, maintenance plans at the confirmed price with auto_send off and no invoice until the next due date; payments become read-only history records (no charge, no fee, no invoice change). flat_rate rows become price book tasks, matched by old id, then task code, then name. mode all_or_nothing (default) or per_row. The Jobber preset is beta: a row or column it cannot map is skipped, the rest are imported, and the summary says what was skipped and why.

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

Owner only: write a history import the owner confirmed in imports.historyPreview (send its preview_hash, plus the same csv, kind, source, on_match, include_won and mapping). Records already imported are matched by old id and skipped or updated, never duplicated.

What to tell the owner

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

Input

FieldTypeRequired
shop_idstring (uuid)yes
plans_asstring (one of reminders, billed)no
include_wonbooleanno
kindstring (one of jobs, quotes, invoices, pricebook, equipment, maintenance_plans, payments, flat_rate)yes
csvstringyes
sourcestringno
on_matchstring (one of skip, update)no
mappingarrayyes
mapping[].columnstringyes
mapping[].fieldstringyes
equipment_kindstringno
preview_hashstring (sha256)yes
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.