Skip to content

Get storage usage of a folder

GET
/drives/{drive}/nodes/{node}/stats
curl --request GET \
--url https://work.optidata.cloud/api/drives/1/nodes/300754/stats \
--header 'Authorization: Bearer <token>'

How much the subtree under a folder holds, broken down by MIME type. Requires view on the node.

drive
required
integer format: int64

Numeric id of the drive. Read it from GET /drives/config.json.

node
required
integer format: int64

Numeric id of the node (file or folder).

Usage of the subtree.

Media typeapplication/json
object
nodes_count
integer
total_size_bytes
integer format: int64
usage_by_mime_type
Array<object>
object
mime_type
string | null
nodes_count
integer
folders
integer
files
integer
total_size_bytes
integer format: int64
key
additional properties
any
Examples
Exampleusage
{
"nodes_count": 141,
"total_size_bytes": 20481923,
"usage_by_mime_type": [
{
"mime_type": "application/pdf",
"nodes_count": 82,
"folders": 0,
"files": 82,
"total_size_bytes": 18201220
}
]
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller lacks the permission level the operation requires.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The resource does not exist, or does not belong to the given drive.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Node] 99999999"
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}