Skip to main content
Version: 24.05

Clear Cache

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​

/i/active_users/clear_active_users_cache

Overview​

Manually invalidate cached active user data to force recalculation on the next request.

Authentication​

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

Permissions​

  • Read (active_users feature)

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key for authentication
auth_tokenStringYes (or api_key)Auth token for authentication
app_idStringConditional*Application ID to clear cache for
all_appsBooleanConditional*If true, clear cache for all applications (global admin only)

*Required: Provide app_id for app-specific clearing, or use all_apps=true with global admin credentials.

Examples​

Example 1: Clear Cache for Specific App​

Description: Clears active users cache for a single application.

Request:

curl "https://your-server.com/i/active_users/clear_active_users_cache?api_key=YOUR_API_KEY&app_id=123456789"

Response:

{
"result": "Success"
}

Example 2: Clear Cache for All Apps​

Description: Clears active users cache for all applications.

Request:

curl "https://your-server.com/i/active_users/clear_active_users_cache?api_key=YOUR_API_KEY&all_apps=true"

Response:

{
"result": "Success"
}

Response​

Success Response​

{
"result": "Success"
}

Response Fields​

FieldTypeDescription
resultStringResult message

Error Responses​

  • HTTP 200 - Missing parameter:
{
"result": "Missing parameter \"app_id\" or \"all_apps\""
}
  • HTTP 401 - Missing app_id for non-global admin:
{
"result": "No app_id provided"
}
  • HTTP 400 - Database error:
{
"result": "Db error"
}

Behavior​

  • If app_id is provided, clears cache for that application only.
  • If all_apps=true, clears cache for all applications (global admin credentials required).
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.active_usersEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.