Skip to content
sproutboatDocs
Esc
↑↓navigate↵open⌘Jpreview

Delete an object

Deleting a key that does not exist is not an error, as in R2.

DELETE/v1/apps/{project}/r2/{bucket}/objects/{key}
Authorization
AuthorizationBearer token · headerrequired

A team API key, sbk_..., from Settings, API keys.

or
x-api-keyAPI key · headerrequired

The same key, in a header of its own.

Path parameters
projectstringrequired

The app's name, unique within the team. 3 to 51 characters (or 1), lowercase letters, digits and dashes, not starting or ending with a dash.

matches ^[a-z0-9](?:[a-z0-9-]{1,49}[a-z0-9])?$
bucketstringrequired

The R2 binding name from the app's config, for example FILES.

keystringrequired

The object key, the rest of the path after /objects/. It spans path segments: each / in the key is a literal / in the URL (assets/logo.png is /objects/assets/logo.png), and every segment is percent-encoded on its own. A key is 1 to 1024 bytes of UTF-8 with no control character, backslash, empty segment or . or .. segment; a percent-encoded dot, slash or backslash in the path is refused (400 invalid, path: key). OpenAPI has no way to mark a path parameter as spanning segments (allowReserved is formally for query parameters); a generator that does not read it as such needs a rest-of-path label ({key+}) for this one parameter.

min length 1
Responses
200

Deleted.

keystring
deletedboolean
400

The request is malformed. path names the field when one is at fault; some refusals (a digest mismatch, a body that is not JSON) carry a message only.

One of:
ErrorInvalid
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:invalid
ErrorPlain
errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
401

No key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.

errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
403

The key lacks a grant (reason: forbidden, need: "<resource>:<action>").

errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:forbidden
needstringrequired

The grant, as <resource>:<action>, for example app:write.

404

No such app (message only), database (no-database), bucket (no-bucket) or object (no-object).

One of:
ErrorNoDatabase
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:no-database
ErrorNoBucket
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:no-bucket
ErrorNoObject
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:no-object
ErrorPlain
errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
429

Data routes: too many requests in flight or an empty bucket (rate; note retry_after, without _s), or key-rate-limited. Honor Retry-After.

One of:
ErrorKeyRateLimited
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:key-rate-limited
retry_after_sintegerrequired

Seconds to wait; also the Retry-After header.

ErrorRate
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:rate
retry_afterintegerrequired

Seconds to wait; also the Retry-After header.

502

The host agent answered something the Cloud could not handle (reason: agent-error).

errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:agent-error
503

The app's host is not reachable (host-unavailable), is busy with the app's data (busy, Retry-After), or the audit log could not record the request (audit-unavailable). Retry shortly.

One of:
ErrorHostUnavailable
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:host-unavailable
ErrorBusy
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:busy
retry_afterintegerrequired

Seconds to wait; also the Retry-After header.

ErrorAuditUnavailable
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:audit-unavailable
504

The host did not answer in time (reason: timeout). committed says whether a write may have been applied.

errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:timeout
committedstringrequired
Allowed:nounknown
Request
curl -X DELETE 'https://dash.sproutboat.com/v1/apps/my-app/r2/string/objects/assets%2Flogo.png' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "key": "string",
  "deleted": true
}