Skip to main content

Retrieve all assets

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint

/o/content/assets

Overview

Lists uploaded assets and their metadata for the selected app.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

  • Required permission: Read on the content feature

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key for authentication
auth_tokenStringYes (or api_key)Auth token for authentication
app_idStringYesApplication identifier

Examples

Example 1: List Assets

/o/content/assets?api_key=YOUR_API_KEY&app_id=5be987d7b93798516eb5289a

Response

Success Response

[
{
"_id": "507f1f77bcf86cd799439011",
"filename": "banner_image.jpg",
"app_id": "5be987d7b93798516eb5289a",
"uploadDate": 1567474533960,
"length": 1024000,
"metadata": {
"thumbnail": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"mimeType": "image/jpeg",
"dimensions": {
"width": 1920,
"height": 1080
},
"tags": ["campaign", "banner"]
}
}
]

Response Fields

FieldTypeDescription
_idStringAsset ObjectID
filenameStringAsset filename
app_idStringApplication identifier
uploadDateNumberUpload timestamp in milliseconds
lengthNumberFile size in bytes
metadataObjectFile metadata
metadata.thumbnailStringBase64 thumbnail
metadata.mimeTypeStringMIME type
metadata.dimensionsObjectSource dimensions (width, height)
metadata.tagsArrayTags list

Error Responses

HTTP StatusResponse
500"Error"

Behavior

  • Requires Read permission on the content feature.
  • Dispatches from /o/content/assets based on the assets path segment.
  • Lists all GridFS files from bucket content_assets{app_id}.
  • Adds app_id from the request to every returned asset object before responding.
  • Does not apply pagination, search, tag filtering, or sorting in this handler.
  • GridFS list failures return HTTP 500 with "Error".
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly_fs.content_assets{app_id}.filesGridFS metadataStores file metadata returned by this endpoint.
countly_fs.content_assets{app_id}.chunksGridFS chunksStores binary asset chunks referenced by the metadata.