When to use this endpoint

Use TaskType_edit for the CRM1 Task Types settings screen. CRM2’s generic editor uses TaskType_updateData.

Authentication and permissions

The request must establish an authenticated tenant context with signed API credentials or a logged-in CRM session. This legacy handler checks or immediately uses the tenant database prefix rather than calling the normal login guard.

It performs no additional Settings-page, role, create, edit, or delete permission check.

Parameters

ParameterTypeRequiredDescription
idInteger-compatible stringYesTask-type ID. Validation only requires a nonblank trimmed value before integer conversion, so nonnumeric text becomes 0.
nameStringYesNew trimmed name. It must contain a non-whitespace character. Duplicate names are allowed.

Example request

$result = FM_api('TaskType_edit', [
	'id' => '3',
	'name' => 'Priority customer follow-up',
]);

Example response

{
  "ok": 1,
  "id": 0,
  "task_id": 3
}

The legacy id member is the database helper’s insert-ID result for an update and is normally 0. task_id is the requested task-type ID.

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":"invalid or missing parameter: name"}name is absent, blank, or whitespace-only. This check occurs before ID validation.
{"error":"invalid or missing parameter: id"}id is absent, blank, or whitespace-only.
{"ok":1,"id":0,"task_id":...}Also returned when no row matches the integer-converted ID.

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

Behaviour and edge cases

  • Only name and current server last_edited are written. Creation date is unchanged.
  • There is no existence check, duplicate check, affected-row count, or task reference update; tasks resolve the renamed type dynamically by ID.

Side effects

  • Invalidates the task-type cache. It does not write mapped field-history entries.

See it in Fieldmotion

CRM1

Open Settings → Task Types, select a type, choose Edit, and submit a new name. CRM1 updates its selected option from the entered value after this call.

CRM2

No direct CRM2 caller was found. The mapped Task Types widget uses TaskType_updateData or TaskType_updateField.

Related endpoints