Import history
Page the legacy import history grid
/a/ImportHistory_getDT
List import log rows inside an inclusive Unix-time range.
When to use this endpoint
Use to discover the log row ID for listItems/delete; the first row value is the run identifier, not the log row ID.
Authentication and permissions
Use signed API-key authentication or a logged-in CRM session. API keys act as their owner; session requests use dispatcher CSRF protection when configured.
Requires a valid tenant account and View on pageImportsHistory. Reads and writes use this account’s tenant tables.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
length / dateFrom / dateTo / draw | Integer-compatible | Yes | All required. Nonnegative length/draw. Date bounds accept Unix seconds or real YYYY-MM-DD dates; dates use account timezone, falling back to server timezone, and expand to start/end of day inclusively. Reversed/invalid bounds are rejected. |
start | Integer-compatible offset | No | Nonnegative integer offset, default 0. No length=-1 sentinel or maximum page size. |
import_type | Integer-compatible code | No | Omit or use -1 for all; otherwise a nonnegative integer exact import_type filter. |
order[0].column / order[0].dir | Native DataTables order | No | Column 0 run token, 1 cdate, 2 type, 3 created count, 4 edited count. Default cdate desc; unknown column uses run token. Direction asc/desc only; ID breaks ties. Legacy direct order.dir is supported. |
Example request
$result = FM_api('ImportHistory_getDT', [
'length'=>'10','dateFrom'=>'1793836800','dateTo'=>'1793923199','draw'=>'1',
'order'=>[['column'=>'0','dir'=>'desc']],
]);
Example response
{
"draw": 1,
"recordsTotal": "12",
"recordsFiltered": "1",
"data": [
[
"179387280001",
"1793872800",
"1",
"2",
"0",
"312"
]
]
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error": "permission denied"} | The user lacks the required Imports page action. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Returns tenant history in a positional six-cell format: run token, raw Unix cdate, type, created count, edited count, log-row ID. Use the sixth cell for listItems/delete/deleteById.
- recordsTotal is the tenant total; recordsFiltered applies inclusive date bounds and optional type. Both are calculated before paging. No free-text search is implemented. Date-only input is parsed as a real date rather than truncated to its year.
Side effects
- Reads data without modifying import settings, imported records, history, queues or notifications.
See it in Fieldmotion
CRM1
Load CRM1 Settings > Imports > History and change its date range; inspect ImportHistory_getDT. The UI keeps the sixth cell as the log ID.
CRM2
CRM2 uses ImportHistory_getDataTable with named fields, user/filename and relative dates.
Related endpoints
ImportHistory_getDataTable— Find the log row ID.ImportHistory_listItems— Inspect metadata-associated IDs.ImportHistory_delete— Remove history only.ImportHistory_deleteById— Understand business-record cleanup limitations.