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_ASSETorREAD_WRITE_ASSET
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Integer | Page number to return. Default is 1. |
limit | Integer | Number 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.
| Field | Type | Description |
|---|---|---|
_id | String | Unique identifier of the asset. |
id | String | Unique identifier of the asset (same as _id). |
name | String | Name of the file or folder. |
type | String | folder for folders, or the file type for files (for example image/webp). |
parentFolder | String | ID of the folder that contains the asset. null at the top level. |
link | String | Public URL of the file. Files only. |
Pagination Details
| Field | Type | Description |
|---|---|---|
count | Number | Number of assets returned on this page. |
page | Number | Current page number. |
total | Number | Total number of assets. |