update_content_filter
update_content_filter
Section titled “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
updatesonto 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_listdomain 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 withget_content_filter_detailsfirst. - Mutates controller state. Use dry_run=True to preview the change without applying.
Example
Section titled “Example”update_content_filter(filter_id="65f...", updates={"enabled": False})Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
filter_id | string | yes | — | The _id from list_content_filters. |
updates | object | yes | — | Partial 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. |
controller | string | no | ”default” | Name of the UniFi controller to target. Defaults to "default". |
dry_run | boolean | no | false | Preview the change without applying it. Returns the predicted change set. |