Skip to content

update_content_filter

Patch fields on an existing content-filtering profile (read-modify-write).

Side effects:

  • Modifies the named profile in place. The v2 PUT replaces the whole object, so this reads the current profile first and merges updates onto it before writing: only the keys you supply change, everything else (scope, schedule, the other lists) is preserved.
  • Takes effect immediately on DNS resolution for the in-scope clients and networks: enabling a category starts blocking it; adding a block_list domain starts NXDOMAIN-ing it.
  • List fields (categories, allow_list, block_list, client_macs, network_ids, safe_search) are replaced wholesale, not appended, so pass the full desired list. Read the current value with get_content_filter_details first.
  • Mutates controller state. Use dry_run=True to preview the change without applying.
update_content_filter(filter_id="65f...", updates={"enabled": False})
ParameterTypeRequiredDefaultDescription
filter_idstringyesThe _id from list_content_filters.
updatesobjectyesPartial profile record to merge. Common keys: name, enabled, categories (full blocked-category list), allow_list / block_list (full per-domain lists), client_macs / network_ids (full scope lists), safe_search, schedule.
controllerstringno”default”Name of the UniFi controller to target. Defaults to "default".
dry_runbooleannofalsePreview the change without applying it. Returns the predicted change set.