Skip to content
Start here

Cache

Purge Cached Content
client.cache.purge(CachePurgeParamsparams, RequestOptionsoptions?): CachePurgeResponse { id } | null
POST/zones/{zone_id}/purge_cache
Purge Cached Content by Environment
client.cache.purgeEnvironment(stringenvironmentId, CachePurgeEnvironmentParamsparams, RequestOptionsoptions?): CachePurgeEnvironmentResponse { id } | null
POST/zones/{zone_id}/environments/{environment_id}/purge_cache
ModelsExpand Collapse
CachePurgeResponse { id }
id: string
maxLength32
CachePurgeEnvironmentResponse { id }
id: string
maxLength32

CacheCache Reserve

Get Cache Reserve setting
client.cache.cacheReserve.get(CacheReserveGetParams { zone_id } params, RequestOptionsoptions?): CacheReserveGetResponse { id, editable, value, modified_on }
GET/zones/{zone_id}/cache/cache_reserve
Change Cache Reserve setting
client.cache.cacheReserve.edit(CacheReserveEditParams { zone_id, value } params, RequestOptionsoptions?): CacheReserveEditResponse { id, editable, value, modified_on }
PATCH/zones/{zone_id}/cache/cache_reserve
Get Cache Reserve Clear
client.cache.cacheReserve.status(CacheReserveStatusParams { zone_id } params, RequestOptionsoptions?): CacheReserveStatusResponse { id, start_ts, state, 2 more }
GET/zones/{zone_id}/cache/cache_reserve_clear
Start Cache Reserve Clear
client.cache.cacheReserve.clear(CacheReserveClearParams { zone_id, body } params, RequestOptionsoptions?): CacheReserveClearResponse { id, start_ts, state, 2 more }
POST/zones/{zone_id}/cache/cache_reserve_clear
ModelsExpand Collapse
CacheReserve = "cache_reserve"

The identifier of the caching setting.

CacheReserveClear = "cache_reserve_clear"

ID of the zone setting.

State = "In-progress" | "Completed"

The current state of the Cache Reserve Clear operation.

One of the following:
"In-progress"
"Completed"
CacheReserveGetResponse { id, editable, value, modified_on }
id: CacheReserve { }

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: "on" | "off"

Value of the Cache Reserve zone setting.

One of the following:
"on"
"off"
modified_on?: string | null

Last time this setting was modified.

formatdate-time
CacheReserveEditResponse { id, editable, value, modified_on }
id: CacheReserve { }

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: "on" | "off"

Value of the Cache Reserve zone setting.

One of the following:
"on"
"off"
modified_on?: string | null

Last time this setting was modified.

formatdate-time
CacheReserveStatusResponse { id, start_ts, state, 2 more }

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: string

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?: string

The time that the latest Cache Reserve Clear operation completed.

formatdate-time
modified_on?: string | null

Last time this setting was modified.

formatdate-time
CacheReserveClearResponse { id, start_ts, state, 2 more }

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: string

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?: string

The time that the latest Cache Reserve Clear operation completed.

formatdate-time
modified_on?: string | null

Last time this setting was modified.

formatdate-time

CacheSmart Tiered Cache

Get Smart Tiered Cache setting
client.cache.smartTieredCache.get(SmartTieredCacheGetParams { zone_id } params, RequestOptionsoptions?): SmartTieredCacheGetResponse { id, editable, value, modified_on }
GET/zones/{zone_id}/cache/tiered_cache_smart_topology_enable
Create Smart Tiered Cache setting
client.cache.smartTieredCache.create(SmartTieredCacheCreateParams { zone_id, value } params, RequestOptionsoptions?): SmartTieredCacheCreateResponse { id, editable, value, modified_on }
POST/zones/{zone_id}/cache/tiered_cache_smart_topology_enable
Patch Smart Tiered Cache setting
client.cache.smartTieredCache.edit(SmartTieredCacheEditParams { zone_id, value } params, RequestOptionsoptions?): SmartTieredCacheEditResponse { id, editable, value, modified_on }
PATCH/zones/{zone_id}/cache/tiered_cache_smart_topology_enable
Delete Smart Tiered Cache setting
client.cache.smartTieredCache.delete(SmartTieredCacheDeleteParams { zone_id } params, RequestOptionsoptions?): SmartTieredCacheDeleteResponse { id, editable, modified_on }
DELETE/zones/{zone_id}/cache/tiered_cache_smart_topology_enable
ModelsExpand Collapse
SmartTieredCacheGetResponse { id, editable, value, modified_on }
id: "tiered_cache_smart_topology_enable"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: "on" | "off"

Value of the Smart Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on?: string | null

Last time this setting was modified.

formatdate-time
SmartTieredCacheCreateResponse { id, editable, value, modified_on }
id: "tiered_cache_smart_topology_enable"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: "on" | "off"

Value of the Smart Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on?: string | null

Last time this setting was modified.

formatdate-time
SmartTieredCacheEditResponse { id, editable, value, modified_on }
id: "tiered_cache_smart_topology_enable"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: "on" | "off"

Value of the Smart Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on?: string | null

Last time this setting was modified.

formatdate-time
SmartTieredCacheDeleteResponse { id, editable, modified_on }
id: "tiered_cache_smart_topology_enable"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

modified_on?: string | null

Last time this setting was modified.

formatdate-time

CacheVariants

Get variants setting
client.cache.variants.get(VariantGetParams { zone_id } params, RequestOptionsoptions?): VariantGetResponse { id, editable, value, modified_on }
GET/zones/{zone_id}/cache/variants
Change variants setting
client.cache.variants.edit(VariantEditParams { zone_id, value } params, RequestOptionsoptions?): VariantEditResponse { id, editable, value, modified_on }
PATCH/zones/{zone_id}/cache/variants
Delete variants setting
client.cache.variants.delete(VariantDeleteParams { zone_id } params, RequestOptionsoptions?): VariantDeleteResponse { id, editable, modified_on }
DELETE/zones/{zone_id}/cache/variants
ModelsExpand Collapse
CacheVariant { id, modified_on }

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: "variants"

ID of the zone setting.

modified_on?: string | null

Last time this setting was modified.

formatdate-time
VariantGetResponse { id, editable, value, modified_on }
id: "variants"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: Value { avif, bmp, gif, 8 more }

Value of the zone setting.

avif?: Array<string>

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

bmp?: Array<string>

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

gif?: Array<string>

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

jp2?: Array<string>

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

jpeg?: Array<string>

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

jpg?: Array<string>

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

jpg2?: Array<string>

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

png?: Array<string>

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

tif?: Array<string>

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

tiff?: Array<string>

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

webp?: Array<string>

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

modified_on?: string | null

Last time this setting was modified.

formatdate-time
VariantEditResponse { id, editable, value, modified_on }
id: "variants"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: Value { avif, bmp, gif, 8 more }

Value of the zone setting.

avif?: Array<string>

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

bmp?: Array<string>

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

gif?: Array<string>

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

jp2?: Array<string>

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

jpeg?: Array<string>

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

jpg?: Array<string>

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

jpg2?: Array<string>

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

png?: Array<string>

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

tif?: Array<string>

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

tiff?: Array<string>

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

webp?: Array<string>

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

modified_on?: string | null

Last time this setting was modified.

formatdate-time
VariantDeleteResponse { id, editable, modified_on }
id: "variants"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

modified_on?: string | null

Last time this setting was modified.

formatdate-time

CacheRegional Tiered Cache

Get Regional Tiered Cache setting
client.cache.regionalTieredCache.get(RegionalTieredCacheGetParams { zone_id } params, RequestOptionsoptions?): RegionalTieredCacheGetResponse { id, editable, value, modified_on }
GET/zones/{zone_id}/cache/regional_tiered_cache
Change Regional Tiered Cache setting
client.cache.regionalTieredCache.edit(RegionalTieredCacheEditParams { zone_id, value } params, RequestOptionsoptions?): RegionalTieredCacheEditResponse { id, editable, value, modified_on }
PATCH/zones/{zone_id}/cache/regional_tiered_cache
ModelsExpand Collapse
RegionalTieredCache = "tc_regional"

The identifier of the caching setting.

RegionalTieredCacheGetResponse { id, editable, value, modified_on }

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: "on" | "off"

Value of the Regional Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on?: string | null

Last time this setting was modified.

formatdate-time
RegionalTieredCacheEditResponse { id, editable, value, modified_on }

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: "on" | "off"

Value of the Regional Tiered Cache zone setting.

One of the following:
"on"
"off"
modified_on?: string | null

Last time this setting was modified.

formatdate-time

CacheOrigin Cloud Regions

List origin cloud region mappings
client.cache.originCloudRegions.list(OriginCloudRegionListParams { zone_id, page, per_page } params, RequestOptionsoptions?): V4PagePaginationArray<OriginCloudRegion { origin_ip, region, vendor, modified_on } >
GET/zones/{zone_id}/origin/cloud_regions
Get an origin cloud region mapping
client.cache.originCloudRegions.get(stringoriginIP, OriginCloudRegionGetParams { zone_id } params, RequestOptionsoptions?): OriginCloudRegion { origin_ip, region, vendor, modified_on }
GET/zones/{zone_id}/origin/cloud_regions/{origin_ip}
Create or replace an origin cloud region mapping
client.cache.originCloudRegions.update(stringoriginIP, OriginCloudRegionUpdateParams { zone_id, origin_ip, region, vendor } params, RequestOptionsoptions?): OriginCloudRegion { origin_ip, region, vendor, modified_on }
PUT/zones/{zone_id}/origin/cloud_regions/{origin_ip}
Delete an origin cloud region mapping
client.cache.originCloudRegions.delete(stringoriginIP, OriginCloudRegionDeleteParams { zone_id } params, RequestOptionsoptions?): OriginCloudRegionDeleteResponse { origin_ip }
DELETE/zones/{zone_id}/origin/cloud_regions/{origin_ip}
Batch create or replace origin cloud region mappings
client.cache.originCloudRegions.bulkUpdate(OriginCloudRegionBulkUpdateParams { zone_id, body } params, RequestOptionsoptions?): OriginCloudRegionBulkUpdateResponse { failed, succeeded }
PUT/zones/{zone_id}/origin/cloud_regions/batch
Batch delete origin cloud region mappings
client.cache.originCloudRegions.bulkDelete(OriginCloudRegionBulkDeleteParams { zone_id } params, RequestOptionsoptions?): OriginCloudRegionBulkDeleteResponse { failed, succeeded }
DELETE/zones/{zone_id}/origin/cloud_regions/batch
List supported cloud vendors and regions
client.cache.originCloudRegions.supportedRegions(OriginCloudRegionSupportedRegionsParams { zone_id } params, RequestOptionsoptions?): OriginCloudRegionSupportedRegionsResponse { obtained_codes, vendors }
GET/zones/{zone_id}/origin/cloud_regions/supported_regions
ModelsExpand Collapse
OriginCloudRegion { origin_ip, region, vendor, modified_on }

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

origin_ip: string

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

region: string

Cloud vendor region identifier.

vendor: "aws" | "azure" | "gcp" | "oci"

Cloud vendor hosting the origin.

One of the following:
"aws"
"azure"
"gcp"
"oci"
modified_on?: string

Time this mapping was last modified.

formatdate-time
OriginCloudRegionDeleteResponse { origin_ip }

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

origin_ip: string

The origin IP address whose mapping was deleted.

OriginCloudRegionBulkUpdateResponse { failed, succeeded }

Response result for a batch origin cloud region operation.

failed: Array<Failed>

Items that could not be applied, with error details.

origin_ip: string

The origin IP address for this item.

error?: string

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

region?: string

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

vendor?: string

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

succeeded: Array<Succeeded>

Items that were successfully applied.

origin_ip: string

The origin IP address for this item.

error?: string

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

region?: string

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

vendor?: string

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

OriginCloudRegionBulkDeleteResponse { failed, succeeded }

Response result for a batch origin cloud region operation.

failed: Array<Failed>

Items that could not be applied, with error details.

origin_ip: string

The origin IP address for this item.

error?: string

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

region?: string

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

vendor?: string

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

succeeded: Array<Succeeded>

Items that were successfully applied.

origin_ip: string

The origin IP address for this item.

error?: string

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

region?: string

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

vendor?: string

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

OriginCloudRegionSupportedRegionsResponse { obtained_codes, vendors }

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

obtained_codes: boolean

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: Record<string, Array<Vendor>>

Map of vendor name to list of supported regions.

name: string

Cloud vendor region identifier.

upper_tier_colos: Array<string>

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.