When to use this endpoint

Use Tasks_delete only for legacy clients that already submit a batch as id[]. New code can call Task_delete per task and inspect each result.

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 rows come from the authenticated tenant. Unless the page says otherwise, IDs, creator, assignee, and privacy do not restrict the result at handler level.

Parameters

ParameterTypeRequiredDescription
idNative arrayYesTask IDs to process. Despite the error text saying ids, the exact request key is singular id. A scalar is not normalized into an array.

Example request

$result = FM_api('Tasks_delete', [
	'id' => ['318', '319'],
]);

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: ids"}The singular id key is absent.
{"ok":1}Still returned when an individual ID is invalid, missing, already deleted, or otherwise rejected by Task_delete; child results are discarded.

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

Behaviour and edge cases

  • The endpoint preserves input order but returns no per-ID status. There is no batch-size limit.
  • A scalar id is not supported and can produce a PHP warning before the endpoint returns success without processing a task.
  • The single-task handler accepts only active task rows and applies its legacy ID/appId resolution behavior to each item.

Side effects

  • Each successful child operation sets deleted=1, records a deletion time, updates last_edited, invalidates the task cache, and writes a tenant deletion-log row.
  • No audit-history entry, notification, or assignment email is produced.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found. CRM1 deletes individual tasks through Task_delete.

CRM2

No direct CRM2 caller was found. The shared Tasks widget uses its singular delete route for selected rows.

Related endpoints

  • Task_delete exposes the actual per-task result.
  • Task_restore restores one soft-deleted task through an Admin-console session.