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

List the files in a folder

Returns one folder of one bucket of one luna: the folders directly under prefix and the files directly in it. Each luna has its own buckets, so you name the luna with key.

GET/_luna/tenants/{tenant}/files/{type}/{bucket}
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:data:read
Path parameters
tenantstringrequired

The tenant, by its name.

typestringrequired

The luna type, by its name.

bucketstringrequired

The bucket, by its name.

Query parameters
keystringrequired

The luna's key as JSON, such as {"id":"a"}. For a type keyed by one field, the value of that field alone also works.

prefixstring

The folder to list, ending with /. The top of the bucket when left out.

cursorstring

The cursor of the last page, to read the next one.

limitinteger<int64>

How many entries to return. 100 when left out.

min 0
Responses
200

The folder's contents.

foldersstring[]required

The folders directly under the prefix, each ending with /.

objectsFileObject[]required

The files directly under the prefix, in path order.

Show properties
Array of FileObject
bucketstringrequired
pathstringrequired
hashstringrequired

The hash of the file's content.

sizeinteger<int64>required

The file's size in bytes.

min 0
contentTypestring | null
metaany

What the app stored beside the file, or null.

createdinteger<int64>required

When the file was first written, in milliseconds since the Unix epoch.

min 0
updatedinteger<int64>required

When the file was last written, in milliseconds since the Unix epoch.

min 0
cursorstring | null

Where the next page starts. Send it back as cursor. It is null on the last page.

default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://luna.example.com/_luna/tenants/string/files/string/string?key=string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "folders": [
    "string"
  ],
  "objects": [
    {
      "bucket": "string",
      "path": "string",
      "hash": "string",
      "size": 0,
      "contentType": "string",
      "meta": null,
      "created": 0,
      "updated": 0
    }
  ],
  "cursor": "string"
}

Was this page helpful?