List, read, download, copy, and delete the files in a bucket.

The file object

{
  "type": "file",
  "bucket": "01m3c081d2wj4g63qcr53pa1yh",
  "key": "2026/0001.pdf",
  "size": 48213,
  "contentType": "application/pdf",
  "etag": "5d41402abc4b2a76b9719d911017c592",
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "createdAt": "2026-09-26T09:30:00Z",
  "updatedAt": "2026-09-26T09:30:00Z"
}
typestring

file. In lists, folders have folder.

bucketstring

The ID of the bucket that holds it.

keystring

Its name and place in the bucket, up to 1,024 bytes.

sizeinteger

Its size in bytes, as stored.

contentTypestring

Its media type, from the upload. application/octet-stream when none was given.

etagstring

Changes whenever the file’s contents change.

publicUrlstring

Only in public buckets. The file’s permanent public address.

sha256string

The SHA-256 digest sent with the upload, in hexadecimal. Left out when none was sent.

createdAtstring

When a file was first stored at this key.

updatedAtstring

When the file at this key was last replaced.

List files

GET/v1/projects/{project}/buckets/{bucket}/objects

Returns files in key order, a page at a time. Needs Storage files: View and download.

prefixstring

Only keys that start with this, such as 2026/.

delimiterstring

/ to list one folder level. Keys below it are grouped into one entry each, with the size of every file inside it: { "type": "folder", "prefix": "2026/03/", "size": 48213 }.

limitinteger

1 to 1,000 entries a page. 100 when you leave it out.

cursorstring

meta.page.nextCursor from the previous page.

Read a file

GET/v1/projects/{project}/buckets/{bucket}/objects/{key}

Returns the file object, not its contents. Needs Storage files: View and download.

POST/v1/projects/{project}/buckets/{bucket}/downloads
{ "key": "2026/0001.pdf", "attachment": true }

Returns a link to fetch the file with, which works for 15 minutes. Needs Storage files: View and download.

keystringRequired

The file’s key.

attachmentboolean

true to save the file under its name, false to let a browser show it. true when you leave it out, or false with a preset.

presetstring

A preset to resize an image to, such as thumb.

The answer:

{
  "method": "GET",
  "url": "https://files.digitospace.com/s/…/0001.pdf",
  "headers": {},
  "expiresAt": "2026-09-26T10:15:00Z"
}

Copy a file

POST/v1/projects/{project}/buckets/{bucket}/copies
{ "key": "2026/0001.pdf", "toBucket": "archive", "toKey": "2026/0001.pdf" }

Returns 201 with the new file. Needs Storage files: Upload. toBucket is another bucket in the project, by name or ID, and the same bucket when you leave it out. A file already at toKey is replaced. A copy that does not fit in the project’s storage gets 403 with storage_quota_reached.

Delete a file

DELETE/v1/projects/{project}/buckets/{bucket}/objects/{key}

Returns 204. Needs Storage files: Delete. This cannot be undone.

Create a folder

POST/v1/projects/{project}/buckets/{bucket}/folders
{ "path": "2026/invoices" }

Returns 201 with the folder, { "type": "folder", "prefix": "2026/invoices/" }. Needs Storage files: Upload.

Folders also appear on their own when you upload a file into them. Create one to show an empty folder in lists before it holds any files. Creating a folder that already exists returns it again.

Delete a folder

DELETE/v1/projects/{project}/buckets/{bucket}/folders/{path}

Returns 204, and removes the folder and any empty folders inside it. Needs Storage files: Delete. A folder that still holds files gets 409 with folder_not_empty.

Last updated