Skip to content

List a folder of a site

GET /v1/sites/{siteId}/files

Lists what a folder of the site holds, in one answer: folders first, then files, each by name, as the panel's File Manager shows them. A folder of more than 5,000 entries lists 5,000 of them, with truncated: true: list the folders inside it instead.

Paths are the site's own: they start with / at the site's folder (where wp-config.php is), and nothing outside it can be reached. A path with . or .. parts, a backslash, a control character or a percent-encoded / or . is refused before anything runs.

Scopes

The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).

sites:files
Files and logins. File Manager, WordPress logins, cron jobs, backup downloads and backup storage. Full access to the sites' code and data.

Path parameters

FieldType and description
siteId Required

string

The site's id.

Query parameters

FieldType and description
path

string Up to 4,096 characters

The folder's path in the site. Left out: the site's own folder (/).

Example request

curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files?path=%2Fwp-content" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN"

Response

200 OK Returns the FileList object in data.

The FileList object's fields 11 fields
FieldType and description
path

string

The folder's path in the site.

entries

array of objects

What the folder holds: folders (and links to folders) first, then the rest, each by name.

name

string

Its name: the last part of its path.

path

string

Its path in the site, from the site's folder (always starts with /).

type

string

file, dir (a folder), link (a symbolic link: see linkTargetType) or other (anything else, like a socket).

Known values: filedirlinkother More can appear.

sizeBytes

integer

Its size, in bytes. For a folder, the size of the folder's own entry, not of what it holds.

modifiedAt

string An ISO 8601 time, in UTC

When it was last changed.

mode

string

Its permissions, as three octal digits: 644 for most files, 755 for folders.

version

string

Changes whenever the file changes. Send it as expectedVersion when writing the file, so a change made by someone else in the meantime isn't overwritten.

linkTargetType

string or null

For a link: what it leads to: file, dir (a folder), or broken (to nothing, or outside the site's folder, where it can't be followed). Null for anything else.

Known values: filedirbroken More can appear.

truncated

boolean

Whether the folder holds more than 5,000 entries, of which only 5,000 are listed (not chosen by name). List the folders inside it instead.

Example response

200 OK
{
  "data": {
    "path": "/wp-content",
    "entries": [
      {
        "name": "plugins",
        "path": "/wp-content/plugins",
        "type": "dir",
        "sizeBytes": 4096,
        "modifiedAt": "2026-11-12T08:03:19.000Z",
        "mode": "755",
        "version": "1794470599000000000:4096",
        "linkTargetType": null
      },
      {
        "name": "themes",
        "path": "/wp-content/themes",
        "type": "dir",
        "sizeBytes": 4096,
        "modifiedAt": "2026-10-30T14:41:02.000Z",
        "mode": "755",
        "version": "1793371262000000000:4096",
        "linkTargetType": null
      },
      {
        "name": "uploads",
        "path": "/wp-content/uploads",
        "type": "dir",
        "sizeBytes": 4096,
        "modifiedAt": "2026-11-18T16:20:45.000Z",
        "mode": "755",
        "version": "1795018845000000000:4096",
        "linkTargetType": null
      },
      {
        "name": "index.php",
        "path": "/wp-content/index.php",
        "type": "file",
        "sizeBytes": 28,
        "modifiedAt": "2026-09-14T10:00:00.000Z",
        "mode": "644",
        "version": "1789380000000000000:28",
        "linkTargetType": null
      }
    ],
    "truncated": false
  }
}

Errors

The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).

Status and codeWhen, and what to do
400 invalid_parameter

A query parameter is unknown or has a wrong value (fields names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.

Correct or remove the parameter named in fields.

400 bad_path

The path isn't one the site's server can use.

Use a path in the site that starts with /, without control characters.

400 not_a_folder

The path is a file, where a folder is needed.

Name a folder.

403 trial_locked

The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.

Keep the server in the control panel: they switch on by themselves.

403 outside_root

The path leads outside the site's folder (through a link), which files can't reach.

Use a path inside the site's folder.

403 permission_denied

The site's server refused access to a file or folder: its permissions don't let the site's own user do this. message names it.

Check its permissions (mode); a file the site's user doesn't own can't be changed. Contact support if you need it changed.

404 not_found

The resource doesn't exist, or isn't this account's.

Check the id. Ids of other accounts' resources answer the same way.

409 site_unavailable

The site isn't in a state that allows this (for example, it's still installing).

Wait until the site is active, then try again.

409 server_unavailable

The server isn't in a state that allows this (for example, it's off or still being set up).

Start the server, or wait until it's active, then try again.

409 server_restoring

The server is being restored, and nothing else can change it or its sites until that's done.

Wait until the restore finishes (the server's pendingAction is null again), then try again. A restore that stopped partway keeps pendingAction: "restore", with the server's lastError set, until our team has checked the server.

422 io_error

The site's server couldn't complete the file operation (its disk or file system refused).

Try again; if it keeps failing (for example, the disk is full), contact support.

502 server_unreachable

The server didn't answer, or didn't finish the request.

Check that the server is running, then try again in a minute.

502 file_error

The site's server didn't complete the file operation.

Try again in a moment.

Rate limit

Heavy requests: 20 a minute per token, 40 per account. More in Rate limits.

Added on .

Popular

API docs