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

ParameterTypeRequiredDescription
length / dateFrom / dateTo / drawInteger-compatibleYesAll 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.
startInteger-compatible offsetNoNonnegative integer offset, default 0. No length=-1 sentinel or maximum page size.
import_typeInteger-compatible codeNoOmit or use -1 for all; otherwise a nonnegative integer exact import_type filter.
order[0].column / order[0].dirNative DataTables orderNoColumn 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

ResponseCondition
{"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