{
  "openapi": "3.0.4",
  "info": {
    "title": "Cache API",
    "description": "Use the XM Cloud Content Cache API to clear parts of the cache for GraphQL requests. This REST API lets you clean up a cache for a specific tenant. It is rate limited to 10 requests per second per tenant.\n{% admonition type=\"warning\" name=\"Warning\" %}Clearing the cache can have a negative effect on the performance of the tenant application because all GraphQL requests must be executed fully. We recommend that you do not clear the caches or call this API as part of a build process.{% /admonition %}\n## Authentication\nTo use this API, you need:\n - The URL of your XM Cloud Content server. You can get this from your XM Cloud Administer.\n - A JWT bearer token requested using the [OAuth Client Credentials flow](https://doc.sitecore.com/xmc/en/developers/xm-cloud/request-a-jwt-for-experience-edge.html). It is sent with every request. The token must include the `cs:all:admin` scope.\n",
    "version": "2.0",
    "x-metadata": {
      "product": "SitecoreAI Content"
    },
    "license": {
      "name": "closed source",
      "url": "https://www.sitecore.com"
    }
  },
  "servers": [
    {
      "url": "https://cs-graphqlapi-prod.sitecorecloud.io"
    }
  ],
  "tags": [
    {
      "name": "Cache",
      "description": "Caching improves performance. Periodically, however, you need to clear parts of the cache for GraphQL requests.\n"
    }
  ],
  "paths": {
    "/api/v2/cache/{branch}": {
      "delete": {
        "tags": [
          "Cache"
        ],
        "summary": "Clear the cache for a specific branch",
        "description": "Clears the cache for a specific branch.\n",
        "operationId": "ClearAll",
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "description": "The name of the branch to clear.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The cache was successfully cleared"
          },
          "400": {
            "description": "Invalid input, such as missing the branch name in the URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Invalid bearer token"
          },
          "403": {
            "description": "Insufficient scopes in bearer token"
          },
          "404": {
            "description": "The branch was not found"
          }
        }
      }
    },
    "/api/v2/cache/{branch}/contenttype/{contentType}": {
      "delete": {
        "tags": [
          "Cache"
        ],
        "summary": "Clear cache query responses for a specific content type",
        "description": "Clears the cache of query responses that use a particular content type.\n",
        "operationId": "ClearByContentType",
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "description": "The name of the branch to clear.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contentType",
            "in": "path",
            "description": "The ID of the content type to clear.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The cache was successfully cleared"
          },
          "400": {
            "description": "Invalid input, such as missing the branch name in the URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Invalid bearer token"
          },
          "403": {
            "description": "Request does not contain required scopes"
          },
          "404": {
            "description": "The branch or content type was not found."
          }
        }
      }
    },
    "/api/v2/cache/{branch}/locale/{locale}": {
      "delete": {
        "tags": [
          "Cache"
        ],
        "summary": "Clear cache query responses for a specific locale",
        "description": "Clears the cache of query responses that use a particular locale.\n",
        "operationId": "ClearByLocale",
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "description": "The name of the branch to clear.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "path",
            "description": "The culture code, for example `en-US`, for which to clear queries.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The cache was successfully cleared"
          },
          "400": {
            "description": "Invalid input, such as missing the branch name in the URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Invalid bearer token"
          },
          "403": {
            "description": "Request does not contain required scopes"
          },
          "404": {
            "description": "The branch or content type was not found"
          }
        }
      }
    },
    "/api/v2/cache/{branch}/contenttype/{contentType}/locale/{locale}": {
      "delete": {
        "tags": [
          "Cache"
        ],
        "summary": "Clear cache query responses for a specific content type and locale",
        "description": "Clears the cache of query responses that use a particular content type and locale.\n",
        "operationId": "ClearByContentTypeAndLocale",
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "description": "The name of the branch to clear.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contentType",
            "in": "path",
            "description": "The ID of the content type to clear.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "path",
            "description": "The culture code, for example `en-US`, for which to clear queries.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The cache was successfully cleared"
          },
          "400": {
            "description": "Invalid input, such as the branch name missing in the URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Invalid bearer token"
          },
          "403": {
            "description": "Request does not contain required scopes"
          },
          "404": {
            "description": "The branch or content type was not found"
          }
        }
      }
    },
    "/api/v2/cache/{branch}/other": {
      "delete": {
        "tags": [
          "Cache"
        ],
        "summary": "Clear cache query responses that use other types of data",
        "description": "Clears the cache of query responses that use other types of data (not related to content types), such as taxonomies.\n",
        "operationId": "ClearOthers",
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "description": "The name of the branch to clear.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The cache was successfully cleared"
          },
          "400": {
            "description": "Invalid input, such as missing the branch name in the URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Invalid bearer token"
          },
          "403": {
            "description": "Insufficient scopes in bearer token"
          },
          "404": {
            "description": "The branch or content type was not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HttpValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": {}
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "A JSON Web Token (JWT) is sent with every call. To obtain one, you need an [access token and the client\n        ID](https://doc.sitecore.com/xmc/en/developers/xm-cloud/generate-an-edge-token.html).\n        You can create a token [using the Deploy REST API or by requesting one\n        to the API\n        itself](https://doc.sitecore.com/xmc/en/developers/xm-cloud/request-a-jwt-for-experience-edge.html).",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ]
}