Skip to content
Start here

Update configuration properties

client.apiGateway.configurations.update(ConfigurationUpdateParams { zone_id, auth_id_characteristics, normalize } params, RequestOptionsoptions?): Configuration { auth_id_characteristics }
PUT/zones/{zone_id}/api_gateway/configuration

Updates API Shield configuration settings for a zone. Can modify validation strictness, enforcement mode, and other global 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)
Account API GatewayDomain API Gateway
ParametersExpand Collapse
params: ConfigurationUpdateParams { zone_id, auth_id_characteristics, normalize }
zone_id: string

Path param: Identifier.

maxLength32
auth_id_characteristics: Array<APIShieldAuthIDCharacteristic { name, type } | APIShieldAuthIDCharacteristicJWTClaim { name, type } >

Body param

One of the following:
APIShieldAuthIDCharacteristic { name, type }

Auth ID Characteristic

name: string

The name of the characteristic field, i.e., the header or cookie name.

maxLength128
type: "header" | "cookie"

The type of characteristic.

One of the following:
"header"
"cookie"
APIShieldAuthIDCharacteristicJWTClaim { name, type }

Auth ID Characteristic extracted from JWT Token Claims

name: string

Claim location expressed as $(token_config_id):$(json_path), where token_config_id is the ID of the token configuration used in validating the JWT, and json_path is a RFC 9535 JSONPath (https://goessner.net/articles/JsonPath/, https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in dot or bracket notation, may only specify literal keys or array indexes, and must return a singleton value, which will be interpreted as a string.

maxLength128
type: "jwt"

The type of characteristic.

normalize?: boolean

Query param: Ensures that the configuration is written or retrieved in normalized fashion

ReturnsExpand Collapse
Configuration { auth_id_characteristics }
auth_id_characteristics: Array<APIShieldAuthIDCharacteristic { name, type } | APIShieldAuthIDCharacteristicJWTClaim { name, type } >
One of the following:
APIShieldAuthIDCharacteristic { name, type }

Auth ID Characteristic

name: string

The name of the characteristic field, i.e., the header or cookie name.

maxLength128
type: "header" | "cookie"

The type of characteristic.

One of the following:
"header"
"cookie"
APIShieldAuthIDCharacteristicJWTClaim { name, type }

Auth ID Characteristic extracted from JWT Token Claims

name: string

Claim location expressed as $(token_config_id):$(json_path), where token_config_id is the ID of the token configuration used in validating the JWT, and json_path is a RFC 9535 JSONPath (https://goessner.net/articles/JsonPath/, https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in dot or bracket notation, may only specify literal keys or array indexes, and must return a singleton value, which will be interpreted as a string.

maxLength128
type: "jwt"

The type of characteristic.

Update configuration properties

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const configuration = await client.apiGateway.configurations.update({
  zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
  auth_id_characteristics: [{ name: 'authorization', type: 'header' }],
});

console.log(configuration.auth_id_characteristics);
{
  "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": {
    "auth_id_characteristics": [
      {
        "name": "authorization",
        "type": "header"
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "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": {
    "auth_id_characteristics": [
      {
        "name": "authorization",
        "type": "header"
      }
    ]
  },
  "success": true
}