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.
| Who | Agents can call this |
| REST | POST /v1/imports/history/run |
| MCP tool | imports_historyRun |
| Writes | yes, send an Idempotency-Key |
| Area | 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
Say what you did in plain words and what happens next.
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 | yes |
mapping[].column | string | yes |
mapping[].field | string | yes |
preview_hash | string | yes |
mode | string (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
| Code | Status | What to do |
|---|---|---|
invalid_input, invalid_token, rate_limited | Can happen on any call. See errors. |