Task types
Update mapped task-type data
/a/TaskType_updateData
Update supplied mapped task-type fields and write per-field audit history.
When to use this endpoint
Use TaskType_updateData for CRM2’s generic Task Types editor or a mapped multi-field update. Use TaskType_edit for CRM1’s name-only response contract.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional Settings-page, role, create, edit, or delete permission check.
All reads and writes use the authenticated tenant. CRM1 and CRM2 decide whether to show task-type controls, but these handlers do not repeat those client-side checks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible or native array | Yes | One task-type ID or an array for the shared multi-update loop. Array calls return aggregate success and discard per-ID warnings/errors. |
name | String | No | Replacement name. Blank and duplicate names are accepted by this mapped route. |
cDate | Datetime string | No | Replacement creation timestamp. Blank converts to SQL null. |
lastEdited | Datetime string | No | Mapped edit timestamp. On an actual change, the helper also appends current server time to last_edited, so the automatic value wins over a supplied historical value. |
noRecord | Native array | No | Mapped field keys whose audit entries should be marked hidden. |
_poll | Any | No | Removed before mapped persistence. |
Example request
$result = FM_api('TaskType_updateData', [
'id' => '3',
'name' => 'Priority customer follow-up',
]);
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: id"} | id is absent. |
{"warning":"no updated fields."} | No supplied key maps to a stored task-type field. |
{"warning":"No data."} | No row matches the scalar ID for the selected mapped columns. |
{"warning":"No Change."} | All supplied mapped values compare equal after conversion. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Mapped fields are
id(integer),name(text),cDate(stored ascdate), andlastEdited(stored aslast_edited). Unknown keys are ignored. - Task types have no deleted state. The handler does not validate name uniqueness, existence before selection, or whether tasks reference the type.
Side effects
- On a real change, updates current
last_edited, invalidates the task-type cache, and writes an audit-history entry for each changed mapped field.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found; CRM1 uses TaskType_edit.
CRM2
Open Settings → Task Types. CRM2’s shared data widget derives the mapped create, detail, update, single-field update, and table routes from the TaskType/TaskTypes prefixes.
Related endpoints
TaskType_updateFieldchanges one mapped field across one or several IDs.TaskType_getRequestedDetailsreads the mapped result.