Get your free beta license ↗
API operation · files group
GET

/files/{user}/size

First published 27 Oct 20260.2.18Unchanged since publication

Measure disk usage for a directory or its immediate subdirectories

Who may call it
AdministratorResellerCustomer
Token scope, any of
filesreadall
Answers200 OK

UrbeStack runs du with the customer's permissions on each request and discards the measurements after responding. It measures allocated disk blocks that count toward the account's disk usage, counts each hard-linked file once, stays on the same filesystem, and skips symbolic link targets. If path names a symbolic link, specify the target directory directly.

With inside set to true, the operation measures each immediate subdirectory of path, up to 5000. The du command has 20 seconds to measure disk usage. If time runs out, timed_out is true, folders contains the completed measurements, and unmeasured lists the remaining directories. A directory is marked partial if it contains entries the customer cannot read. Its reported size includes only the blocks that could be counted.

As a command

Run as root on the server

Parameters

userpath ·UsernameRequired
Username of the customer who owns the home directory. Administrators can specify any customer, and customers can specify only themselves.
pathquery ·HomePath
Directory path starting with /. Defaults to /, the customer's home directory.
insidequery ·boolean
Whether to measure each immediate subdirectory instead of path itself. Defaults to false.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X GET "$API/files/alice/size?path=public_html/index.php&inside=1" \
  -H "Authorization: Bearer $TOKEN"
Response · 200 OK
{
  "folders": [
    {
      "bytes": 1,
      "name": "alice",
      "partial": true,
      "path": "public_html/index.php"
    }
  ],
  "inside": true,
  "path": "public_html/index.php",
  "seconds": 1,
  "timed_out": true,
  "unmeasured": [
    {
      "name": "alice",
      "path": "public_html/index.php"
    }
  ],
  "user": "alice"
}

Errors

12 errors, each a status and a sentence
400--user is required
400<name> is an administrator: administrators have no home
400<what> climbs out of the home with ..
400<what> has a name over 255 characters
400<what> holds a control character
400<what> is required
400<what> is too long
400<what> must start with /, which is the home
400Invalid boolean
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Username '<value>' is reserved
401Authentication required
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.18 on 27 Oct 2026.
urbestack.com/docs/api/get-files-user-size/