Skip to main content

Clear Cache

Endpoint

/i/active_users/clear_active_users_cache

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

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

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

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

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

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

Database Collections

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

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"
}


Ⓔ 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-15

Last Updated

2026-02-16