When to use this endpoint

Use this for the CRM1-style management grid. Use FormBlocks_list for a lightweight selector or FormBlocks_getDataTable for mapped object rows.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session and is scoped to the authenticated tenant.

The handler performs no form, department, owner, or page-permission check unless the page below says otherwise. CRM navigation may impose additional UI-only access rules.

Parameters

ParameterTypeRequiredDescription
order[0][column]Integer-compatibleYes0 orders by ID and 1 by name; every other value also falls back to name.
order[0][dir]StringYesExact desc selects descending order; every other value becomes ascending.
startInteger-compatibleYesZero-based offset; negative values are not rejected before SQL construction.
lengthPositive integer-compatibleYesPage size; must integer-coerce above zero.
drawInteger-compatibleYesDataTables sequence echoed as an integer.
typeInteger-compatibleNoExact block type; defaults to 0. CRM uses 0 for report blocks and 1 for email-template blocks.

Example request

$table = FM_api('FormBlocks_getDT', [
	'type' => '0',
	'draw' => '3',
	'start' => '0',
	'length' => '25',
	'order' => [['column' => '1', 'dir' => 'asc']],
]);

Example response

{
  "draw": 3,
  "recordsTotal": 18,
  "recordsFiltered": 12,
  "data": [["4821", "Service summary", "92442/formblocks/4821.png", "1790845200"]]
}

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: [order][0][column]"}Order column is absent.
{"error":"missing or invalid parameter: [order][0][dir]"}Direction is absent.
{"error":"missing or invalid parameter: start"}Start is absent.
{"error":"missing or invalid parameter: length"}Length is absent, zero, or negative.
{"error":"missing or invalid parameter: draw"}Draw is absent.

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

Behaviour and edge cases

  • Rows are positional arrays: ID, name, image storage path, then Unix-seconds last_edited.
  • recordsTotal counts both block types, while recordsFiltered counts only the requested type.
  • There is no name search and no tie-break ordering.

See it in Fieldmotion

CRM1

The Form Blocks table sends type 0; Email Template Blocks sends type 1.

CRM2

Current block-management screens use the same legacy table endpoint.

Related endpoints