Skip to content
Start here

Cache

Purge Cached Content
cache.purge(CachePurgeParams**kwargs) -> CachePurgeResponse
POST/zones/{zone_id}/purge_cache
Purge Cached Content by Environment
cache.purge_environment(strenvironment_id, CachePurgeEnvironmentParams**kwargs) -> CachePurgeEnvironmentResponse
POST/zones/{zone_id}/environments/{environment_id}/purge_cache
ModelsExpand Collapse
class CachePurgeResponse:
id: str
maxLength32
class CachePurgeEnvironmentResponse:
id: str
maxLength32

CacheCache Reserve

Get Cache Reserve setting
cache.cache_reserve.get(CacheReserveGetParams**kwargs) -> CacheReserveGetResponse
GET/zones/{zone_id}/cache/cache_reserve
Change Cache Reserve setting
cache.cache_reserve.edit(CacheReserveEditParams**kwargs) -> CacheReserveEditResponse
PATCH/zones/{zone_id}/cache/cache_reserve
Get Cache Reserve Clear
cache.cache_reserve.status(CacheReserveStatusParams**kwargs) -> CacheReserveStatusResponse
GET/zones/{zone_id}/cache/cache_reserve_clear
Start Cache Reserve Clear
cache.cache_reserve.clear(CacheReserveClearParams**kwargs) -> CacheReserveClearResponse
POST/zones/{zone_id}/cache/cache_reserve_clear
ModelsExpand Collapse
Literal["cache_reserve"]

The identifier of the caching setting.

Literal["cache_reserve_clear"]

ID of the zone setting.

Literal["In-progress", "Completed"]

The current state of the Cache Reserve Clear operation.

One of the following:
"In-progress"
"Completed"
class CacheReserveGetResponse:

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Literal["on", "off"]

Value of the Cache Reserve zone setting.

One of the following:
"on"
"off"
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class CacheReserveEditResponse:

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Literal["on", "off"]

Value of the Cache Reserve zone setting.

One of the following:
"on"
"off"
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class CacheReserveStatusResponse:

You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.

ID of the zone setting.

start_ts: datetime

The time that the latest Cache Reserve Clear operation started.

formatdate-time
state: State

The current state of the Cache Reserve Clear operation.

end_ts: Optional[datetime]

The time that the latest Cache Reserve Clear operation completed.

formatdate-time
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class CacheReserveClearResponse:

You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.

ID of the zone setting.

start_ts: datetime

The time that the latest Cache Reserve Clear operation started.

formatdate-time
state: State

The current state of the Cache Reserve Clear operation.

end_ts: Optional[datetime]

The time that the latest Cache Reserve Clear operation completed.

formatdate-time
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time

CacheSmart Tiered Cache

Get Smart Tiered Cache setting
cache.smart_tiered_cache.get(SmartTieredCacheGetParams**kwargs) -> SmartTieredCacheGetResponse
GET/zones/{zone_id}/cache/tiered_cache_smart_topology_enable
Create Smart Tiered Cache setting
cache.smart_tiered_cache.create(SmartTieredCacheCreateParams**kwargs) -> SmartTieredCacheCreateResponse
POST/zones/{zone_id}/cache/tiered_cache_smart_topology_enable
Patch Smart Tiered Cache setting
cache.smart_tiered_cache.edit(SmartTieredCacheEditParams**kwargs) -> SmartTieredCacheEditResponse
PATCH/zones/{zone_id}/cache/tiered_cache_smart_topology_enable
Delete Smart Tiered Cache setting
cache.smart_tiered_cache.delete(SmartTieredCacheDeleteParams**kwargs) -> SmartTieredCacheDeleteResponse
DELETE/zones/{zone_id}/cache/tiered_cache_smart_topology_enable
ModelsExpand Collapse
class SmartTieredCacheGetResponse:
id: Literal["tiered_cache_smart_topology_enable"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Literal["on", "off"]

Value of the Smart Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class SmartTieredCacheCreateResponse:
id: Literal["tiered_cache_smart_topology_enable"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Literal["on", "off"]

Value of the Smart Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class SmartTieredCacheEditResponse:
id: Literal["tiered_cache_smart_topology_enable"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Literal["on", "off"]

Value of the Smart Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class SmartTieredCacheDeleteResponse:
id: Literal["tiered_cache_smart_topology_enable"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time

CacheVariants

Get variants setting
cache.variants.get(VariantGetParams**kwargs) -> VariantGetResponse
GET/zones/{zone_id}/cache/variants
Change variants setting
cache.variants.edit(VariantEditParams**kwargs) -> VariantEditResponse
PATCH/zones/{zone_id}/cache/variants
Delete variants setting
cache.variants.delete(VariantDeleteParams**kwargs) -> VariantDeleteResponse
DELETE/zones/{zone_id}/cache/variants
ModelsExpand Collapse
class CacheVariant:

Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the ‘Vary: Accept’ response header. If the origin server sends ‘Vary: Accept’ but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.

id: Literal["variants"]

ID of the zone setting.

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class VariantGetResponse:
id: Literal["variants"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Value

Value of the zone setting.

avif: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for avif.

bmp: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for bmp.

gif: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for gif.

jp2: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for jp2.

jpeg: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for jpeg.

jpg: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for jpg.

jpg2: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for jpg2.

png: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for png.

tif: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for tif.

tiff: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for tiff.

webp: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for webp.

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class VariantEditResponse:
id: Literal["variants"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Value

Value of the zone setting.

avif: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for avif.

bmp: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for bmp.

gif: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for gif.

jp2: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for jp2.

jpeg: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for jpeg.

jpg: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for jpg.

jpg2: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for jpg2.

png: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for png.

tif: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for tif.

tiff: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for tiff.

webp: Optional[List[str]]

List of strings with the MIME types of all the variants that should be served for webp.

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class VariantDeleteResponse:
id: Literal["variants"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time

CacheRegional Tiered Cache

Get Regional Tiered Cache setting
cache.regional_tiered_cache.get(RegionalTieredCacheGetParams**kwargs) -> RegionalTieredCacheGetResponse
GET/zones/{zone_id}/cache/regional_tiered_cache
Change Regional Tiered Cache setting
cache.regional_tiered_cache.edit(RegionalTieredCacheEditParams**kwargs) -> RegionalTieredCacheEditResponse
PATCH/zones/{zone_id}/cache/regional_tiered_cache
ModelsExpand Collapse
Literal["tc_regional"]

The identifier of the caching setting.

class RegionalTieredCacheGetResponse:

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Literal["on", "off"]

Value of the Regional Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class RegionalTieredCacheEditResponse:

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Literal["on", "off"]

Value of the Regional Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time

CacheOrigin Cloud Regions

List origin cloud region mappings
cache.origin_cloud_regions.list(OriginCloudRegionListParams**kwargs) -> SyncV4PagePaginationArray[OriginCloudRegion]
GET/zones/{zone_id}/origin/cloud_regions
Get an origin cloud region mapping
cache.origin_cloud_regions.get(strorigin_ip, OriginCloudRegionGetParams**kwargs) -> OriginCloudRegion
GET/zones/{zone_id}/origin/cloud_regions/{origin_ip}
Create or replace an origin cloud region mapping
cache.origin_cloud_regions.update(strpath_origin_ip, OriginCloudRegionUpdateParams**kwargs) -> OriginCloudRegion
PUT/zones/{zone_id}/origin/cloud_regions/{origin_ip}
Delete an origin cloud region mapping
cache.origin_cloud_regions.delete(strorigin_ip, OriginCloudRegionDeleteParams**kwargs) -> OriginCloudRegionDeleteResponse
DELETE/zones/{zone_id}/origin/cloud_regions/{origin_ip}
Batch create or replace origin cloud region mappings
cache.origin_cloud_regions.bulk_update(OriginCloudRegionBulkUpdateParams**kwargs) -> OriginCloudRegionBulkUpdateResponse
PUT/zones/{zone_id}/origin/cloud_regions/batch
Batch delete origin cloud region mappings
cache.origin_cloud_regions.bulk_delete(OriginCloudRegionBulkDeleteParams**kwargs) -> OriginCloudRegionBulkDeleteResponse
DELETE/zones/{zone_id}/origin/cloud_regions/batch
List supported cloud vendors and regions
cache.origin_cloud_regions.supported_regions(OriginCloudRegionSupportedRegionsParams**kwargs) -> OriginCloudRegionSupportedRegionsResponse
GET/zones/{zone_id}/origin/cloud_regions/supported_regions
ModelsExpand Collapse
class OriginCloudRegion:

A single origin IP-to-cloud-region mapping.

origin_ip: str

The origin IP address (IPv4 or IPv6). Normalized to canonical form (RFC 5952 for IPv6).

region: str

Cloud vendor region identifier.

vendor: Literal["aws", "azure", "gcp", "oci"]

Cloud vendor hosting the origin.

One of the following:
"aws"
"azure"
"gcp"
"oci"
modified_on: Optional[datetime]

Time this mapping was last modified.

formatdate-time
class OriginCloudRegionDeleteResponse:

Response result for a delete operation. Identifies the deleted mapping.

origin_ip: str

The origin IP address whose mapping was deleted.

class OriginCloudRegionBulkUpdateResponse:

Response result for a batch origin cloud region operation.

failed: List[Failed]

Items that could not be applied, with error details.

origin_ip: str

The origin IP address for this item.

error: Optional[str]

Error message explaining why the item failed. Present only on failed items.

region: Optional[str]

Cloud vendor region identifier. Present on succeeded items (the new value for upsert, the deleted value for delete).

vendor: Optional[str]

Cloud vendor identifier. Present on succeeded items (the new value for upsert, the deleted value for delete).

succeeded: List[Succeeded]

Items that were successfully applied.

origin_ip: str

The origin IP address for this item.

error: Optional[str]

Error message explaining why the item failed. Present only on failed items.

region: Optional[str]

Cloud vendor region identifier. Present on succeeded items (the new value for upsert, the deleted value for delete).

vendor: Optional[str]

Cloud vendor identifier. Present on succeeded items (the new value for upsert, the deleted value for delete).

class OriginCloudRegionBulkDeleteResponse:

Response result for a batch origin cloud region operation.

failed: List[Failed]

Items that could not be applied, with error details.

origin_ip: str

The origin IP address for this item.

error: Optional[str]

Error message explaining why the item failed. Present only on failed items.

region: Optional[str]

Cloud vendor region identifier. Present on succeeded items (the new value for upsert, the deleted value for delete).

vendor: Optional[str]

Cloud vendor identifier. Present on succeeded items (the new value for upsert, the deleted value for delete).

succeeded: List[Succeeded]

Items that were successfully applied.

origin_ip: str

The origin IP address for this item.

error: Optional[str]

Error message explaining why the item failed. Present only on failed items.

region: Optional[str]

Cloud vendor region identifier. Present on succeeded items (the new value for upsert, the deleted value for delete).

vendor: Optional[str]

Cloud vendor identifier. Present on succeeded items (the new value for upsert, the deleted value for delete).

class OriginCloudRegionSupportedRegionsResponse:

Cloud vendors and their supported regions for origin cloud region mappings.

obtained_codes: bool

Whether Cloudflare airport codes (IATA colo identifiers) were successfully resolved for the upper_tier_colos field on each region. When false, the upper_tier_colos arrays may be empty or incomplete.

vendors: Dict[str, List[Vendor]]

Map of vendor name to list of supported regions.

name: str

Cloud vendor region identifier.

upper_tier_colos: List[str]

Cloudflare Tiered Cache upper-tier colocation codes co-located with this cloud region. Requests from zones with a matching origin mapping will be routed through these colos.