Tasks
Apply a legacy task update
/a/Task_update
Apply the legacy partial/offline task update and translate a timestamp-like temporary ID into a server ID.
When to use this endpoint
Use Task_update only for legacy clients that depend on its temporary-ID translation or CRM1’s inline status save. It supports fewer fields and fewer side effects than Task_updateData.
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 | Existing task ID, or a legacy client-generated value above the handler’s moving threshold (microtime(true) / 2). Such large values create a new server row and are returned as oldId. |
type | Scalar | No | Task type. Stored as escaped text into the numeric column; database coercion applies. |
details / resolution | String | No | Replacement text fields. |
assigned_to / status / client_id / privacy | Scalar | No | Other supported fields. They are written as escaped quoted values and left to database coercion; referenced rows/allowlists are not validated. |
Example request
$updated = FM_api('Task_update', [
'id' => '318',
'status' => '2',
]);
Example response
{
"ok": 1,
"oldId": 318,
"newId": 318
}
For a recognized temporary ID, oldId is that client value and newId is the newly inserted tenant task ID.
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. |
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 type, details, resolution, assignee, status, customer ID, and privacy are considered. Subject, due date, time spent, assignment date, and unknown keys are ignored.
- For an ordinary ID, the endpoint does not check whether the row exists or is deleted; it still returns success. For a large temporary ID, it first inserts a minimal active row with creator/current timestamps, then applies supplied fields.
- Every update refreshes
last_edited. Changing assignee does not refreshassigned_date.
Side effects
- Invalidates the task cache. It creates no normal mapped field history, mentions, assignment email, or notification-service events.
See it in Fieldmotion
CRM1
On the Tasks table, change the inline Status selector and filter the network panel for Task_update.
CRM2
No current production CRM2 caller was found. Current mobile/app repositories also contain no direct caller; the temporary-ID path remains a legacy compatibility contract protected by API tests.
Related endpoints
Task_updateDatais the current mapped partial updater.Task_createexplicitly creates a complete legacy task when no temporary-ID mapping is needed.