/storage/buckets/{bucketName}/objectsDelete Object
Deletes the object at the path query parameter (a query parameter because paths contain slashes).
Answers with the bucket, the path and deleted: true when an object was removed, false when nothing was there.
Needs delete rights on the bucket; in a custom bucket the storage policy decides.
A system bucket refuses writes.
A deletion is audited as data.write.storage.object.deleted.
| bucketName * | path | The bucket's name. It is unique within the project. |
| path * | query | The path of the object to delete. |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_UNAUTHENTICATED | Authentication is required. |
| 403 | K9O_RBAC_DENY | The caller's project role does not permit this object operation. |
| 403 | K9O_ACCESS_DENIED | The bucket's storage policy does not allow delete for this caller (context.reason storage_policy_denied). Checked after the role and IAM checks; a bucket with no policy is unaffected. |
| 404 | K9O_BUCKET_NOT_FOUND | No bucket with this name exists in the project. |
| data * | object | The result of the delete. |
| bucket * | string | The bucket name. |
| path * | string | The object's path in the bucket. |
| deleted * | boolean | True when an object existed at the path and was deleted; false when there was nothing to delete. |
| meta * | any | Request metadata: cost, timing and correlation ids. |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.from('<collection>').remove()Showing example in TypeScript
{
"data": {
"bucket": "string",
"path": "string",
"deleted": false
}
}