Tasks
Save a complete legacy task
/a/Task_save
Overwrite the legacy complete-task form fields using a third, compatibility-only parameter vocabulary.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible | Yes | Target task ID. The endpoint does not verify that it exists or is active. |
customer | Integer-compatible | Yes | Stored as customer ID. Presence is checked, but zero and unknown IDs are accepted. |
user | Integer-compatible | No | Stored assignee; missing input is integer-coerced to 0. |
details | String | Yes | Must be truthy; blank and "0" return an error. |
subject | String | No | When blank, derived from details; maximum 128 bytes. |
dueDate | String | No | Blank or missing input becomes the current server datetime; nonblank input is stored without validation. |
minutes | Float-compatible | No | Stored in time_spent; defaults to 0. |
status / type / privacy | Integer-compatible | No | Each defaults to 0. Values and related rows are not validated. |
resolution | String | No | Defaults 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
| 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. 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_editedin one query. It does not updateassigned_date. - Subject derivation has the same original-details truncation quirk as
Task_create. - The query includes no
deleted=0filter, so it can modify a soft-deleted task without restoring it.
Side effects
- The implementation invalidates the
opportunitiescache 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_editis the import-oriented complete replacement contract.Task_updateDataperforms partial mapped changes with audit/notification behavior.