Bag Docs
API ReferenceUpload

Delete an uploaded file

Deletes a previously uploaded file. You can only delete files within your own merchant directory. Attempting to delete another merchant's files returns 403 Forbidden.

DELETE
/api/upload/{key}
AuthorizationBearer <token>

Privy JWT authentication for dashboard and management endpoints. This is used internally by the Bag Dashboard and is not intended for direct API integrations. Use API keys instead.

In: header

Path Parameters

key*string

The storage key of the file to delete (returned from the upload endpoint).

Response Body

application/json

application/json

application/json

curl -X DELETE "https://api.justusebag.xyz/api/upload/merchants/0x1a2B/company-logo.png"
{
  "status": "success",
  "message": "File deleted"
}
{
  "status": "error",
  "message": "Invalid or revoked API key",
  "code": "UNAUTHORIZED",
  "hint": "Include a valid API key in the Authorization header: Bearer bag_live_sk_..."
}
{
  "status": "error",
  "message": "Cannot delete files outside your directory",
  "code": "FORBIDDEN"
}