When to use this endpoint

Use Task_setPrivacy only for the focused CRM1 privacy selector. The server does not enforce the interface’s Private/Public allowlist or its permission checks.

Authentication and permissions

The request must establish an authenticated tenant context with signed API credentials or a logged-in CRM session. The handler checks for the tenant database prefix rather than calling the normal login guard.

It performs no additional task, page, role, ownership, or privacy-permission check. A caller that knows an active task ID in its tenant can address it regardless of the CRM screens’ visibility rules.

Parameters

ParameterTypeRequiredDescription
idInteger-compatibleYesTask ID. Row existence and active state are not checked.
privacyInteger-compatibleNo in implementationCRM values are 0 Private and 1 Public. Missing input becomes 0; any supplied integer is accepted because the intended validation condition is ineffective.

Example request

$changed = FM_api('Task_setPrivacy', [
	'id' => '318',
	'privacy' => '1',
]);

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":"no id parameter"}ID is absent or integer-coerces to zero.

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

Behaviour and edge cases

  • Writes the integer-coerced value and refreshes last_edited. The coded invalid privacy parameter response is unreachable for normal request values.
  • The update has no deleted=0 or existence condition; missing/deleted targets still return success.

Side effects

  • Invalidates the task cache. No history or notification is produced.

See it in Fieldmotion

CRM1

Open Tasks, edit a task, and change the corresponding field. CRM1’s task dialog and Task Main page load Task_get and save changed fields through the focused Task_set* routes.

CRM2

CRM2 enforces its privacy choices/permissions in the layout, then saves through Task_updateData; no direct production call to this setter was found.

Related endpoints

  • Task_updateData is CRM2’s mapped privacy update and records field history.
  • Task_get returns the stored raw privacy value.