When to use this endpoint

Use Task_save only for a caller already bound to this complete-form contract. It is not used by the current CRM1 or CRM2 task editors; mapped or focused updates avoid its broad overwrite behavior.

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-compatibleYesTarget task ID. The endpoint does not verify that it exists or is active.
customerInteger-compatibleYesStored as customer ID. Presence is checked, but zero and unknown IDs are accepted.
userInteger-compatibleNoStored assignee; missing input is integer-coerced to 0.
detailsStringYesMust be truthy; blank and "0" return an error.
subjectStringNoWhen blank, derived from details; maximum 128 bytes.
dueDateStringNoBlank or missing input becomes the current server datetime; nonblank input is stored without validation.
minutesFloat-compatibleNoStored in time_spent; defaults to 0.
status / type / privacyInteger-compatibleNoEach defaults to 0. Values and related rows are not validated.
resolutionStringNoDefaults to an empty string.

Example request

$saved = FM_api('Task_save', [
	'id' => '318',
	'customer' => '1042',
	'user' => '17',
	'type' => '3',
	'subject' => 'Confirm access details',
	'details' => 'Confirm the revised site access details.',
	'dueDate' => '2026-10-03 10:00:00',
	'minutes' => '15',
	'status' => '1',
	'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. A present value of zero is not rejected.
{"error":"missing or invalid parameter: customer"}Customer is absent.
{"error":"you must fill in the task Details"}Details are absent or false-like.
{"error":"Subject too long. 128 characters max"}An explicitly supplied subject exceeds 128 bytes. A derived subject is truncated first.

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

Behaviour and edge cases

  • Replaces due date, type, customer, subject, details, resolution, assignee, privacy, time spent, status, and last_edited in one query. It does not update assigned_date.
  • Subject derivation has the same original-details truncation quirk as Task_create.
  • The query includes no deleted=0 filter, so it can modify a soft-deleted task without restoring it.

Side effects

  • The implementation invalidates the opportunities cache rather than the task cache. It writes no audit history, mention notices, assignment email, or generic notifications.

See it in Fieldmotion

CRM1

No current CRM1 caller was found; CRM1 uses focused setters or Task_update for inline status changes.

CRM2

No current CRM2 caller was found; CRM2 layout saves use Task_updateData.

Related endpoints

  • Task_edit is the import-oriented complete replacement contract.
  • Task_updateData performs partial mapped changes with audit/notification behavior.