Forms
Delete a reusable form block
/a/FormBlock_delete
Permanently remove one reusable report or email-template block and its separately uploaded preview image.
When to use this endpoint
Use this after selecting a block from the relevant block-management table. This is permanent; there is no archive or restore counterpart.
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 record-owner or page-permission check. Definition writes are blocked when the tenant’s features2.disableFormEdits flag is 1, except for the temporary setup user identified by userdata.meta.is_tmp=1.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Positive integer | Yes | Tenant form-block ID. Zero, negative, blank, and omitted values are rejected. |
Example request
$result = FM_api('FormBlock_delete', [
'id' => '4821',
]);
Example response
{
"ok": 1
}
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: id"} | The ID is absent or not positive. |
{"error":"Form Block does not exist"} | No tenant block has that ID. |
{"error":"form edits are disabled for this account"} | The tenant setting blocks definition edits for this user. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The lookup does not restrict block type; it can delete an ordinary report block or an email-template block.
- If the row’s
imagefield is non-empty, the conventionalformblocks/<id>.pngobject is removed. Images extracted from HTML code underformblock_images/are not explicitly removed.
Side effects
- Deletes the
form_blocksrow. - May remove the uploaded preview image from file storage.
See it in Fieldmotion
CRM1
Open Settings → Forms → Form Blocks, or Settings → Email Templates → Settings, and delete a block from its table.
CRM2
The corresponding Form Blocks and Email Template Blocks screens use the same endpoint.
Related endpoints
FormBlock_newcreates a replacement block.FormBlocks_getDTsupplies the legacy management tables.