This article describes how to use the Unity Build Automation REST API to batch-delete build artifacts, including those from archived projects.
Symptoms:
- I have a large number of build artifacts, and I need a way to bulk-delete them instead of manually removing them one by one.
- I tried deleting existing builds, but it doesn’t allow me, saying "You are not allowed to perform this operation".
Causes:
- Build artifacts in archived projects cannot be deleted until those projects are unarchived.
- The "You are not allowed to perform this operation" error can occur due to permission or rate-limiting constraints when deleting builds through the standard interface.
Resolution:
To resolve the “You are not allowed to perform this operation” error when deleting builds, instead of deleting builds one by one in the interface, you must use the REST API to batch-delete artifacts.
Here are the steps:
- Ensure any relevant projects are unarchived before deleting their build history.
- Perform a POST request to:
/api/v1/orgs/{ORG_ID}/projects/{PROJECT_ID}/artifacts/delete/?allWithExclusions=true - Replace
ORG_IDandPROJECT_IDwith your actual organization and project identifiers. -
Use a request body similar to:
{ "excludedBuilds": [], "filters": {}, "deleteOnOrBeforeDate": "2026-03-01T18:51:33.412Z" } - Set
deleteOnOrBeforeDateto the desired cutoff date for deletion in ISO 8601 format. - After the API call completes, verify that older build artifacts are removed.
- Re-check the Usage section in the Dashboard to confirm that historical artifacts have been cleared, understanding that no additional bills are generated once the subscription is canceled.
More information:
Unity DevOps Build Automation API reference page.