Skip to main content

Delete asset

Endpoint

/i/content/asset-delete

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Deletes an uploaded asset from GridFS storage.

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: Delete 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
asset_idStringYesGridFS ObjectID of the asset to delete

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringSuccess confirmation

Error Responses

HTTP StatusResponse
400"Missing asset_id or app_id"
400"There is an error while deleting the asset"
400"Invalid request"

Behavior/Processing

  1. Validates request authentication and permissions.
  2. Verifies asset_id and app_id are present.
  3. Deletes the file from GridFS.
  4. Returns success.

Database Collections

CollectionUsed forData touched by this endpoint
countly_fs.content_assets{app_id}.filesEndpoint data source** - GridFS file metadata (deleted)
countly_fs.content_assets{app_id}.chunksEndpoint data source** - GridFS binary chunks (deleted)

Examples

Example 1: Delete an Asset

/i/content/asset-delete?api_key=YOUR_API_KEY&app_id=5be987d7b93798516eb5289a&asset_id=507f1f77bcf86cd799439011

Limitations

  • Deletion is permanent.
  • This endpoint does not validate whether the asset is still referenced by content blocks.

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

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


Last Updated

2026-02-16