API Gateway

api_gateway

API Gateway

Configurations

api_gateway.configurations

Methods

Retrieve Information About Specific Configuration Properties -> Envelope<>
get/zones/{zone_id}/api_gateway/configuration

Gets the current API Shield configuration settings for a zone, including validation behavior and enforcement mode.

Update Configuration Properties -> Envelope<>
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.

Domain types

Configuration = { auth_id_characteristics }
API Gateway

Discovery

api_gateway.discovery

Methods

Retrieve Discovered Operations On A Zone Rendered As OpenAPI Schemas -> Envelope<{ schemas, timestamp }>
get/zones/{zone_id}/api_gateway/discovery

Retrieve the most up to date view of discovered operations, rendered as OpenAPI schemas

Domain types

DiscoveryOperation = { id, endpoint, host, 5 more... }

api_gateway.discovery.operations

Methods

Retrieve Discovered Operations On A Zone -> V4PagePaginationArray<>
get/zones/{zone_id}/api_gateway/discovery/operations

Retrieve the most up to date view of discovered operations

Patch Discovered Operation -> Envelope<{ state }>
patch/zones/{zone_id}/api_gateway/discovery/operations/{operation_id}

Update the state on a discovered operation

Patch Discovered Operations -> Envelope<Record<string, { state }>>
patch/zones/{zone_id}/api_gateway/discovery/operations

Update the state on one or more discovered operations

API Gateway

Expression Template

api_gateway.expression_template

api_gateway.expression_template.fallthrough

Methods

Generate Fallthrough WAF Expression Template From A Set Of API Hosts -> Envelope<{ expression, title }>
post/zones/{zone_id}/api_gateway/expression-template/fallthrough

Creates an expression template fallthrough rule for API Shield. Used for configuring default behavior when no other expression templates match.

API Gateway

Operations

api_gateway.operations

Methods

Retrieve Information About All Operations On A Zone -> V4PagePaginationArray<{ endpoint, host, last_updated, 3 more... }>
get/zones/{zone_id}/api_gateway/operations

Lists all API operations tracked by API Shield for a zone with pagination. Returns operation details including method, path, and feature configurations.

Retrieve Information About An Operation -> Envelope<{ endpoint, host, last_updated, 3 more... }>
get/zones/{zone_id}/api_gateway/operations/{operation_id}

Gets detailed information about a specific API operation in API Shield, including its schema validation settings and traffic statistics.

Add One Operation To A Zone -> Envelope<{ endpoint, host, last_updated, 3 more... }>
post/zones/{zone_id}/api_gateway/operations/item

Add one operation to a zone. Endpoints can contain path variables. Host, method, endpoint will be normalized to a canoncial form when creating an operation and must be unique on the zone. Inserting an operation that matches an existing one will return the record of the already existing operation and update its last_updated date.

Delete An Operation -> { errors, messages, success }
delete/zones/{zone_id}/api_gateway/operations/{operation_id}

Removes a single API operation from API Shield endpoint management. The operation will no longer be tracked or protected by API Shield rules.

Add Operations To A Zone -> SinglePage<{ endpoint, host, last_updated, 3 more... }>
post/zones/{zone_id}/api_gateway/operations

Add one or more operations to a zone. Endpoints can contain path variables. Host, method, endpoint will be normalized to a canoncial form when creating an operation and must be unique on the zone. Inserting an operation that matches an existing one will return the record of the already existing operation and update its last_updated date.

Delete Multiple Operations -> { errors, messages, success }
delete/zones/{zone_id}/api_gateway/operations

Bulk removes multiple API operations from API Shield endpoint management in a single request. Efficient for cleaning up unused endpoints.

Domain types

APIShield = { endpoint, host, last_updated, 2 more... }
API GatewayOperations

Schema Validation

api_gateway.operations.schema_validation

Methods

Retrieve Operation Level Schema Validation Settings -> { mitigation_action, operation_id }
Deprecated
get/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation

Deprecated

Use Schema Validation API instead.

Retrieves operation-level schema validation settings on the zone

Update Operation Level Schema Validation Settings -> { mitigation_action, operation_id }
Deprecated
put/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation

Deprecated

Use Schema Validation API instead.

Updates operation-level schema validation settings on the zone

Update Multiple Operation Level Schema Validation Settings -> Envelope<>
Deprecated
patch/zones/{zone_id}/api_gateway/operations/schema_validation

Deprecated

Use Schema Validation API instead.

Updates multiple operation-level schema validation settings on the zone

Domain types

SettingsMultipleRequest = Record<string, { mitigation_action }>

api_gateway.schemas

Methods

Retrieve Operations And Features As OpenAPI Schemas -> Envelope<{ schemas, timestamp }>
get/zones/{zone_id}/api_gateway/schemas

Retrieve operations and features as OpenAPI schemas

API Gateway

Settings

api_gateway.settings

Domain types

Settings = { validation_default_mitigation_action, validation_override_mitigation_action }
API GatewaySettings

Schema Validation

api_gateway.settings.schema_validation

Methods

Retrieve Zone Level Schema Validation Settings ->
Deprecated
get/zones/{zone_id}/api_gateway/settings/schema_validation

Deprecated

Use Schema Validation API instead.

Retrieves zone level schema validation settings currently set on the zone

Update Zone Level Schema Validation Settings ->
Deprecated
put/zones/{zone_id}/api_gateway/settings/schema_validation

Deprecated

Use Schema Validation API instead.

Updates zone level schema validation settings on the zone

Update Zone Level Schema Validation Settings ->
Deprecated
patch/zones/{zone_id}/api_gateway/settings/schema_validation

Deprecated

Use Schema Validation API instead.

Updates zone level schema validation settings on the zone

API Gateway

User Schemas

api_gateway.user_schemas

Methods

Retrieve Information About All Schemas On A Zone -> V4PagePaginationArray<>
Deprecated
get/zones/{zone_id}/api_gateway/user_schemas

Deprecated

Use Schema Validation API instead.

Lists all OpenAPI schemas uploaded to API Shield for the zone, including their validation status and associated operations.

Retrieve Information About A Specific Schema On A Zone -> Envelope<>
Deprecated
get/zones/{zone_id}/api_gateway/user_schemas/{schema_id}

Deprecated

Use Schema Validation API instead.

Gets detailed information about a specific uploaded OpenAPI schema, including its contents and validation configuration.

Upload A Schema To A Zone -> Envelope<{ schema, upload_details }>
Deprecated
post/zones/{zone_id}/api_gateway/user_schemas

Deprecated

Use Schema Validation API instead.

Upload a schema to a zone

Enable Validation For A Schema -> Envelope<>
Deprecated
patch/zones/{zone_id}/api_gateway/user_schemas/{schema_id}

Deprecated

Use Schema Validation API instead.

Activates schema validation for an uploaded OpenAPI schema. Requests to matching endpoints will be validated against the schema definitions.

Delete A Schema -> { errors, messages, success }
Deprecated
delete/zones/{zone_id}/api_gateway/user_schemas/{schema_id}

Deprecated

Use Schema Validation API instead.

Permanently removes an uploaded OpenAPI schema from API Shield schema validation. Operations using this schema will lose their validation rules.

Security

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

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Accepted Permissions (at least one required)

Account API Gateway Domain API Gateway

path Parameters
zone_id: string
(maxLength: 32)

Identifier.

schema_id: string
(format: uuid, maxLength: 36)
Response fields
errors:
messages:
success: true

Whether the API call was successful.

Request example
200Example

Domain types

Message = Array<{ code, message, documentation_url, 1 more... }>
OldPublicSchema = { created_at, kind, name, 3 more... }

api_gateway.user_schemas.hosts

Methods

Retrieve Schema Hosts In A Zone -> V4PagePaginationArray<{ created_at, hosts, name, 1 more... }>
Deprecated
get/zones/{zone_id}/api_gateway/user_schemas/hosts

Deprecated

Use Schema Validation API instead.

Lists all unique hosts found in uploaded OpenAPI schemas for the zone. Useful for understanding which domains have schema coverage.

api_gateway.user_schemas.operations

Methods

Retrieve All Operations From A Schema -> V4PagePaginationArray<{ endpoint, host, last_updated, 3 more... } | { endpoint, host, method }>
Deprecated
get/zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations

Deprecated

Use Schema Validation API instead.

Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations.