Skip to content
Start here

User Schemas

Retrieve information about all schemas on a zone
Deprecated
api_gateway.user_schemas.list(UserSchemaListParams**kwargs) -> SyncV4PagePaginationArray[OldPublicSchema]
GET/zones/{zone_id}/api_gateway/user_schemas
Retrieve information about a specific schema on a zone
Deprecated
api_gateway.user_schemas.get(strschema_id, UserSchemaGetParams**kwargs) -> OldPublicSchema
GET/zones/{zone_id}/api_gateway/user_schemas/{schema_id}
Upload a schema to a zone
Deprecated
api_gateway.user_schemas.create(UserSchemaCreateParams**kwargs) -> UserSchemaCreateResponse
POST/zones/{zone_id}/api_gateway/user_schemas
Enable validation for a schema
Deprecated
api_gateway.user_schemas.edit(strschema_id, UserSchemaEditParams**kwargs) -> OldPublicSchema
PATCH/zones/{zone_id}/api_gateway/user_schemas/{schema_id}
Delete a schema
Deprecated
api_gateway.user_schemas.delete(strschema_id, UserSchemaDeleteParams**kwargs) -> UserSchemaDeleteResponse
DELETE/zones/{zone_id}/api_gateway/user_schemas/{schema_id}
ModelsExpand Collapse
List[MessageItem]
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[MessageItemSource]
pointer: Optional[str]
class OldPublicSchema:
created_at: datetime
formatdate-time
kind: Literal["openapi_v3"]

Kind of schema

name: str

Name of the schema

schema_id: str

UUID.

maxLength36
minLength36
source: Optional[str]

Source of the schema

validation_enabled: Optional[bool]

Flag whether schema is enabled for validation.

class UserSchemaCreateResponse:
upload_details: Optional[UploadDetails]
warnings: Optional[List[UploadDetailsWarning]]

Diagnostic warning events that occurred during processing. These events are non-critical errors found within the schema.

code: int

Code that identifies the event that occurred.

locations: Optional[List[str]]

JSONPath location(s) in the schema where these events were encountered. See https://goessner.net/articles/JsonPath/ for JSONPath specification.

message: Optional[str]

Diagnostic message that describes the event.

class UserSchemaDeleteResponse:
errors: Message
messages: Message
success: Literal[true]

Whether the API call was successful.

User SchemasOperations

Retrieve all operations from a schema.
Deprecated
api_gateway.user_schemas.operations.list(strschema_id, OperationListParams**kwargs) -> SyncV4PagePaginationArray[OperationListResponse]
GET/zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations
ModelsExpand Collapse
One of the following:
class APIShieldOperation:
endpoint: str

The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/.

formaturi-template
maxLength4096
host: str

RFC3986-compliant host.

formathostname
maxLength255
last_updated: datetime
formatdate-time
method: Literal["GET", "POST", "HEAD", 6 more]

The HTTP method used to access the endpoint.

One of the following:
"GET"
"POST"
"HEAD"
"OPTIONS"
"PUT"
"DELETE"
"CONNECT"
"PATCH"
"TRACE"
operation_id: str

UUID.

maxLength36
minLength36
features: Optional[APIShieldOperationFeatures]
One of the following:
class APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds:
thresholds: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds]
auth_id_tokens: Optional[int]

The total number of auth-ids seen across this calculation.

data_points: Optional[int]

The number of data points used for the threshold suggestion calculation.

last_updated: Optional[datetime]
formatdate-time
p50: Optional[int]

The p50 quantile of requests (in period_seconds).

p90: Optional[int]

The p90 quantile of requests (in period_seconds).

p99: Optional[int]

The p99 quantile of requests (in period_seconds).

period_seconds: Optional[int]

The period over which this threshold is suggested.

requests: Optional[int]

The estimated number of requests covered by these calculations.

suggested_threshold: Optional[int]

The suggested threshold in requests done by the same auth_id or period_seconds.

class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas:
parameter_schemas: APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas
last_updated: Optional[datetime]
formatdate-time
parameter_schemas: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas]

An operation schema object containing a response.

parameters: Optional[List[object]]

An array containing the learned parameter schemas.

responses: Optional[object]

An empty response object. This field is required to yield a valid operation schema.

class APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting:
api_routing: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting]

API Routing settings on endpoint.

last_updated: Optional[datetime]
formatdate-time
route: Optional[str]

Target route.

class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals:
confidence_intervals: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals]
last_updated: Optional[datetime]
formatdate-time
suggested_threshold: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold]
confidence_intervals: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals]
p90: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90]

Upper and lower bound for percentile estimate

lower: Optional[float]

Lower bound for percentile estimate

upper: Optional[float]

Upper bound for percentile estimate

p95: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95]

Upper and lower bound for percentile estimate

lower: Optional[float]

Lower bound for percentile estimate

upper: Optional[float]

Upper bound for percentile estimate

p99: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99]

Upper and lower bound for percentile estimate

lower: Optional[float]

Lower bound for percentile estimate

upper: Optional[float]

Upper bound for percentile estimate

mean: Optional[float]

Suggested threshold.

class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo:
schema_info: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo]
active_schema: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema]

Schema active on endpoint.

id: Optional[str]

UUID.

maxLength36
minLength36
created_at: Optional[datetime]
formatdate-time
is_learned: Optional[bool]

True if schema is Cloudflare-provided.

name: Optional[str]

Schema file name.

learned_available: Optional[bool]

True if a Cloudflare-provided learned schema is available for this endpoint.

mitigation_action: Optional[Literal["none", "log", "block"]]

Action taken on requests failing validation.

One of the following:
"none"
"log"
"block"
class APIShieldBasicOperation:
endpoint: str

The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/.

formaturi-template
maxLength4096
host: str

RFC3986-compliant host.

formathostname
maxLength255
method: Literal["GET", "POST", "HEAD", 6 more]

The HTTP method used to access the endpoint.

One of the following:
"GET"
"POST"
"HEAD"
"OPTIONS"
"PUT"
"DELETE"
"CONNECT"
"PATCH"
"TRACE"

User SchemasHosts

Retrieve schema hosts in a zone
Deprecated
api_gateway.user_schemas.hosts.list(HostListParams**kwargs) -> SyncV4PagePaginationArray[HostListResponse]
GET/zones/{zone_id}/api_gateway/user_schemas/hosts
ModelsExpand Collapse
class HostListResponse:
created_at: datetime
formatdate-time
hosts: List[str]

Hosts serving the schema, e.g zone.host.com

name: str

Name of the schema

schema_id: str

UUID.

maxLength36
minLength36