---
title: "Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```\"/*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern."
method: POST
path: "/v2/accounts/{accountId}/cache/reset"
tags: ["Cache"]
---

# Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. \*Warning:\* Resetting the permanent cache (by setting \`\`\`resetPermanentCache: true\`\`\`) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. \*Recommended:\* Prevent cache resets by adding a \`\`\`?v=<etag>\`\`\` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The \`etag\` field is returned by GetFileDetails and all upload operations, and can be saved to your database. \*Example patterns:\* - \`\`\`"/\*"\`\`\` - \`\`\`"/raw/example.jpg"\`\`\` - \`\`\`"/image/example.jpg"\`\`\` - \`\`\`"/image/customers/abc/\*"\`\`\` You may only use \`\`\`\*\`\`\` at the end of the pattern. You must not include your account ID prefix in the pattern.

`POST /v2/accounts/{accountId}/cache/reset`

## Request

- Base URL: `https://api.bytescale.com`
- URL: `https://api.bytescale.com/v2/accounts/{accountId}/cache/reset`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/bytescale/apis/bytescale-api/docs/v2/accounts/:accountId/cache/reset/post.ts> (a function with typed inputs; its response is checked against the schema)

Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account.

You can choose to reset the edge cache, or permanent cache, or both caches.

*Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request.

*Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database.

*Example patterns:*

- ```"/*"```
- ```"/raw/example.jpg"```
- ```"/image/example.jpg"```
- ```"/image/customers/abc/*"```

You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.

## Path parameters

- `accountId` string, required: Your account ID. This is visible on the settings page: https://www.bytescale.com/dashboard/settings

## Request body

- ResetCacheRequest: Request body for ResetCache. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```"/*"``` - ```"/raw/example.jpg"``` - ```"/image/example.jpg"``` - ```"/image/customers/abc/*"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
  - `pattern` string, required: The URL pattern to reset the cache for, excluding the account ID, but including the delivery method prefix (e.g. "raw", "image", etc.). May end with a `*` to indicate that all files with this prefix are to be removed from the cache. Specify `/*` to reset your entire cache.
  - `resetEdgeCache` boolean, required: If `true` then resets the edge cache for the location(s) specified by `pattern`.
  - `resetPermanentCache` boolean, required: If `true` then resets the permanent cache for the location(s) specified by `pattern`.

## Response `200`

Success.

- AsyncResponse: Response body from an API endpoint that performs work asynchronously (i.e. does not complete the work immediately).
  - `jobDocs` 'https://www.bytescale.com/docs/job-api/GetJob', required: Link to the documentation that describes how to get a job's status from its job ID.
  - `jobId` string, required: Job ID.
  - `jobType` 'ProcessImageJob' | 'ProcessVideoJob' | 'ProcessAudioJob' | 'AntivirusJob' | 'ResetCacheJob' | 'DeleteFolderBatchJob' | 'DeleteFileBatchJob' | 'CopyFolderBatchJob' | 'CopyFileBatchJob', required: Job type.
  - `jobUrl` string, required: URL for the job's status. You can `GET` this URL to retrieve the job's status. You must authorize your `GET` request with a ```secret_*``` API key when accessing the URL.

## Other responses

- `401`: Unauthenticated.
- `403`: Unauthorized.

## Changes

- **2026-09-01** `d63ecdd9ae9c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bytescale/apis/bytescale-api/changes/v2/accounts/:accountId/cache/reset/post.md)

---

[API](https://skmtc.dev/bytescale/apis/bytescale-api.md) - [All operations](https://skmtc.dev/bytescale/apis/bytescale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bytescale/apis/bytescale-api/revisions/d63ecdd9ae9c?raw)
