When to use this endpoint

Use TaskTypes_getDataTable when reproducing CRM2’s Task Types settings table. Use TaskTypes_list for a simple picker.

Authentication and permissions

The request must establish an authenticated tenant context with signed API credentials or a logged-in CRM session. This legacy handler checks or immediately uses the tenant database prefix rather than calling the normal login guard.

It performs no additional Settings-page, role, create, edit, or delete permission check.

Parameters

ParameterTypeRequiredDescription
fieldsNative arrayYesRequested mapped keys: id, name, cDate, and/or lastEdited. Unknown names are skipped and id is always added.
isTableInteger stringNoDefaults to table mode. Integer 0 returns only data and enables optional limit.
draw / start / lengthInteger stringsNoTable draw counter, row offset, and page size; defaults are 0, 0, and 10.
limitInteger stringNoPositive non-table row limit. Zero means unbounded.
orderBy / orderDescMapped field / directionNoExplicit mapped sorting. Field matching has a case-insensitive fallback.
order[0][column] / order[0][dir]DataTables valuesNoPositional fallback sorting; the engine subtracts one for the leading action column.
searchValue / searchFieldString / string or arrayNoCase-insensitive substring search across one mapped field or All.
name / cDate / lastEdited / idScalar or native arrayNoDirect mapped filters. Text scalars use case-insensitive substring matching; integer ID uses equality; arrays use IN.
referenceDate / dateFrom / dateToMapped field / integer day offsetsNoShared inclusive relative-date window in the tenant timezone.
advanceSearch / groupByNative arraysNoShared mapped condition objects and grouping fields used by CRM2’s table widget.

Example request

$table = FM_api('TaskTypes_getDataTable', [
	'fields' => ['id', 'name', 'cDate'],
	'draw' => '2',
	'start' => '0',
	'length' => '25',
	'orderBy' => 'name',
	'orderDesc' => 'asc',
]);

Example response

{
  "data": [
    {"id": "3", "name": "Customer follow-up", "cDate": "2026-09-28 09:15:00"}
  ],
  "draw": 2,
  "recordsTotal": "12",
  "recordsFiltered": "12"
}

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":"missing or invalid parameter: fields"}fields is absent.
{"error":"error in database query"}A generated mapped/filter/pagination query fails.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Task types have no deleted state, so totals include every stored row. No Settings-page or role filter is applied by this route.
  • Table mode returns data, integer draw, and database scalar counts. Non-table mode omits count metadata.
  • Without explicit sorting, the first requested mapped field is used through the shared table convention; do not treat that default as a stable integration order.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found; CRM1 uses TaskTypes_list.

CRM2

Open Settings → Task Types. CRM2’s shared data widget derives the mapped create, detail, update, single-field update, and table routes from the TaskType/TaskTypes prefixes.

Related endpoints