Skip to main content

Get All Assets

Retrieves a list of the items in your store's asset library, including both folders and files.

HTTP Request​

  • URL: /asset/all
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_ASSET or READ_WRITE_ASSET

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to return. Default is 1.
limitIntegerNumber of assets per page. Default is 10.

cURL Example​

curl --location '<BASE_URL>/asset/all?page=1&limit=25' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The list of assets was returned successfully.
  • 400 Bad Request: The access token is missing, invalid or lacks the required scope.

Sample JSON Response​

{
"success": true,
"data": [
{
"_id": "664f1e685ef340dfe52581ea",
"id": "664f1e685ef340dfe52581ea",
"name": "products",
"type": "folder",
"parentFolder": null,
"size": 0,
"tags": [],
"assignedProducts": [],
"assignedCategories": [],
"createdAt": "2024-05-23T10:46:00.260Z",
"updatedAt": "2024-09-06T14:06:10.817Z"
},
{
"_id": "6650d4e1a2b3c4d5e6f70812",
"id": "6650d4e1a2b3c4d5e6f70812",
"name": "cordless-drill-18v.webp",
"type": "image/webp",
"parentFolder": "664f1e685ef340dfe52581ea",
"link": "https://cdn.example.com/assets/products/cordless-drill-18v.webp",
"key": "assets/products/cordless-drill-18v.webp",
"size": 48213,
"title": "Cordless drill 18V",
"altText": "18V cordless drill with battery pack",
"tags": ["drills", "power-tools"],
"assignedProducts": ["65f1c9a2b7e4d3a1c2f00a11"],
"assignedCategories": [],
"createdAt": "2024-05-24T09:12:33.410Z",
"updatedAt": "2024-09-06T14:06:10.817Z"
}
],
"pagination": {
"count": 2,
"page": 1,
"total": 2
}
}

Response Details​

Asset Data​

Each item in data is an asset. See Get Asset by ID for the full list of asset fields.

FieldTypeDescription
_idStringUnique identifier of the asset.
idStringUnique identifier of the asset (same as _id).
nameStringName of the file or folder.
typeStringfolder for folders, or the file type for files (for example image/webp).
parentFolderStringID of the folder that contains the asset. null at the top level.
linkStringPublic URL of the file. Files only.

Pagination Details​

FieldTypeDescription
countNumberNumber of assets returned on this page.
pageNumberCurrent page number.
totalNumberTotal number of assets.