Forms
Rename a reusable form block
/a/FormBlock_setName
Rename one reusable block while enforcing the shared report/email block namespace.
When to use this endpoint
Use this for inline name edits in either block-management table.
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 | Existing block ID. |
name | String | Yes | Trimmed non-empty name, at most 64 bytes. |
Example request
$result = FM_api('FormBlock_setName', [
'id' => '4821',
'name' => 'Service summary v2',
]);
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":"invalid or missing parameter: id"} | ID is absent or not positive. |
{"error":"invalid or missing parameter: name"} | Name is absent or blank. |
{"error":"parameter too long: name"} | Name exceeds 64 bytes. |
{"error":"no such form block"} | ID does not exist. |
{"error":"A form or email block with that name already exists"} | Another block of either type has the requested name. |
{"error":"form edits are disabled for this account"} | Definition edits are disabled. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- An unchanged name returns
{"ok":1,"warning":"no change needed"}. - Uniqueness follows database comparison rules and is checked separately from the update; the schema itself does not enforce a unique name.
Side effects
- Updates
nameand the Unix-secondslast_editedvalue. References that store the old name are not rewritten.
See it in Fieldmotion
CRM1
Click a Name cell in either block-management table and leave the field to save it.
CRM2
The same inline rename workflow uses this endpoint.
Related endpoints
FormBlock_getByNameresolves the new name.FormBlock_updateFieldis a generic alternative but does not enforce name uniqueness.