Forms
List report themes
POST
/a/Forms_listThemes
List installed report themes, switching between CSS themes and the newer document-generator theme set.
When to use this endpoint
Use this in the form Report Document editor when presenting the Theme selector.
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 |
|---|---|---|---|
phpdocx | Integer-compatible | No | A value above zero selects document-generator themes. Omitted, zero, and negative values enumerate installed CSS files. |
Example request
$themes = FM_api('Forms_listThemes', [
'phpdocx' => '1',
]);
Example response
{
"themes": [["base", "Standard Theme"], ["fm", "FieldMotion"]]
}
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. |
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 theme is
[storedValue, displayLabel]. - CSS mode scans top-level
.cssfiles inreport-styles/www/css, strips the extension, and uses the basename for both values. No explicit ordering is applied. - Document-generator mode always includes
baseandfm. Tenant IDs5357and79696receive additional hard-coded themes.
See it in Fieldmotion
CRM1
The Report Document editor sends the current form’s phpdocx_version state to this endpoint.
CRM2
The same Theme selector uses this endpoint.
Related endpoints
Forms_listSnippetssupplies the adjacent snippet palette.Forms_getByIdreturns a form’s saved report and metadata fields.