Skip to content
Start here

Update URL Normalization settings

PUT/zones/{zone_id}/url_normalization

Updates the URL Normalization settings.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Response Compression WriteConfig Settings WriteDynamic URL Redirects WriteCache Settings WriteCustom Errors WriteOrigin WriteManaged headers WriteZone Transform Rules WriteMass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteHTTP DDoS Managed Ruleset WriteSanitize WriteTransform Rules WriteSelect Configuration WriteBot Management WriteZone WAF WriteAccount WAF WriteAccount Rulesets WriteLogs WriteLogs Write
Path ParametersExpand Collapse
zone_id: string

The unique ID of the zone.

Body ParametersJSONExpand Collapse
scope: "incoming" or "both" or "none"

The scope of the URL normalization.

One of the following:
"incoming"
"both"
"none"
type: "cloudflare" or "rfc3986"

The type of URL normalization performed by Cloudflare.

One of the following:
"cloudflare"
"rfc3986"
ReturnsExpand Collapse
errors: array of object { message, code, source }

A list of error messages.

message: string

A text description of this message.

minLength1
code: optional number

A unique code for this message.

source: optional object { pointer }

The source of this message.

pointer: string

A JSON pointer to the field that is the source of the message.

minLength1
messages: array of object { message, code, source }

A list of warning messages.

message: string

A text description of this message.

minLength1
code: optional number

A unique code for this message.

source: optional object { pointer }

The source of this message.

pointer: string

A JSON pointer to the field that is the source of the message.

minLength1
result: object { scope, type }

A result.

scope: "incoming" or "both" or "none"

The scope of the URL normalization.

One of the following:
"incoming"
"both"
"none"
type: "cloudflare" or "rfc3986"

The type of URL normalization performed by Cloudflare.

One of the following:
"cloudflare"
"rfc3986"
success: true

Whether the API call was successful.

Update URL Normalization settings

curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/url_normalization \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -d '{
          "scope": "incoming",
          "type": "cloudflare"
        }'
{
  "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
}
Returns Examples
{
  "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
}