When to use this endpoint

Use Account_setName for CRM1’s inline account-name edit. The CRM2 Finance page uses the bulk snapshot route.

Authentication and permissions

The request must establish an authenticated tenant context with signed API credentials or a logged-in CRM session. This legacy handler checks for the tenant database prefix rather than calling the normal login guard.

It performs no additional Finance-page, client-admin, role, create, edit, or delete permission check.

Parameters

ParameterTypeRequiredDescription
idInteger-compatibleYesPositive account ID.
valStringYesTrimmed nonempty name, maximum 50 bytes according to this legacy setter. Other account writers accept up to the schema’s 128 characters.

Example request

$result = FM_api('Account_setName', [
	'id' => 331042,
	'val' => 'Domestic sales',
]);

Example response

{"ok":1}

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: id"}The ID is absent or not positive.
{"error":"missing or invalid parameter: val"}The value is absent or blank after trimming.
{"error":"name too long. max length 50"}The trimmed value exceeds 50 bytes.

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

Behaviour and edge cases

  • Both name and display_name are overwritten with the same value.
  • An unknown positive ID is a silent no-op that still returns success.

Side effects

  • Advances the account’s last_edited timestamp and clears the account cache.

See it in Fieldmotion

CRM1

Open Settings → Finance. CRM1 loads and edits the Chart of Accounts, Tax Types, and Tax Groups from this endpoint family; filter browser developer tools for the exact function name. Edit an existing Account Name cell to send Account_setName.

CRM2

CRM2 does not call this setter; its Save action sends Account_updateData.

Related endpoints