Skip to main content

/i/cms/clear

Endpoint

/i/cms/clear

Overview

Clear CMS cache entries from countly.cms_cache.

Authentication

  • 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

  • Requires app-level write/admin access for app_id.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API authentication key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
app_idStringYesApp ID used by write-permission validation.
_idStringNoCache ID prefix filter. When omitted, all CMS cache entries are deleted.

Response

Success Response

{
"result": "CMS cache cleared"
}

Response Fields

FieldTypeDescription
resultStringCache clear status message.

Error Responses

Status Code: 400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

Status Code: 401 Unauthorized

{
"result": "User does not have right"
}

Status Code: 500 Internal Server Error

{
"result": "An error occured while clearing CMS cache: Delete operation failed"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Global cache clear_id is omittedDeletes all cms_cache documents.Wrapped string: { "result": "CMS cache cleared" }
Prefix cache clear_id is providedDeletes cms_cache documents where _id starts with the provided prefix.Wrapped string: { "result": "CMS cache cleared" }

Impact on Other Data

  • Removes cache entries and related _meta entries from countly.cms_cache.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission validationReads member identity and app write permissions.
countly.cms_cacheCache invalidation targetDeletes cache entries globally or by prefix.

Examples

Example 1: Clear all CMS cache entries

/i/cms/clear?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2

Example 2: Clear one CMS namespace

/i/cms/clear?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&_id=server-guides

Limitations

  • This endpoint removes cached entries only; it does not fetch fresh CMS data by itself.

Last Updated

2026-02-17