When to use this endpoint

Use when reproducing the CRM1 Users screen. Prefer Users_getDataTable for named mapped output; the column positions here depend on account features.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session. Session requests use the dispatcher’s CSRF protection when configured.

Configured TeamAccess row scope is applied in the queries. Ordinary collection requests do not need artificial record IDs. Explicit IDs still pass dispatcher record authorization; unavailable IDs can be rejected there rather than silently omitted.

Explicit Users View is required.

Parameters

ParameterTypeRequiredDescription
drawInteger stringYesRequired nonnegative integer, echoed as an integer.
startInteger stringNoNonnegative integer offset; defaults to 0.
lengthInteger stringNoDefault 100; integer from 1 to 10000. -1 does not mean all rows.
orderNative nested arrayNoNative list of order entries with nonnegative column and asc/desc direction. First column selects 1 name, 2 email, 4 date_created, 5 active, 8 app_repo; other columns sort by name.
search[value]Nested stringNoCase-insensitive name/email and textual-ID substring search, trimmed; this is not the mapped searchValue control.
name / email / date_createdStringsNoAdditional substring filters combined with AND. Name is lowercased; email applies the legacy double-escaping path. SQL wildcard characters are not literal-only matching.
activeInteger stringNoBlank/omitted/-1 leaves active unfiltered; 0 or 1 selects inactive/active users.
dept_idInteger stringNoNonnegative department ID; zero disables the filter. Numeric membership boundaries work with CSV and CRM2 JSON storage.

Example request

$result = FM_api('Users_getDT', [
	'draw'=>'1',
	'start'=>'0',
	'length'=>'10',
]);

Example response

{
  "recordsTotal": "1",
  "recordsFiltered": "1",
  "draw": 1,
  "data": [
    [
      "1042",
      "Alex Morgan",
      "alex@example.test",
      "18",
      "2026-11-03 09:00:00",
      "1",
      0,
      "app2025-javascript",
      "",
      "",
      ""
    ]
  ]
}

Example has preConvert/GPS off and simulator off. Conditional columns change row length; do not use one fixed positional schema across accounts.

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: draw"}draw absent/null.
{"error":"invalid parameter: example"}A supplied native control is malformed; the response names that control. Lists must be flat, and numeric IDs must be positive integers unless the parameter explicitly permits zero.

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

Behaviour and edge cases

  • Always filters current parent and SQL-null is_tmp, but includes active and inactive users unless active is supplied. recordsTotal applies only base filters; recordsFiltered includes search filters.
  • Base positions 0–8 are id,name,email,departments,date_created,active,archive-enabled numeric 0/1,app_repo,last_activity. The archive flag comes from app_permissions bit value 32, not a dedicated column.
  • If employer meta.preConvert is positive, appends role_id. GPS feature bit 16 then appends [Unix cdate,lat,lng] for latest GPS or numeric 0. If simulator feature bit 536870912 is off, appends one blank simulator column. A final blank action column is always appended.
  • last_activity is each user’s own MAX(activity_log.timestamp), explicitly correlated through the outer user ID. It is integer-converted, or blank when absent.
  • Users View and row scope apply to data and counts. Ordering appends user ID as a stable ascending tiebreaker.

Side effects

  • Reads data without changing business records, edit markers, activity history or notifications. Shared setting reads can populate their normal settings cache.

See it in Fieldmotion

CRM1

Open CRM1 Users and filter Users_getDT while changing a column filter or sorting. The table sends DataTables native controls plus its own filters.

CRM2

No direct CRM2 caller was found; CRM2 uses Users_getDataTable.

Related endpoints