Skip to main content

Retrieve all assets

Endpoint

/o/content/assets

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Lists uploaded assets and their metadata for the selected app.

Authentication

  • Authentication methods:
    • API Key (parameter): api_key=YOUR_API_KEY
    • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
    • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

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

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/Processing

  • 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".

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.

Examples

Example 1: List Assets

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

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Already a Customer? Use support portal if you have any questions


Last Updated

2026-04-18