Tasks
Set task privacy
/a/Task_setPrivacy
Set the raw task privacy integer used by the legacy editor.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible | Yes | Task ID. Row existence and active state are not checked. |
privacy | Integer-compatible | No in implementation | CRM 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
| 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":"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 codedinvalid privacy parameterresponse is unreachable for normal request values. - The update has no
deleted=0or 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_updateDatais CRM2’s mapped privacy update and records field history.Task_getreturns the stored raw privacy value.