# Managed Transforms ## List Managed Transforms `client.managedTransforms.list(ManagedTransformListParamsparams, RequestOptionsoptions?): ManagedTransformListResponse` **get** `/zones/{zone_id}/managed_headers` Fetches a list of all Managed Transforms. ### Parameters - `params: ManagedTransformListParams` - `zone_id: string` The unique ID of the zone. ### Returns - `ManagedTransformListResponse` A result. - `managed_request_headers: Array` The list of Managed Request Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. - `managed_response_headers: Array` The list of Managed Response Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. ### 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 managedTransforms = await client.managedTransforms.list({ zone_id: '9f1839b6152d298aca64c4e906b6d074', }); console.log(managedTransforms.managed_request_headers); ``` #### Response ```json { "errors": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "messages": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "result": { "managed_request_headers": [ { "id": "add_bot_protection_headers", "enabled": true, "has_conflict": false, "conflicts_with": [ "add_true_client_ip_headers" ] } ], "managed_response_headers": [ { "id": "add_security_headers", "enabled": true, "has_conflict": false, "conflicts_with": [ "add_true_client_ip_headers" ] } ] }, "success": true } ``` ## Update Managed Transforms `client.managedTransforms.edit(ManagedTransformEditParamsparams, RequestOptionsoptions?): ManagedTransformEditResponse` **patch** `/zones/{zone_id}/managed_headers` Updates the status of one or more Managed Transforms. ### Parameters - `params: ManagedTransformEditParams` - `zone_id: string` Path param: The unique ID of the zone. - `managed_request_headers: Array` Body param: The list of Managed Request Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. - `managed_response_headers: Array` Body param: The list of Managed Response Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. ### Returns - `ManagedTransformEditResponse` A result. - `managed_request_headers: Array` The list of Managed Request Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. - `managed_response_headers: Array` The list of Managed Response Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. ### 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.managedTransforms.edit({ zone_id: '9f1839b6152d298aca64c4e906b6d074', managed_request_headers: [{ id: 'add_bot_protection_headers', enabled: true }], managed_response_headers: [{ id: 'add_security_headers', enabled: true }], }); console.log(response.managed_request_headers); ``` #### Response ```json { "errors": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "messages": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "result": { "managed_request_headers": [ { "id": "add_bot_protection_headers", "enabled": true, "has_conflict": false, "conflicts_with": [ "add_true_client_ip_headers" ] } ], "managed_response_headers": [ { "id": "add_security_headers", "enabled": true, "has_conflict": false, "conflicts_with": [ "add_true_client_ip_headers" ] } ] }, "success": true } ``` ## Delete Managed Transforms `client.managedTransforms.delete(ManagedTransformDeleteParamsparams, RequestOptionsoptions?): void` **delete** `/zones/{zone_id}/managed_headers` Disables all Managed Transforms. ### Parameters - `params: ManagedTransformDeleteParams` - `zone_id: string` The unique ID of the zone. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); await client.managedTransforms.delete({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); ``` ## Domain Types ### Managed Transform List Response - `ManagedTransformListResponse` A result. - `managed_request_headers: Array` The list of Managed Request Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. - `managed_response_headers: Array` The list of Managed Response Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. ### Managed Transform Edit Response - `ManagedTransformEditResponse` A result. - `managed_request_headers: Array` The list of Managed Request Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with. - `managed_response_headers: Array` The list of Managed Response Transforms. - `id: string` The human-readable identifier of the Managed Transform. - `enabled: boolean` Whether the Managed Transform is enabled. - `has_conflict: boolean` Whether the Managed Transform conflicts with the currently-enabled Managed Transforms. - `conflicts_with?: Array` The Managed Transforms that this Managed Transform conflicts with.