OpenFolia

Delete an unused file

DELETE
/assets/{hash}

Deletes a file nobody uses, with its renditions and its upload records, from the blob store, recorded with an asset.delete audit event. Unused, checked again right before deleting: no module file refers to it at main, any other branch that is not a change set’s, any tag, the head of any open change set, or any working copy, and it is not an import’s uploaded bundle while that import is kept, nor an image uploaded for the branding, nor an archived release PDF (a done release output’s file) no upload records; its last upload (into any change set) or its storing is more than 24 hours ago; and it is not itself a rendition. Otherwise 409 asset-in-use with meta.usedIn: the places ({ in: "main" | "release", ref }, or { in: "branch" | "change-set" | "working-copy" | "import" | "branding" | "release-output" | "recent-upload" | "rendition" }, at most 50), and meta.deletableAt for a recent upload. Deleting the uploads of an archived release PDF’s bytes keeps the file; the audit event says so (fileKept: true). The same rules hold for attachments. Needs content.read.draft and content.edit, each in a role whose scope restricts nothing (403 otherwise).

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Path Parameters

hash*string

SHA-256 of the file, 64 lowercase hex characters.

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Response Body

Deleted.

Example Request
curl -X DELETE 'http://localhost:3000/assets/string'
Example Response
Empty