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

ParameterTypeRequiredDescription
idInteger-compatibleYesExisting 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.
typeScalarNoTask type. Stored as escaped text into the numeric column; database coercion applies.
details / resolutionStringNoReplacement text fields.
assigned_to / status / client_id / privacyScalarNoOther 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

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.

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 refresh assigned_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_updateData is the current mapped partial updater.
  • Task_create explicitly creates a complete legacy task when no temporary-ID mapping is needed.