# Settings ## Get global schema validation settings `schema_validation.settings.get(SettingGetParams**kwargs) -> SettingGetResponse` **get** `/zones/{zone_id}/schema_validation/settings` Retrieves the current global schema validation settings for a zone. ### Parameters - `zone_id: str` Identifier. ### Returns - `class SettingGetResponse: …` - `validation_default_mitigation_action: Literal["none", "log", "block"]` The default mitigation action used Mitigation actions are as follows: - `log` - log request when request does not conform to schema - `block` - deny access to the site when request does not conform to schema - `none` - skip running schema validation - `"none"` - `"log"` - `"block"` - `validation_override_mitigation_action: Optional[Literal["none"]]` When not null, this overrides global both zone level and operation level mitigation actions. This can serve as a quick way to disable schema validation for the whole zone. - `"none"` will skip running schema validation entirely for the request - `"none"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) setting = client.schema_validation.settings.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(setting.validation_default_mitigation_action) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "validation_default_mitigation_action": "block", "validation_override_mitigation_action": "none" }, "success": true } ``` ## Update global schema validation settings `schema_validation.settings.update(SettingUpdateParams**kwargs) -> SettingUpdateResponse` **put** `/zones/{zone_id}/schema_validation/settings` Fully updates global schema validation settings for a zone, replacing existing configuration. ### Parameters - `zone_id: str` Identifier. - `validation_default_mitigation_action: Literal["none", "log", "block"]` The default mitigation action used Mitigation actions are as follows: - `"log"` - log request when request does not conform to schema - `"block"` - deny access to the site when request does not conform to schema - `"none"` - skip running schema validation - `"none"` - `"log"` - `"block"` - `validation_override_mitigation_action: Optional[Literal["none"]]` When set, this overrides both zone level and operation level mitigation actions. - `"none"` - skip running schema validation entirely for the request - `null` - clears any existing override - `"none"` ### Returns - `class SettingUpdateResponse: …` - `validation_default_mitigation_action: Literal["none", "log", "block"]` The default mitigation action used Mitigation actions are as follows: - `log` - log request when request does not conform to schema - `block` - deny access to the site when request does not conform to schema - `none` - skip running schema validation - `"none"` - `"log"` - `"block"` - `validation_override_mitigation_action: Optional[Literal["none"]]` When not null, this overrides global both zone level and operation level mitigation actions. This can serve as a quick way to disable schema validation for the whole zone. - `"none"` will skip running schema validation entirely for the request - `"none"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) setting = client.schema_validation.settings.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="block", ) print(setting.validation_default_mitigation_action) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "validation_default_mitigation_action": "block", "validation_override_mitigation_action": "none" }, "success": true } ``` ## Edit global schema validation settings `schema_validation.settings.edit(SettingEditParams**kwargs) -> SettingEditResponse` **patch** `/zones/{zone_id}/schema_validation/settings` Partially updates global schema validation settings for a zone using PATCH semantics. ### Parameters - `zone_id: str` Identifier. - `validation_default_mitigation_action: Optional[Literal["none", "log", "block"]]` The default mitigation action used Mitigation actions are as follows: - `"log"` - log request when request does not conform to schema - `"block"` - deny access to the site when request does not conform to schema - `"none"` - skip running schema validation - `"none"` - `"log"` - `"block"` - `validation_override_mitigation_action: Optional[Literal["none"]]` When set, this overrides both zone level and operation level mitigation actions. - `"none"` - skip running schema validation entirely for the request - `null` - clears any existing override - `"none"` ### Returns - `class SettingEditResponse: …` - `validation_default_mitigation_action: Literal["none", "log", "block"]` The default mitigation action used Mitigation actions are as follows: - `log` - log request when request does not conform to schema - `block` - deny access to the site when request does not conform to schema - `none` - skip running schema validation - `"none"` - `"log"` - `"block"` - `validation_override_mitigation_action: Optional[Literal["none"]]` When not null, this overrides global both zone level and operation level mitigation actions. This can serve as a quick way to disable schema validation for the whole zone. - `"none"` will skip running schema validation entirely for the request - `"none"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.schema_validation.settings.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.validation_default_mitigation_action) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "validation_default_mitigation_action": "block", "validation_override_mitigation_action": "none" }, "success": true } ``` ## Domain Types ### Setting Get Response - `class SettingGetResponse: …` - `validation_default_mitigation_action: Literal["none", "log", "block"]` The default mitigation action used Mitigation actions are as follows: - `log` - log request when request does not conform to schema - `block` - deny access to the site when request does not conform to schema - `none` - skip running schema validation - `"none"` - `"log"` - `"block"` - `validation_override_mitigation_action: Optional[Literal["none"]]` When not null, this overrides global both zone level and operation level mitigation actions. This can serve as a quick way to disable schema validation for the whole zone. - `"none"` will skip running schema validation entirely for the request - `"none"` ### Setting Update Response - `class SettingUpdateResponse: …` - `validation_default_mitigation_action: Literal["none", "log", "block"]` The default mitigation action used Mitigation actions are as follows: - `log` - log request when request does not conform to schema - `block` - deny access to the site when request does not conform to schema - `none` - skip running schema validation - `"none"` - `"log"` - `"block"` - `validation_override_mitigation_action: Optional[Literal["none"]]` When not null, this overrides global both zone level and operation level mitigation actions. This can serve as a quick way to disable schema validation for the whole zone. - `"none"` will skip running schema validation entirely for the request - `"none"` ### Setting Edit Response - `class SettingEditResponse: …` - `validation_default_mitigation_action: Literal["none", "log", "block"]` The default mitigation action used Mitigation actions are as follows: - `log` - log request when request does not conform to schema - `block` - deny access to the site when request does not conform to schema - `none` - skip running schema validation - `"none"` - `"log"` - `"block"` - `validation_override_mitigation_action: Optional[Literal["none"]]` When not null, this overrides global both zone level and operation level mitigation actions. This can serve as a quick way to disable schema validation for the whole zone. - `"none"` will skip running schema validation entirely for the request - `"none"` # Operations ## List per-operation schema validation settings `schema_validation.settings.operations.list(OperationListParams**kwargs) -> SyncV4PagePaginationArray[OperationListResponse]` **get** `/zones/{zone_id}/schema_validation/settings/operations` Lists all per-operation schema validation settings configured for the zone. ### Parameters - `zone_id: str` Identifier. - `page: Optional[int]` Page number of paginated results. - `per_page: Optional[int]` Maximum number of results per page. ### Returns - `class OperationListResponse: …` - `mitigation_action: Literal["log", "block", "none"]` When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `"log"` - `"block"` - `"none"` - `operation_id: str` UUID. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.schema_validation.settings.operations.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.operation_id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "mitigation_action": "block", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Get per-operation schema validation setting `schema_validation.settings.operations.get(stroperation_id, OperationGetParams**kwargs) -> OperationGetResponse` **get** `/zones/{zone_id}/schema_validation/settings/operations/{operation_id}` Retrieves the schema validation settings configured for a specific API operation. ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. ### Returns - `class OperationGetResponse: …` - `mitigation_action: Literal["log", "block", "none"]` When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `"log"` - `"block"` - `"none"` - `operation_id: str` UUID. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) operation = client.schema_validation.settings.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(operation.operation_id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "mitigation_action": "block", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Update per-operation schema validation setting `schema_validation.settings.operations.update(stroperation_id, OperationUpdateParams**kwargs) -> OperationUpdateResponse` **put** `/zones/{zone_id}/schema_validation/settings/operations/{operation_id}` Fully updates schema validation settings for a specific API operation. ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. - `mitigation_action: Optional[Literal["log", "block", "none"]]` When set, this applies a mitigation action to this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `null` - clears any mitigation action - `"log"` - `"block"` - `"none"` ### Returns - `class OperationUpdateResponse: …` - `mitigation_action: Literal["log", "block", "none"]` When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `"log"` - `"block"` - `"none"` - `operation_id: str` UUID. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) operation = client.schema_validation.settings.operations.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", mitigation_action="block", ) print(operation.operation_id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "mitigation_action": "block", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Bulk edit per-operation schema validation settings `schema_validation.settings.operations.bulk_edit(OperationBulkEditParams**kwargs) -> OperationBulkEditResponse` **patch** `/zones/{zone_id}/schema_validation/settings/operations` Updates schema validation settings for multiple API operations in a single request. Efficient for applying consistent validation rules across endpoints. ### Parameters - `zone_id: str` Identifier. - `body: Dict[str, Body]` - `mitigation_action: Optional[Literal["none", "log", "block"]]` Mitigation actions are as follows: * `log` - log request when request does not conform to schema * `block` - deny access to the site when request does not conform to schema * `none` - skip running schema validation * null - clears any existing per-operation setting - `"none"` - `"log"` - `"block"` ### Returns - `Dict[str, OperationBulkEditResponseItem]` Operation ID to per operation setting mapping - `mitigation_action: Literal["log", "block", "none"]` When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `"log"` - `"block"` - `"none"` - `operation_id: str` UUID. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.schema_validation.settings.operations.bulk_edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, }, ) print(response) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "foo": { "mitigation_action": "block", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } }, "success": true } ``` ## Delete per-operation schema validation setting `schema_validation.settings.operations.delete(stroperation_id, OperationDeleteParams**kwargs) -> OperationDeleteResponse` **delete** `/zones/{zone_id}/schema_validation/settings/operations/{operation_id}` Removes custom schema validation settings for a specific API operation, reverting to zone-level defaults. ### Parameters - `zone_id: str` Identifier. - `operation_id: str` UUID. ### Returns - `class OperationDeleteResponse: …` - `operation_id: Optional[str]` UUID. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) operation = client.schema_validation.settings.operations.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(operation.operation_id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Domain Types ### Operation List Response - `class OperationListResponse: …` - `mitigation_action: Literal["log", "block", "none"]` When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `"log"` - `"block"` - `"none"` - `operation_id: str` UUID. ### Operation Get Response - `class OperationGetResponse: …` - `mitigation_action: Literal["log", "block", "none"]` When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `"log"` - `"block"` - `"none"` - `operation_id: str` UUID. ### Operation Update Response - `class OperationUpdateResponse: …` - `mitigation_action: Literal["log", "block", "none"]` When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `"log"` - `"block"` - `"none"` - `operation_id: str` UUID. ### Operation Bulk Edit Response - `Dict[str, OperationBulkEditResponseItem]` Operation ID to per operation setting mapping - `mitigation_action: Literal["log", "block", "none"]` When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation - `"log"` - log request when request does not conform to schema for this operation - `"block"` - deny access to the site when request does not conform to schema for this operation - `"none"` - will skip mitigation for this operation - `"log"` - `"block"` - `"none"` - `operation_id: str` UUID. ### Operation Delete Response - `class OperationDeleteResponse: …` - `operation_id: Optional[str]` UUID.