Version 2.1.1792967583 · latest Download OpenAPI Markdown

CC rules

Ordered combinations of matchers and filters; a site can pick one rule group.

cc-rulesProtectionAuthentication: User (some parameters admin only)6 endpoints

List CC rule groups

GET/api/v2/cc-rules
Authentication: User (some parameters admin only)

Query parameters

FieldTypeRequiredDescription
pageinteger— Page number, starting from 1
Default 1
page_sizeinteger— Items per page
Default 20
sortstring— Sort fields, comma-separated; prefix `-` for descending, e.g. `-created_at,id`
tenant_idinteger— Admin only: filter by tenant. Ignored for tenant credentials, which only see their own tenant's data
enabledboolean— Filter by enabled state.
namestring— Filter by name substring.
ownerstring— platform = platform objects only; tenant = tenant objects only.
Values ["platform","tenant"]

Create CC rule group

POST/api/v2/cc-rules
Authentication: User (some parameters admin only)

Request body application/json

FieldTypeRequiredDescription
desstring— Remark; empty if omitted (omitting it on update also clears it, since the update replaces the whole object).
enabledboolean— Whether enabled
Default true
itemsCcRuleItem[]Required Rule items, executed in order; the count is limited by the setting protect.cc_rule_items_max.
namestringRequired Name
show_tointeger[]— Tenants that can see a platform rule group; empty = visible to all tenants, otherwise only the listed tenants can see it and select it as a site's cc_level. Returned to admins only.
sortinteger— Panel sort order (smaller first).
tenant_idinteger— Owning tenant; null = platform object (built-in or created by an admin, read-only for tenants).
visibleboolean— Shown in the site's rule group drop-down.
Default true

Batch enable or disable CC rule groups

POST/api/v2/cc-rules/batch-enable
Authentication: User (some parameters admin only)

Request body application/json

FieldTypeRequiredDescription
enabledbooleanRequired Whether enabled
Default true
idsinteger[]Required IDs of the objects to change, at most 100.

Get CC rule group

GET/api/v2/cc-rules/{id}
Authentication: User (some parameters admin only)

Update CC rule group

PUT/api/v2/cc-rules/{id}
Authentication: User (some parameters admin only)

Request body application/json

FieldTypeRequiredDescription
desstring— Remark; empty if omitted (omitting it on update also clears it, since the update replaces the whole object).
enabledboolean— Whether enabled
Default true
itemsCcRuleItem[]Required Rule items, executed in order; the count is limited by the setting protect.cc_rule_items_max.
namestringRequired Name
show_tointeger[]— Tenants that can see a platform rule group; empty = visible to all tenants, otherwise only the listed tenants can see it and select it as a site's cc_level. Returned to admins only.
sortinteger— Panel sort order (smaller first).
tenant_idinteger— Owning tenant; null = platform object (built-in or created by an admin, read-only for tenants).
visibleboolean— Shown in the site's rule group drop-down.
Default true

Delete CC rule group

DELETE/api/v2/cc-rules/{id}
Authentication: User (some parameters admin only)

CC rules object

FieldTypeRequiredDescription
builtinboolean— Built-in object; cannot be deleted.
read-only
created_atstring— Created at
read-only
desstring— Remark; empty if omitted (omitting it on update also clears it, since the update replaces the whole object).
enabledboolean— Whether enabled
Default true
errorsFieldError[]— Why each remaining item was not changed; field is /ids/<index>, code as in the single-item update (not_found, readonly and so on).
idinteger— Record ID
read-only
idsinteger[]Required IDs of the objects to change, at most 100.
itemsCcRuleItem[]— Rule items, executed in order; the count is limited by the setting protect.cc_rule_items_max.
namestring— Name
ruleset_idstring— Compiled ruleset id: cc.level.<name> for platform groups (referenced by the site's cc_level and guard.default_cc_level); cc.user.r<id> for tenant groups (selectable as cc_level by the tenant's own sites; sites on a package need custom_cc_rule).
read-only
show_tointeger[]— Tenants that can see a platform rule group; empty = visible to all tenants, otherwise only the listed tenants can see it and select it as a site's cc_level. Returned to admins only.
sortinteger— Panel sort order (smaller first).
tenant_idinteger— Owning tenant; null = platform object (built-in or created by an admin, read-only for tenants).
read-only
updatedinteger[]— IDs that were set (including those already in the target state), in request order.
updated_atstring— Updated at
read-only
visibleboolean— Shown in the site's rule group drop-down.
Default true