Tasks
Replace legacy task fields
/a/Task_edit
Replace a fixed legacy set of task fields, primarily for the CSV import compatibility path.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible | Yes | Task ID. The lookup includes soft-deleted rows. |
type | Integer-compatible | No | Task type; omitted values are written as 0. |
details / resolution | String | No | Text fields; omitted values are overwritten with empty strings. |
assigned_to | Integer-compatible | No | Assigned user; omitted values are overwritten with 0. A changed value normally refreshes assigned_date. |
do_not_update_assigned_date | Integer-compatible | No | Truthy legacy importer flag that prevents assigned_date changing when assignment changes. |
status / privacy | Integer-compatible | No | Omitted values are overwritten with 0; allowlists are not enforced. |
client_id | Integer-compatible | No | Customer ID; omitted values are overwritten with 0. |
due_date | String | No | Stored 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
| 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 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=0condition, 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_saveis another complete-form legacy updater with a different parameter vocabulary.Task_updateDataupdates only supplied mapped fields and excludes deleted rows.