When to use this endpoint

Use the Public/Private selector in CRM1 Settings → Filters. The preset’s content, owner and page association are untouched.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session. A tenant login is required.

Reads expose only filters owned by the current user or marked public=1. Writes require ownership or client-administrator permission; another user’s public filter is not editable merely because it is visible. Assigning or transferring ownership to another active tenant user requires client-administrator permission.

Parameters

ParameterTypeRequiredDescription
idPositive integer stringYesExisting physical filter ID.
valBoolean or 0/1 or true/false stringYes0/false makes private; 1/true makes public. Negative values and arbitrary numeric/text coercions are rejected.

Example request

$result = FM_api('UserFilter_setPublic', ['id' => '1088', 'val' => '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":"missing or invalid parameter: id"}IDs must be positive integers; malformed/missing selectors are rejected.
{"error":"filter with that ID does not exist"}Any selected target is absent.
{"error":"filter permission denied"}A non-administrator targets another owner or attempts an unauthorized owner assignment.
{"error":"configuration read failed"}A required database read fails; no write is committed.
{"error":"configuration write failed"}Persistence or checked history fails; the transaction rolls back.
{"error":"configuration transaction failed"}Transaction begin or commit fails; no success is reported.

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

Behaviour and edge cases

  • Equal normalized flag returns {"ok":1,"warning":"No change needed"}. Only public=1 is visible to other users.
  • Changes public only, with checked history/cache in one transaction. Creation time is unchanged.

Side effects

  • Changed rows request their table’s cache marker. Row changes and history commit in one checked transaction; a write, history or commit failure rolls back the batch.
  • No customer/job data, notification or email is changed. No tenant feature setting alters this endpoint’s behavior.

See it in Fieldmotion

CRM1

Settings → Filters: change the Public selector. Filter Network requests for UserFilter_setPublic.

CRM2

No direct CRM2 caller for this narrow setter was found. Settings → Filters uses mapped UserFilter_updateData/UserFilter_updateField through shared editing helpers.

Related endpoints