Skip to content

Assets

Get Tree

GET /api/assets/tree

Returns all the Folder Assets in the tree.

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.

Response

{
    "_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

{
    "_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 all the Assets in the trash folder.

Response

{
  "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

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

{
    "ids": [],
}

Parameter Type Description
ids String (Array) The ids of the assets to download

Response

Returns a ZIP file containing the assets.

Get Asset Thumbnail

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

or

GET /api/assets/browse/thubnail?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?path=/path/to/parent/folder

Creates a new Folder under the Folder Asset provided.

Request

Parameter Type Description
FOLDER ID ASSET ID
NEW FOLDER NAME String

Response

The created Folder Asset

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.

Request Body

FILE

Response

The uploaded Asset

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
NEW NAME String

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
FOLDER ID ASSET ID

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

Response

The deleted Asset

Delete Multiple Assets

POST /api/assets/delete?recursive=true

Deletes multiple assets

Request parameters

Parameter Type Description
recursive Boolean set to true

Request Body

{
   ["ASSET ID", "ASSET ID", "ASSET ID"],
}

Parameter Type Description
Body ASSET ID (Array) The ids of the assets to delete

Response

Success message:

{
    "success": "Deleted (Number of) assets"
}
Error message:
{
    "status": "ERROR",
    "error": Error Message (String)
}

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

Response

The restored Asset

Restore Multiple Deleted Assets

POST /api/assets/restore

Deletes multiple assets

Request Body

{
   ["ASSET ID", "ASSET ID", "ASSET ID"],
}

Parameter Type Description
Body ASSET ID (Array) The ids of the assets to restore

Tags

GET /api/assets/tags

Returns all tags assigned to assets.

Response

Array of Tags (String)

Example Response Body

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