When to use this endpoint

Use Task_edit only when maintaining the legacy task importer contract. It replaces every field in its fixed update set, so focused setters or Task_updateData are safer for partial edits.

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 task, page, role, ownership, or privacy-permission check.

All reads and writes use the authenticated tenant. CRM1 and CRM2 apply task visibility and editing permissions in their interfaces, but these handlers do not repeat those client-side rules.

Parameters

ParameterTypeRequiredDescription
idInteger-compatibleYesTask ID. The lookup includes soft-deleted rows.
typeInteger-compatibleNoTask type; omitted values are written as 0.
details / resolutionStringNoText fields; omitted values are overwritten with empty strings.
assigned_toInteger-compatibleNoAssigned user; omitted values are overwritten with 0. A changed value normally refreshes assigned_date.
do_not_update_assigned_dateInteger-compatibleNoTruthy legacy importer flag that prevents assigned_date changing when assignment changes.
status / privacyInteger-compatibleNoOmitted values are overwritten with 0; allowlists are not enforced.
client_idInteger-compatibleNoCustomer ID; omitted values are overwritten with 0.
due_dateStringNoStored without date validation; omission overwrites it with an empty string.

Example request

$edited = FM_api('Task_edit', [
	'id' => '318',
	'type' => '3',
	'details' => 'Confirm the revised access details.',
	'resolution' => '',
	'assigned_to' => '17',
	'status' => '1',
	'client_id' => '1042',
	'due_date' => '2026-10-03 10:00:00',
	'privacy' => '1',
]);

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 or below 1.
{"error":"task does not exist"}No tenant task row, active or deleted, has that 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

  • Refreshes last_edited. It does not validate customer, user, type, status, privacy, or due-date values.
  • There is no deleted=0 condition, so a deleted task can be modified without being restored.

Side effects

  • Invalidates the task cache. It does not write generic field history, mention notices, assignment email, or notification-service events.

See it in Fieldmotion

CRM1

No direct CRM1 browser caller was found. The server-side Tasks_import route uses Task_edit when an imported row matches an existing task.

CRM2

No current production CRM2 caller was found; CRM2 uses Task_updateData.

Related endpoints

  • Task_save is another complete-form legacy updater with a different parameter vocabulary.
  • Task_updateData updates only supplied mapped fields and excludes deleted rows.