Customers
Set account manager for customers
/a/Customers_setAccountManager
Assign one raw account-manager value to a batch of customers, subject to the tenant transfer password.
When to use this endpoint
Use Customers_setAccountManager for the Customers-page bulk account-manager action.
Validate the target user before calling it. The endpoint itself neither checks that the user exists nor reports which customer IDs matched.
Authentication and permissions
The request must establish tenant context. No additional customer-page permission is checked.
When tenant setting transfer-account-manager-password is nonblank, the request must also supply that password exactly. When the setting is blank, the password parameter is ignored.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
val | Scalar string | Yes | Value stored in account_manager. The handler does not convert to an integer or validate a user record; normal callers send a user ID or 0. |
ids | JSON array string | Yes | Nonempty JSON array of customer IDs. Each value converts to an integer and values below 1 are skipped. |
password | String | Conditional | Plain tenant transfer password when transfer-account-manager-password is configured. It is compared using the application’s salted legacy hash. |
Example request
$result = FM_api('Customers_setAccountManager', [
'ids' => json_encode([1042, 1088]),
'val' => '37',
'password' => 'tenant-confirmation-password',
]);
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: val"} | The val key is absent. Blank is accepted when explicitly supplied. |
{"error":"missing or invalid parameter: ids"} | The ids key is absent. |
{"error":"invalid array: ids"} | ids does not decode to a nonempty array. |
{"error":"incorrect password"} | A tenant transfer password is configured and the supplied password does not match. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Rows are processed individually; duplicate IDs can be revisited and unchanged values are skipped.
- The customer lookup does not require
deleted=0, so soft-deleted rows can be changed. - The password is a tenant confirmation setting, not the authenticated user’s login password.
- There is no pagination or explicit batch limit.
Side effects
- Each changed row receives the account-manager value, new
last_edited, andedited_uuid="Customer_setAccountManager", plus a customer activity-log entry. - Does not write customer change history, send notifications, or fire
Customer_edit.
See it in Fieldmotion
CRM1
Select Customers rows and use the bulk account-manager action. If configured, CRM1 prompts for the transfer password before calling this route.
CRM2
Select Customers rows, choose Set Account Manager, enter the optional tenant password, and filter Network requests for Customers_setAccountManager.
Related endpoints
Customer_setAccountManagervalidates and assigns one customer manager through its separate contract.Customer_updateDataaccepts the mappedaccountManagerpicker but does not apply this transfer-password gate.