Skip to content

Assets

Get Tree

GET /api/assets/tree

Returns all the Folder Assets in the tree, as an object keyed by folder id rather than an array.

Request

Parameter Type Description
resolvePath Boolean (query) Add namedPath, the folder path written with names instead of ids, to each folder

Get Files in Folder

GET /api/assets/[FOLDER ID]/files

or

GET /api/assets/browse/files?path=/path/to/asset

Returns the targeted asset with all the child the Assets of type FILE.

Request

Parameter Type Description
resolvePath Boolean (query) Add namedPath, the path written with names instead of ids, to the folder and to each file

Response

Each asset also carries a transient url that can be used to fetch it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
    "_id": "606b741a6c0c5a1108243535",
    "size": 1382820,
    "tags": [],
    "name": "myFolder",
    "type": "FOLDER",
    "parent": "000000000000000000000000",
    "path": "/",
    "meta": {},
    "log": [],
    "files": [
      {
          "_id": "618177b196a13f164c879563",
          "size": 135334,
          "tags": [],
          "name": "sample.png",
          "type": "FILE",
          "mediaType": "IMAGE",
          "parent": "606b741a6c0c5a1108243535",
          "path": "/606b741a6c0c5a1108243535/618177b196a13f164c879563",
          "meta": {
            "content-type": "image/png",
            "has-alpha": false,
            "height": 1110,
            "width": 1834
          },
          "log": [],
          "createdAt": "2021-01-01T12:00:00.000Z",
          "updatedAt": "2021-01-01T12:00:00.000Z",
          "expiry": "2021-01-01T12:00:00.000Z",
      }
    ],
    "createdAt": "2021-01-01T12:00:00.000Z",
    "updatedAt": "2021-01-01T12:00:00.000Z",
    "expiry": "2021-01-01T12:00:00.000Z",
}

Info

You can use "root" or "hub" as the folder ID to get the files in the root folder

Request

Parameter Type Description
FOLDER ID ID Uuid or the name of the Folder

Response

Array of Assets

Get Folders in Folder

GET /api/assets/[FOLDER ID]/folders

or

GET /api/assets/browse/folders?path=/path/to/folder

Returns all the Assets of type FOLDER in the folder.

Request

Parameter Type Description
FOLDER ID ID Uuid or the name of the Folder

Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
    "_id": "606b741a6c0c5a1108243535",
    "size": 1382820,
    "tags": [],
    "name": "myFolder",
    "type": "FOLDER",
    "parent": "000000000000000000000000",
    "path": "/",
    "meta": {},
    "log": [],
    "files": [],
    "folders": [
      {
          "_id": "618177b196a13f164c879563",
          "size": 0,
          "tags": [],
          "name": "myChildFolder",
          "type": "FOLDER",
          "parent": "606b741a6c0c5a1108243535",
          "path": "/606b741a6c0c5a1108243535/",
          "meta": {},
          "log": [],
          "createdAt": "2021-01-01T12:00:00.000Z",
          "updatedAt": "2021-01-01T12:00:00.000Z",
      }
    ],
    "createdAt": "2021-01-01T12:00:00.000Z",
    "updatedAt": "2021-01-01T12:00:00.000Z",
    "expiry": "2021-01-01T12:00:00.000Z",
}

Get Files in the Trash Folder

GET /api/assets/trash/files

Returns the Assets in the trash folder, newest deletion first.

Request

Parameter Type Description
limit Number (query) How many files to return. Default 50
skip Number (query) How many files to skip

Two more routes answer with the same shape and take the same parameters:

Route Returns
GET /api/assets/recent/files The most recently created files, newest first
GET /api/assets/favorites/files The files marked as favourites

GET /api/assets/trash/clear empties the Trash permanently.

Response

The wrapper is a synthetic folder: _id is the literal trash, recent or favorites, name is its display name, path is : and type is FOLDER. The assets are in files.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "files": [
    {
        "_id": "6181685996a13f164c8794e7",
        "size": 135334,
        "tags": [],
        "name": "sample.png",
        "type": "FILE",
        "mediaType": "IMAGE",
        "parent": "fffffffffffffffffffffffe",
        "path": "/fffffffffffffffffffffffe/",
        "originalPath": "/618177b196a13f164c879563/sample.jpg",
        "meta": {
          "content-type": "image/jpeg",
          "has-alpha": false,
          "height": 1110,
          "width": 1834
        },
        "log": [],
        "createdAt": "2021-01-01T12:00:00.000Z",
        "updatedAt": "2021-01-01T12:00:00.000Z",
        "deleted": "2021-01-01T12:00:00.000Z",
    }
  ],
}

Get Asset

GET /api/assets/[ASSET ID]

or

GET /api/assets/browse?path=/path/to/asset

Returns the Assets.

Request

Parameter Type Description
ASSET ID ID Uuid of the Asset

Response

Asset

Download Asset

GET /api/assets/[ASSET ID]/download

or

GET /api/assets/browse/download?path=/path/to/asset

Returns the file.

Request

Parameter Type Description
ASSET ID ID Uuid of the Asset
file Boolean (query) Stream the raw file. Without it, a folder is returned as a ZIP archive

The response supports HTTP Range requests, so a player can seek inside a video without downloading the whole file.

GET /api/assets/[ASSET ID]/raw is the same request without the Content-Disposition attachment header, for streaming an asset into a page rather than saving it.

Response

File

Download Multiple Assets

POST /api/assets/batch/download

You can use this API request to download multiple asset files. The request returns a ZIP file.

Request Body

A JSON array of asset ids or paths:

1
["ASSET ID", "ASSET ID"]

The body may also be wrapped in an object, which is equivalent:

1
2
3
{
    "ids": ["ASSET ID", "ASSET ID"]
}
Parameter Type Description
ids String (Array) The ids or paths of the assets to download. An empty list downloads everything at the root of the hub

Response

Returns a ZIP file containing the assets.

Get Asset Thumbnail

GET /api/assets/[ASSET ID]/thumbnail

or

GET /api/assets/browse/thumbnail?path=/path/to/asset

Returns a small resolution of the original file. If the asset is a video, a snapshot image will be returned.

Request

Parameter Type Description
ASSET ID ID Uuid of the Asset

Response

Image File

Create a Folder

GET /api/assets/[FOLDER ID]/createfolder/[NEW FOLDER NAME]

or

GET /api/assets/browse/createfolder/[NEW FOLDER NAME]?path=/path/to/parent/folder

Creates a new Folder under the Folder Asset provided.

The new folder's name is always a path segment. It cannot be moved into the query string, so the browse form keeps /[NEW FOLDER NAME] after createfolder and uses path only for the parent folder.

Request

Parameter Type Description
FOLDER ID ASSET ID Uuid of the parent Folder
NEW FOLDER NAME String The name of the new folder

Response

The created Folder Asset

If the parent folder already has a folder of that name, that existing folder is returned and nothing is created.

Upload Asset

POST /api/assets/[FOLDER ID]/upload

or

POST /api/assets/browse/upload?path=/path/to/parent/folder

Uploads the asset to the folder that corresponds to the folder ID provided. The request is multipart/form-data; the name of the file part does not matter.

Request

Parameter Type Description
overwrite Boolean (query) Replace an existing file of the same name in the folder. Without it, a name already in use is an error
fields JSON (query) Extra Asset properties to store with the upload, such as tags or expiry. URL-encode the JSON

Request Body

FILE

Response

The uploaded Asset

Thumbnails and previews are generated after the response is sent, so the returned asset may not have them yet.

Rename an Asset

GET /api/assets/[ASSET ID]/rename/[NEW NAME]

or

GET /api/assets/browse/rename/[NEW NAME]?path=/path/to/asset

Renames the asset.

Request

Parameter Type Description
ASSET ID ASSET ID Uuid of the Asset
NEW NAME String The new name of the asset

Response

The updated Asset

Move an Asset

GET /api/assets/[ASSET ID]/move/[FOLDER ID]

Moves the asset to the destination folder

Request

Parameter Type Description
ASSET ID ASSET ID Uuid of the Asset
FOLDER ID ASSET ID Uuid of the destination folder

Response

The moved Asset

Delete an Asset

DELETE /api/assets/[ASSET ID]

Moves the assets that corresponds to the asset ID to the Trash folder.

Request

Parameter Type Description
ASSET ID ASSET ID Uuid of the Asset
recursive Boolean (query) Allow deleting a folder that is not empty
force Boolean (query) Delete permanently instead of moving to the Trash

Response

The deleted Asset

Errors

Error Cause
Folder is not empty The asset is a folder with children and recursive was not set
Can't delete root folder The asset is the root folder

Delete Multiple Assets

POST /api/assets/batch/delete

Moves several assets to the Trash in one request.

Request parameters

Parameter Type Description
recursive Boolean (query) Allow deleting folders that are not empty
force Boolean (query) Delete permanently instead of moving to the Trash

Request Body

A JSON array of asset ids or paths:

1
["ASSET ID", "ASSET ID", "ASSET ID"]

The body may also be wrapped in an object, which is equivalent:

1
2
3
{
    "ids": ["ASSET ID", "ASSET ID"]
}
Parameter Type Description
Body ASSET ID (Array) The ids or paths of the assets to delete

Response

The response is always 200, even when some assets could not be deleted. Both keys may be present at once:

1
2
3
4
{
    "success": "Deleted 3 assets",
    "error": "Failed to delete 1 asset"
}
Parameter Type Description
success String Present when at least one asset was deleted
error String Present when at least one asset could not be deleted. The individual reasons are not reported

Restore a Deleted Asset

GET /api/assets/[ASSET ID]/restore

Restores an asset that was deleted back to it's original path.

Request

Parameter Type Description
ASSET ID ASSET ID Uuid of the Asset
target String (query) Restore into this folder path instead of the asset's original path. Folders on the path that do not exist are created

Response

The restored Asset

Check for Restore Conflicts

POST /api/assets/restore/conflicts

Reports, for each asset that would be restored, whether a file already exists at its destination. Call this before Restore Multiple Deleted Assets so the operator can choose what to overwrite.

Request

Parameter Type Description
target String (query) The destination folder path. Leave it out to check against each asset's original path

Request Body

1
["ASSET ID", "ASSET ID"]

Response

One entry per asset in the deleted subtrees, not only per id in the request.

1
2
3
4
5
6
7
[
    {
        "_id": "606b741a6c0c5a1108243535",
        "name": "asset.jpg",
        "hasConflict": true
    }
]
Parameter Type Description
_id String The id of the deleted asset
name String Its name
hasConflict Boolean true when a file of the same name already exists at the destination. Folders never conflict

Restore Multiple Deleted Assets

POST /api/assets/restore

Restores several deleted assets in one request.

Request

Parameter Type Description
target String (query) Restore into this folder path instead of each asset's original path. Folders on the path that do not exist are created

Request Body

1
2
3
4
{
    "assets": ["ASSET ID", "ASSET ID"],
    "resolved": ["ASSET ID"]
}
Parameter Type Description
assets ASSET ID (Array) The ids of the assets to restore. Everything under a restored folder is restored with it
resolved ASSET ID (Array) Optional. When given, only the assets listed here are actually restored - use it to pass back the subset the operator confirmed after Check for Restore Conflicts. When it is empty or left out, everything under assets is restored

Response

The response is always 200, even when some assets could not be restored. Both keys may be present at once:

1
2
3
4
{
    "success": "Restored 2 assets",
    "error": "Failed to restore 1 asset"
}

Tags

GET /api/assets/tags

Returns all tags assigned to assets.

Response

Array of Tags (String)

Example Response Body

1
["Tag One", "Tag Two", "Tag Three"]

Update an Asset

PUT /api/assets/[ASSET ID]

Updates the asset's stored properties. The body is a partial Asset; name, tags, expiry and meta are the ones an integration normally sets.

Response

The updated Asset

Move or Copy Multiple Assets

POST /api/assets/batch/move/[TARGET FOLDER]
POST /api/assets/batch/copy/[TARGET FOLDER]

Moves or copies several assets into a destination folder in one request. TARGET FOLDER is an asset id, or browse with ?path= as described under Asset ID or Path.

Request Body

A JSON array of asset ids or paths, or { "ids": [...] }.

Response

1
2
3
4
{
    "assets": [],
    "errors": []
}

Get the whole Subtree of a Folder

GET /api/assets/[FOLDER ID]/subtree

Returns every asset under the folder, at any depth, as a flat array.

Parameter Type Description
resolvePath Boolean (query) Add namedPath to each asset

Get an Asset Preview

GET /api/assets/[ASSET ID]/preview

Returns the generated preview media for the asset - a lower-resolution proxy of a video, for example. Supports HTTP Range requests. 404 when no preview has been generated.

List all Files

GET /api/assets

Returns a flat list of every asset of type FILE, regardless of folder. Supports the list query parameters. GET /api/assets/info returns { "count": n } for the same filter.

Get the Asset Chain for a Path

GET /api/assets/path/[PATH]

Returns the array of assets making up the path, from the root down to the asset itself. Use it to build a breadcrumb trail. A path that does not resolve answers 404.

Create a Folder Chain

POST /api/assets/ensure

Creates every folder on a path that does not exist yet, and returns the deepest folder. Folders that already exist are left alone.

Request Body

1
2
3
{
    "path": "hub/News/2026/Openers"
}

Find Duplicate Files

GET /api/assets/duplicates

Returns the files that share the same content hash and size, grouped so that each entry is one set of duplicates with its count and the matching assets.

Get Information about Multiple Assets

POST /api/assets/batch/info

Returns a summary of the listed assets. The body is a JSON array of asset ids or paths, or { "ids": [...] }.

Response

1
2
3
4
5
6
{
    "title": "",
    "size": 0,
    "files": 0,
    "folders": 0
}