Delete file
Deletes the object from S3 and decrements the bucket's storageUsedBytes.
The change propagates to the CDN within seconds.
Path parameters
| Name | Type | Default | Description |
|---|---|---|---|
| bucketIdrequired | string | — | The bucket containing the file. |
| pathrequired | string | — | The file's object key. |
Example request
import { Buckt } from "@buckt/sdk";
const client = new Buckt({ apiKey: process.env.BUCKT_API_KEY });
await client.files.delete(
"bkt_01H8XYZABCDEFGHJKMNPQRSTVW",
"images/logo.png"
);
// Returns: { object: "file", id: "images/logo.png" }Responses
{
"data": {
"object": "file",
"id": "images/logo.png"
},
"error": null,
"meta": null
}