# URL Normalization ## Get URL Normalization settings `client.urlNormalization.get(URLNormalizationGetParamsparams, RequestOptionsoptions?): URLNormalizationGetResponse` **get** `/zones/{zone_id}/url_normalization` Fetches the current URL Normalization settings. ### Parameters - `params: URLNormalizationGetParams` - `zone_id: string` The unique ID of the zone. ### Returns - `URLNormalizationGetResponse` A result. - `scope: "incoming" | "both" | "none"` The scope of the URL normalization. - `"incoming"` - `"both"` - `"none"` - `type: "cloudflare" | "rfc3986"` The type of URL normalization performed by Cloudflare. - `"cloudflare"` - `"rfc3986"` ### 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 urlNormalization = await client.urlNormalization.get({ zone_id: '9f1839b6152d298aca64c4e906b6d074', }); console.log(urlNormalization.scope); ``` #### 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": { "scope": "incoming", "type": "cloudflare" }, "success": true } ``` ## Update URL Normalization settings `client.urlNormalization.update(URLNormalizationUpdateParamsparams, RequestOptionsoptions?): URLNormalizationUpdateResponse` **put** `/zones/{zone_id}/url_normalization` Updates the URL Normalization settings. ### Parameters - `params: URLNormalizationUpdateParams` - `zone_id: string` Path param: The unique ID of the zone. - `scope: "incoming" | "both" | "none"` Body param: The scope of the URL normalization. - `"incoming"` - `"both"` - `"none"` - `type: "cloudflare" | "rfc3986"` Body param: The type of URL normalization performed by Cloudflare. - `"cloudflare"` - `"rfc3986"` ### Returns - `URLNormalizationUpdateResponse` A result. - `scope: "incoming" | "both" | "none"` The scope of the URL normalization. - `"incoming"` - `"both"` - `"none"` - `type: "cloudflare" | "rfc3986"` The type of URL normalization performed by Cloudflare. - `"cloudflare"` - `"rfc3986"` ### 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 urlNormalization = await client.urlNormalization.update({ zone_id: '9f1839b6152d298aca64c4e906b6d074', scope: 'incoming', type: 'cloudflare', }); console.log(urlNormalization.scope); ``` #### 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": { "scope": "incoming", "type": "cloudflare" }, "success": true } ``` ## Delete URL Normalization settings `client.urlNormalization.delete(URLNormalizationDeleteParamsparams, RequestOptionsoptions?): void` **delete** `/zones/{zone_id}/url_normalization` Deletes the URL Normalization settings. ### Parameters - `params: URLNormalizationDeleteParams` - `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.urlNormalization.delete({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); ``` ## Domain Types ### URL Normalization Get Response - `URLNormalizationGetResponse` A result. - `scope: "incoming" | "both" | "none"` The scope of the URL normalization. - `"incoming"` - `"both"` - `"none"` - `type: "cloudflare" | "rfc3986"` The type of URL normalization performed by Cloudflare. - `"cloudflare"` - `"rfc3986"` ### URL Normalization Update Response - `URLNormalizationUpdateResponse` A result. - `scope: "incoming" | "both" | "none"` The scope of the URL normalization. - `"incoming"` - `"both"` - `"none"` - `type: "cloudflare" | "rfc3986"` The type of URL normalization performed by Cloudflare. - `"cloudflare"` - `"rfc3986"`