Skip to main content
Delete File
Deletes a file record and removes all associated storage objects. For image files, all generated variants are also deleted. Requires authentication. The owner deletes: a file with an owner is deleted only as that user — with their own access token, or with a service key naming them in actingUserId, and the request then runs exactly as theirs (suspension included). An app-owned file (uploaded without an actingUserId) is deleted only by a service key naming nobody; a user token gets 403. Rate limit: 50 requests per 5 minutes.

Path Parameters

string
required
The UUID of the file to delete.

Query Parameters

string
Service key only: the user this delete acts as. Required when the file has an owner: name the owner (naming anyone else gets 403). Leave it out only for an app-owned file. A user token always acts as its own user and must not send it, and neither may a request with no credentials (400 storage/acting-user-not-allowed).

Response

deletedPaths lists all storage paths that were removed, including the original file and any image variants.

Error Responses

Returned when fileId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
Returned when the acting user doesn’t own the file, or when a user token, or a service key naming a user, deletes an app-owned file.
A service key sent no actingUserId for a file that has an owner. Name the owner: the request then runs exactly as their own.
A user token, or a request with no credentials, sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
Returned when a service key names an actingUserId that isn’t a user in this project.