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

ParameterTypeRequiredDescription
idInteger-compatible or native arrayYesOne task-type ID or an array for the shared multi-update loop. Array calls return aggregate success and discard per-ID warnings/errors.
nameStringNoReplacement name. Blank and duplicate names are accepted by this mapped route.
cDateDatetime stringNoReplacement creation timestamp. Blank converts to SQL null.
lastEditedDatetime stringNoMapped 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.
noRecordNative arrayNoMapped field keys whose audit entries should be marked hidden.
_pollAnyNoRemoved 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

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"}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 as cdate), and lastEdited (stored as last_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