Skip to content

Instantly share code, notes, and snippets.

@benjamincharity
Created March 3, 2017 16:44
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save benjamincharity/e0f98c006750d6eb5c10a1b7f67e8d50 to your computer and use it in GitHub Desktop.
Save benjamincharity/e0f98c006750d6eb5c10a1b7f67e8d50 to your computer and use it in GitHub Desktop.
Clear the cache for a CircleCI project.
curl -X DELETE https://circleci.com/api/v1/project/:username/:project/build-cache?circle-token=:token
@gazpachu
Copy link

gazpachu commented Aug 9, 2023

Update on this:

Thanks for contacting CircleCI Support!

This endpoint is actually for V1 builds. The delete project cache endpoint that is referenced in the API documentation for V1 has been deprecated and removed:
https://circleci.com/docs/api/v1/index.html#circleci-v1-api-overview

Caches can not be cleared. To rebuild your caches, you can add a versioning key to your cache key template - kindly see the article below for some additional details about this:
Clear Project Dependency Cache

Another approach your team can explore is the retention period for your caches by navigating to the Usage Control section of your Plan page. Some additional caching strategies we suggest can be found in this section of our documentation.

Lastly, the documentation for the current version of CircleCI's API (v2) can be found at the following page:
https://circleci.com/docs/api/v2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment