When to use this endpoint

Use Vehicle_setReg only for the legacy table editor. Mapped clients should update name or reg with Vehicle_updateData.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login but performs no additional Vehicles-page, create, edit, delete, or role-permission check.

All reads and writes use the authenticated tenant’s tables. CRM1 and CRM2 may hide controls through client-side permissions; these routes do not repeat those UI checks.

Parameters

ParameterTypeRequiredDescription
idInteger-compatible or 32-character stringEffectively yesNumeric vehicle ID or a 32-character UUID. Missing and invalid values can still return success.
valStringNo validationReplacement registration. The handler accepts blank, duplicate, and arbitrarily long values without normalisation.

Example request

$result = FM_api('Vehicle_setReg', [
	'id' => '30124',
	'val' => '241-D-12001',
]);

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.

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

Behaviour and edge cases

  • Case, whitespace, and punctuation are preserved. Registration normalisation used for tracking suggestions does not alter this stored value.
  • Unknown IDs and unchanged registrations still return success.

Side effects

  • Updates reg, advances last_edited, sets edited_uuid to Vehicle_setReg, and invalidates the vehicle cache.
  • It does not write Core field history.

See it in Fieldmotion

CRM1

Open Settings → Vehicles in CRM1 and filter browser developer tools for the exact function name. Edit the Registration Number table cell.

CRM2

No direct CRM2 caller was found; mapped forms use Vehicle_updateData.

Related endpoints