When to use this endpoint

Use _ids=1 with table filters to capture the export set, then submit those IDs as JSON with the chosen field names. CRM1 and CRM2 exporters both use this contract.

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
_idsStringYesExact 1 starts the ID phase. Otherwise it must be a JSON array of IDs for the data phase.
type / archived / search / id / name / metaTagsMixedID phaseBasic filters. Type defaults to 0; -1 means all types. Archived values below 2 filter exactly; 2 means both. Search covers ID, name, creation date, and raw metadata.
typeIDList / portalVisibilityList / usesStockList / isInvoiceableList / selectByDefaultList / archivedList / departmentIDListNative arrayNoValidated export inclusion lists.
referenceDateField / dateFromFilter / dateToFilter / isDateUnixString / mixedNoDate-range filter. Both bounds and a recognized field are required; recognized fields include ID, creation/edit date, type, archive, department, portal, stock, invoice, and default-selection fields.
fieldsJSON array stringData phaseAllowed names: archived, id, cdate, department_id, is_invoiceable, meta.tags, name, on_complete, portal_visibility, portal_pickable, select_by_default, form_tables, type, and uses_stock. Colon-containing custom-field names are silently skipped.

Example request

$selection = FM_api('Forms_getExportData', [
	'_ids' => '1',
	'type' => '0',
	'archived' => '0',
]);

$rows = FM_api('Forms_getExportData', [
	'_ids' => json_encode($selection['ids']),
	'fields' => json_encode(['id', 'name', 'type', 'portal_visibility', 'portal_pickable']),
]);

Example response

[
  {"form_id": "1042", "meta": "{\"tags\":\"service\"}", "f0": "1042", "f1": "Service visit", "f2": "Job", "f3": "yes", "f4": "no"}
]

Requested columns are returned as positional aliases f0, f1, and so on; form_id and raw meta are always added.

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: _ids"}Mode selector is absent.
{"error":"_ids should be a JSON array of numbers"}Data-phase IDs do not decode to a non-empty array.
{"error":"fields should be an array of requested field names"}Fields are absent, malformed, or empty.
{"error":"unknown field name: ..."}A non-custom field is outside the allowlist.
{"error":"invalid filter value: ..."}A shared inclusion/date filter rejects a value.

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

Behaviour and edge cases

  • ID-phase results are ascending numeric IDs and are not paginated.
  • Boolean-like export columns become yes/no. Type numbers are converted to display labels. form_tables counts fields whose type is subform.
  • meta, meta.tags, portal_visibility, and portal_pickable can each be requested independently. Pickable is bit 2 of the stored portal visibility value.
  • The data phase does not preserve requested ID order and does not reject missing IDs. It assumes valid JSON in on_complete and fields for derived columns.

See it in Fieldmotion

CRM1

The Forms page export widget performs the two calls.

CRM2

The Forms page first obtains filtered IDs through the modern table, then uses this endpoint to format selected export columns.

Related endpoints