# Schema Validation # Schemas ## List all uploaded schemas `client.schemaValidation.schemas.list(SchemaListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/zones/{zone_id}/schema_validation/schemas` Lists all OpenAPI schemas uploaded to API Shield with pagination support. ### Parameters - `params: SchemaListParams` - `zone_id: string` Path param: Identifier. - `omit_source?: boolean` Query param: Omit the source-files of schemas and only retrieve their meta-data. - `page?: number` Query param: Page number of paginated results. - `per_page?: number` Query param: Maximum number of results per page. - `validation_enabled?: boolean` Query param: Filter for enabled schemas ### Returns - `PublicSchema` A schema used in schema validation - `created_at: string` - `kind: "openapi_v3"` The kind of the schema - `"openapi_v3"` - `name: string` A human-readable name for the schema - `schema_id: string` A unique identifier of this schema - `source: string` The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - `validation_enabled?: boolean` An indicator if this schema is enabled ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const publicSchema of client.schemaValidation.schemas.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(publicSchema.schema_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": [ { "created_at": "2014-01-01T05:20:00.12345Z", "kind": "openapi_v3", "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "source": "", "validation_enabled": true } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Get details of a schema `client.schemaValidation.schemas.get(stringschemaId, SchemaGetParamsparams, RequestOptionsoptions?): PublicSchema` **get** `/zones/{zone_id}/schema_validation/schemas/{schema_id}` Gets the contents and metadata of a specific OpenAPI schema uploaded to API Shield. ### Parameters - `schemaId: string` UUID. - `params: SchemaGetParams` - `zone_id: string` Path param: Identifier. - `omit_source?: boolean` Query param: Omit the source-files of schemas and only retrieve their meta-data. ### Returns - `PublicSchema` A schema used in schema validation - `created_at: string` - `kind: "openapi_v3"` The kind of the schema - `"openapi_v3"` - `name: string` A human-readable name for the schema - `schema_id: string` A unique identifier of this schema - `source: string` The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - `validation_enabled?: boolean` An indicator if this schema is enabled ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const publicSchema = await client.schemaValidation.schemas.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(publicSchema.schema_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": { "created_at": "2014-01-01T05:20:00.12345Z", "kind": "openapi_v3", "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "source": "", "validation_enabled": true }, "success": true } ``` ## Upload a schema `client.schemaValidation.schemas.create(SchemaCreateParamsparams, RequestOptionsoptions?): PublicSchema` **post** `/zones/{zone_id}/schema_validation/schemas` Uploads a new OpenAPI schema for API Shield schema validation. The schema defines expected request/response formats for API endpoints. ### Parameters - `params: SchemaCreateParams` - `zone_id: string` Path param: Identifier. - `kind: "openapi_v3"` Body param: The kind of the schema - `"openapi_v3"` - `name: string` Body param: A human-readable name for the schema - `source: string` Body param: The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - `validation_enabled: boolean` Body param: An indicator if this schema is enabled ### Returns - `PublicSchema` A schema used in schema validation - `created_at: string` - `kind: "openapi_v3"` The kind of the schema - `"openapi_v3"` - `name: string` A human-readable name for the schema - `schema_id: string` A unique identifier of this schema - `source: string` The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - `validation_enabled?: boolean` An indicator if this schema is enabled ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const publicSchema = await client.schemaValidation.schemas.create({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', kind: 'openapi_v3', name: 'petstore schema', source: '', validation_enabled: true, }); console.log(publicSchema.schema_id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "locations": [ ".paths[\"/user/{username}\"].put" ], "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "locations": [ ".paths[\"/user/{username}\"].put" ], "pointer": "pointer" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "kind": "openapi_v3", "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "source": "", "validation_enabled": true }, "success": true } ``` ## Edit details of a schema to enable validation `client.schemaValidation.schemas.edit(stringschemaId, SchemaEditParamsparams, RequestOptionsoptions?): PublicSchema` **patch** `/zones/{zone_id}/schema_validation/schemas/{schema_id}` Modifies an existing OpenAPI schema in API Shield, updating the validation rules for associated API operations. ### Parameters - `schemaId: string` UUID. - `params: SchemaEditParams` - `zone_id: string` Path param: Identifier. - `validation_enabled?: boolean` Body param: Flag whether schema is enabled for validation. ### Returns - `PublicSchema` A schema used in schema validation - `created_at: string` - `kind: "openapi_v3"` The kind of the schema - `"openapi_v3"` - `name: string` A human-readable name for the schema - `schema_id: string` A unique identifier of this schema - `source: string` The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - `validation_enabled?: boolean` An indicator if this schema is enabled ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const publicSchema = await client.schemaValidation.schemas.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(publicSchema.schema_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": { "created_at": "2014-01-01T05:20:00.12345Z", "kind": "openapi_v3", "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "source": "", "validation_enabled": true }, "success": true } ``` ## Delete a schema `client.schemaValidation.schemas.delete(stringschemaId, SchemaDeleteParamsparams, RequestOptionsoptions?): SchemaDeleteResponse` **delete** `/zones/{zone_id}/schema_validation/schemas/{schema_id}` Permanently removes an uploaded OpenAPI schema from API Shield. Operations using this schema will lose their validation rules. ### Parameters - `schemaId: string` UUID. - `params: SchemaDeleteParams` - `zone_id: string` Identifier. ### Returns - `SchemaDeleteResponse` - `id: string` The ID of the schema that was just deleted ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const schema = await client.schemaValidation.schemas.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(schema.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": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "success": true } ``` ## Domain Types ### Public Schema - `PublicSchema` A schema used in schema validation - `created_at: string` - `kind: "openapi_v3"` The kind of the schema - `"openapi_v3"` - `name: string` A human-readable name for the schema - `schema_id: string` A unique identifier of this schema - `source: string` The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - `validation_enabled?: boolean` An indicator if this schema is enabled ### Schema Delete Response - `SchemaDeleteResponse` - `id: string` The ID of the schema that was just deleted # Settings ## Get global schema validation settings `client.schemaValidation.settings.get(SettingGetParamsparams, RequestOptionsoptions?): SettingGetResponse` **get** `/zones/{zone_id}/schema_validation/settings` Retrieves the current global schema validation settings for a zone. ### Parameters - `params: SettingGetParams` - `zone_id: string` Identifier. ### Returns - `SettingGetResponse` - `validation_default_mitigation_action: "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?: "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 ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const setting = await client.schemaValidation.settings.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 `client.schemaValidation.settings.update(SettingUpdateParamsparams, RequestOptionsoptions?): SettingUpdateResponse` **put** `/zones/{zone_id}/schema_validation/settings` Fully updates global schema validation settings for a zone, replacing existing configuration. ### Parameters - `params: SettingUpdateParams` - `zone_id: string` Path param: Identifier. - `validation_default_mitigation_action: "none" | "log" | "block"` Body param: 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?: "none" | null` Body param: 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 - `SettingUpdateResponse` - `validation_default_mitigation_action: "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?: "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 ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const setting = await client.schemaValidation.settings.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', validation_default_mitigation_action: 'block', }); console.log(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 `client.schemaValidation.settings.edit(SettingEditParamsparams, RequestOptionsoptions?): SettingEditResponse` **patch** `/zones/{zone_id}/schema_validation/settings` Partially updates global schema validation settings for a zone using PATCH semantics. ### Parameters - `params: SettingEditParams` - `zone_id: string` Path param: Identifier. - `validation_default_mitigation_action?: "none" | "log" | "block"` Body param: 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?: "none" | null` Body param: 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 - `SettingEditResponse` - `validation_default_mitigation_action: "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?: "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 ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.schemaValidation.settings.edit({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 - `SettingGetResponse` - `validation_default_mitigation_action: "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?: "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 - `SettingUpdateResponse` - `validation_default_mitigation_action: "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?: "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 - `SettingEditResponse` - `validation_default_mitigation_action: "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?: "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 `client.schemaValidation.settings.operations.list(OperationListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/zones/{zone_id}/schema_validation/settings/operations` Lists all per-operation schema validation settings configured for the zone. ### Parameters - `params: OperationListParams` - `zone_id: string` Path param: Identifier. - `page?: number` Query param: Page number of paginated results. - `per_page?: number` Query param: Maximum number of results per page. ### Returns - `OperationListResponse` - `mitigation_action: "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: string` UUID. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const operationListResponse of client.schemaValidation.settings.operations.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(operationListResponse.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 `client.schemaValidation.settings.operations.get(stringoperationId, OperationGetParamsparams, RequestOptionsoptions?): OperationGetResponse` **get** `/zones/{zone_id}/schema_validation/settings/operations/{operation_id}` Retrieves the schema validation settings configured for a specific API operation. ### Parameters - `operationId: string` UUID. - `params: OperationGetParams` - `zone_id: string` Identifier. ### Returns - `OperationGetResponse` - `mitigation_action: "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: string` UUID. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const operation = await client.schemaValidation.settings.operations.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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 `client.schemaValidation.settings.operations.update(stringoperationId, OperationUpdateParamsparams, RequestOptionsoptions?): OperationUpdateResponse` **put** `/zones/{zone_id}/schema_validation/settings/operations/{operation_id}` Fully updates schema validation settings for a specific API operation. ### Parameters - `operationId: string` UUID. - `params: OperationUpdateParams` - `zone_id: string` Path param: Identifier. - `mitigation_action: "log" | "block" | "none" | null` Body param: 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 - `OperationUpdateResponse` - `mitigation_action: "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: string` UUID. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const operation = await client.schemaValidation.settings.operations.update( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', mitigation_action: 'block' }, ); console.log(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 `client.schemaValidation.settings.operations.bulkEdit(OperationBulkEditParamsparams, RequestOptionsoptions?): 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 - `params: OperationBulkEditParams` - `zone_id: string` Path param: Identifier. - `body: Record` Body param - `mitigation_action?: "none" | "log" | "block" | null` 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 - `OperationBulkEditResponse = Record` Operation ID to per operation setting mapping - `mitigation_action: "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: string` UUID. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.schemaValidation.settings.operations.bulkEdit({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', body: { '3818d821-5901-4147-a474-f5f5aec1d54e': {}, 'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': {}, }, }); console.log(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 `client.schemaValidation.settings.operations.delete(stringoperationId, OperationDeleteParamsparams, RequestOptionsoptions?): 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 - `operationId: string` UUID. - `params: OperationDeleteParams` - `zone_id: string` Identifier. ### Returns - `OperationDeleteResponse` - `operation_id?: string` UUID. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const operation = await client.schemaValidation.settings.operations.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(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 - `OperationListResponse` - `mitigation_action: "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: string` UUID. ### Operation Get Response - `OperationGetResponse` - `mitigation_action: "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: string` UUID. ### Operation Update Response - `OperationUpdateResponse` - `mitigation_action: "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: string` UUID. ### Operation Bulk Edit Response - `OperationBulkEditResponse = Record` Operation ID to per operation setting mapping - `mitigation_action: "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: string` UUID. ### Operation Delete Response - `OperationDeleteResponse` - `operation_id?: string` UUID.