Skip to main content

Delete a file

POST 

/api/v1/storage/delete-file

Deletes the stored object and tracked file metadata, releasing tracked quota on successful completion. This does not prove removal from backups, invalidate every copied URL immediately, or undo a download already in flight. Reconcile partial failures.

The following access conditions are preserved as declared intent and are not implemented by generated code: Accepted storage owner context, Storage owner actor routing.

Use this in a guide: Build a searchable document library

Request​

Responses​

File deleted

Replace fileId with an existing file returned by upload or listing.​

Section ID: DOC-CP-files-data-api-deleteFile#example-storage-deleteFile-request

Request example

{
"fileId": "0123456789abcdef0123456789abcdef"
}

Guide request for Delete a document the customer no longer needs. Replace example resource identifiers with your own authorized values.​

Section ID: DOC-CP-files-data-api-deleteFile#example-cookbook-core-platform-files-data-managing-06-request

Request example

{
"fileId": "a1b2c3d4e5f60718293a4b5c6d7e8f90"
}

Illustrative response shape; omitted default fields and actual outcomes depend on the operation.​

Section ID: DOC-CP-files-data-api-deleteFile#example-storage-deleteFile-response

Response example

{
"deleted": true,
"spaceFreedBytes": "1"
}

Document ID: DOC-CP-files-data-api-deleteFile. Section identities and revisions.

SectionStable reference
Delete a fileDOC-CP-files-data-api-deleteFile#overview
RequestDOC-CP-files-data-api-deleteFile#request
ResponsesDOC-CP-files-data-api-deleteFile#responses