Forms
Query the CRM1 Forms table
/a/Forms_getDT
Return the legacy paginated Forms grid as positional rows for one form type and archive mode.
When to use this endpoint
Use this for CRM1’s Forms table. Modern object-shaped tables use Forms_getDataTable.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
length | Integer-compatible | Yes | SQL page size. Presence is required, but zero and negative values are not explicitly rejected. |
start | Integer-compatible | No | Offset, default 0. |
draw | Integer-compatible | No | DataTables sequence, default 0. |
formtype | Integer-compatible | No | Exact type, default 0. Known types are 0 Job, 3 Job Table, 4 Quote, 5 Purchase Order, 6 Quote Table, 7 Invoice, 8 Invoice Table, 9 Opportunity, and 10 Opportunity Table. Other historical values can exist.. |
showArchived | String/integer-compatible | No | Absent or zero selects active forms. Exact string "1" selects archived forms. Other truthy values such as 2 remove the archive filter and show both. |
search[value] | String | No | Case-insensitive substring across name and meta, plus string matching against ID and creation date. |
order[0][column] / order[0][dir] | Integer-compatible / string | No | Sortable column indexes are 0 ID, 1 name, 4 creation date, 6 type, 7 portal visibility, 8 uses stock, 9 invoiceable, 10 department, 11 selected by default, and 12 archived. Exact asc is ascending; other directions descend. |
Example request
$table = FM_api('Forms_getDT', [
'formtype' => '0',
'showArchived' => '0',
'draw' => '4',
'start' => '0',
'length' => '25',
'order' => [['column' => '1', 'dir' => 'asc']],
]);
Example response
{
"draw": 4,
"recordsTotal": "54",
"recordsFiltered": "18",
"data": [[1042, "Service visit", [{"name":"Result","type":"input"}], "", 0, 1, 1, 1, 0, 0, 0, "", "2026-09-01 10:00:00", "service", "[]"]]
}
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":"missing or invalid parameter: length"} | Length is absent; this check occurs before the login check. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Each row has 15 positions: ID, name, decoded fields, blank placeholder, type, portal visibility, uses stock, invoiceable, department ID, selected-by-default, archived, blank placeholder, creation date, meta tags, and raw on-complete JSON.
recordsTotalcounts every tenant form across types and archive states.recordsFilteredapplies the current filters.- Malformed
fieldsormetaJSON can yield null values or runtime warnings; tags default to an empty string only when decoded metadata is an array without that key.
See it in Fieldmotion
CRM1
Open Settings → Forms; paging, type tabs, archive mode, search, and sorting call this endpoint.
CRM2
No production CRM2 caller was found; CRM2 uses Forms_getDataTable.
Related endpoints
Forms_getDataTablereturns named fields.Forms_getExportDatasupports CSV export.