Purge Cached Content

### Purge All Cached Content Removes ALL files from Cloudflare's cache. All tiers can purge everything. ### Purge Cached Content by URL Granularly removes one or more files from Cloudflare's cache by specifying URLs. All tiers can purge by URL. To purge files with custom cache keys, include the headers used to compute the cache key as in the example. If you have a device type or geo in your cache key, you will need to include the CF-Device-Type or CF-IPCountry headers. If you have lang in your cache key, you will need to include the Accept-Language header. **NB:** When including the Origin header, be sure to include the **scheme** and **hostname**. The port number can be omitted if it is the default port (80 for http, 443 for https), but must be included otherwise. ### Purge Cached Content by Tag, Host or Prefix Granularly removes one or more files from Cloudflare's cache either by specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise customers are permitted to purge by Tag, Host or Prefix. **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or prefixes in one API call. This rate limit can be raised for customers who need to purge at higher volume.

/zones/{identifier}/purge_cache

post

Zone

zone-purge

Debug "planAvailability"

null

Debug "tokenPermissions"

{
  "enum": [
    "#cache_purge:edit"
  ]
}

Debug "parameters"

[
  {
    "in": "path",
    "name": "identifier",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

Debug "requestBody"

{
  "content": {
    "application/json": {
      "schema": {
        "anyOf": [
          {
            "anyOf": [
              {
                "properties": {
                  "tags": {
                    "example": [
                      "some-tag",
                      "another-tag"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              {
                "properties": {
                  "hosts": {
                    "example": [
                      "www.example.com",
                      "images.example.com"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              {
                "properties": {
                  "prefixes": {
                    "example": [
                      "www.example.com/foo",
                      "images.example.com/bar/baz"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              }
            ]
          },
          {
            "properties": {
              "purge_everything": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          {
            "properties": {
              "files": {
                "items": {
                  "anyOf": [
                    {
                      "example": "http://www.example.com/css/styles.css",
                      "type": "string"
                    },
                    {
                      "properties": {
                        "headers": {
                          "example": "{\n    \"Origin\": \"https://www.cloudflare.com\",\n    \"CF-IPCountry\": \"US\",\n    \"CF-Device-Type\": \"desktop\",\n    \"Accept-Language\": \"zh-CN\"\n}",
                          "type": "object"
                        },
                        "url": {
                          "example": "http://www.example.com/cat_picture.jpg",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        ]
      }
    }
  },
  "required": true
}

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "properties": {
                "errors": {
                  "example": [],
                  "items": {
                    "properties": {
                      "code": {
                        "minimum": 1000,
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "uniqueItems": true
                  },
                  "type": "array"
                },
                "messages": {
                  "example": [],
                  "items": {
                    "properties": {
                      "code": {
                        "minimum": 1000,
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "uniqueItems": true
                  },
                  "type": "array"
                },
                "result": {
                  "anyOf": [
                    {
                      "type": "object"
                    },
                    {
                      "items": {},
                      "type": "array"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "success": {
                  "description": "Whether the API call was successful",
                  "enum": [
                    true
                  ],
                  "example": true,
                  "type": "boolean"
                }
              },
              "required": [
                "success",
                "errors",
                "messages",
                "result"
              ],
              "type": "object"
            },
            {
              "properties": {
                "result": {
                  "nullable": true,
                  "properties": {
                    "id": {
                      "description": "Identifier",
                      "example": "023e105f4ecef8ad9ca31a8372d0c353",
                      "maxLength": 32,
                      "readOnly": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "type": "object"
                }
              }
            }
          ],
          "type": "object"
        }
      }
    },
    "description": "Purge Cached Content"
  },
  "4xx": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "properties": {
                    "errors": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "messages": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "result": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "items": {},
                          "type": "array"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "success": {
                      "description": "Whether the API call was successful",
                      "enum": [
                        true
                      ],
                      "example": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "errors",
                    "messages",
                    "result"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "nullable": true,
                      "properties": {
                        "id": {
                          "description": "Identifier",
                          "example": "023e105f4ecef8ad9ca31a8372d0c353",
                          "maxLength": 32,
                          "readOnly": true,
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "type": "object"
                    }
                  }
                }
              ],
              "type": "object"
            },
            {
              "properties": {
                "errors": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": [
                    {
                      "code": 7003,
                      "message": "No route for the URI"
                    }
                  ],
                  "minLength": 1
                },
                "messages": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": []
                },
                "result": {
                  "enum": [
                    null
                  ],
                  "nullable": true,
                  "type": "object"
                },
                "success": {
                  "description": "Whether the API call was successful",
                  "enum": [
                    false
                  ],
                  "example": false,
                  "type": "boolean"
                }
              },
              "required": [
                "success",
                "errors",
                "messages",
                "result"
              ],
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "Purge Cached Content failure"
  }
}

Debug "security"

[
  {
    "api_email": [],
    "api_key": []
  }
]