Customers
Set a customer portal password
/a/Customer_setPassword
Replace the password used by a customer to authenticate to the customer portal.
When to use this endpoint
Use Customer_setPassword only from a protected password-reset or administrative workflow for an existing customer-portal user.
The endpoint accepts plaintext and returns no generated password. Generate, confirm, and communicate credentials through an appropriate secure workflow before calling it.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-like value | Yes | Customer ID. It must be present and convert to a nonzero integer; unlike most customer setters, a negative integer passes validation. The row is not checked for existence. |
password | String | Yes | New plaintext portal password. Empty values and the string "0" are rejected; the handler applies no length, strength, or confirmation rules. |
Example request
$result = FM_api('Customer_setPassword', [
'id' => '1088',
'password' => $newPortalPassword,
]);
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 parameter: id"} | id is omitted or converts to zero. |
{"error":"missing parameter: password"} | password is omitted or is falsey, including an empty string or "0". |
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 handler performs no customer lookup and has no active/deleted filter. It can return success when the ID matches no row.
- There is no password-policy, confirmation, previous-password, or no-change check.
- A fresh salt is generated from runtime values; the portal login code validates the stored MD5 of that salt concatenated with the submitted password.
- This is a single-record mutation; it provides no list filtering or pagination.
Side effects
- The write replaces
password_saltandpassword, updateslast_editedandedited_uuid, and invalidates the customer cache. - The handler writes a customer audit event. It does not fire
Customer_edit, add acustomer_changesrow, or send the password to the customer.
See it in Fieldmotion
CRM1
The legacy Customers page password dialog calls Customer_setPassword. Its UI offers a generated eight-character consonant/vowel password, but that UI convention is not enforced by the endpoint.
CRM2
CRM2’s customer password modal calls the same endpoint and offers a similar generated password. Filter Network requests carefully and avoid exposing the request payload.
Related endpoints
Customer_getretrieves customer data but does not expose a usable plaintext portal password.