Skip to main content

/i/apps/reset

Endpoint

/i/apps/reset

Overview

Reset app data either fully or for a bounded historical period while keeping the app definition.

Authentication

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

Permissions

  • Global admin permission is required by route-level validation.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API authentication key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
argsJSON String (Object)YesReset payload.

args Object Structure

FieldTypeRequiredDescription
app_idStringYesApp ID to reset.
periodStringYesData reset scope: all, reset, 1month, 3month, 6month, 1year, or 2year.

Examples

Example 1: Full reset keeping app definition

/i/apps/reset?api_key=YOUR_API_KEY&args={"app_id":"64b0ac10c2c3ce0012dd1001","period":"all"}

Example 2: Keep last 6 months only

/i/apps/reset?api_key=YOUR_API_KEY&args={"app_id":"64b0ac10c2c3ce0012dd1001","period":"6month"}

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringReset status string.

Error Responses

Status Code: 400 Bad Request

{
"result": "Error: Validation error details"
}

Status Code: 403 Forbidden

{
"result": "Application is locked"
}

Status Code: 404 Not Found

{
"result": "App not found"
}

Behavior

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Full reset/clearperiod is all or resetClears app-wide analytics and user datasets, resets or reinitializes core app state as required.Wrapped string { "result": "Success" }
Bounded retention resetperiod is one of 1month, 3month, 6month, 1year, 2yearDeletes data older than selected period while preserving recent buckets.Wrapped string { "result": "Success" }

Impact on Other Data

  • Clears app-user, event, and aggregate analytics data based on selected reset mode.
  • Triggers app clear/reset integration hooks so feature modules can clean app-scoped data.
  • Cleans granular drill data with app/time scoped filters.

Operational Considerations

  • Reset operations are destructive for selected historical scope.
  • Large apps can take significant cleanup time across aggregate and granular datasets.
  • Success response indicates reset flow started and completed core trigger path; background cleanup may continue.

Limitations

  • Locked apps cannot be reset.
  • Route-level validation requires global admin access.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.appsApp state resetReads app and may reset app sequence state for full reset flows.
countly.app_users{appId}User analytics resetRemoves or prunes app-user profile/activity data.
countly.app_user_merges and countly.app_user_merges{appId}Merge state cleanupRemoves merge metadata tied to reset app data scope.
countly.users, countly.carriers, countly.devices, countly.device_details, countly.citiesAggregated analytics resetRemoves app-scoped aggregate documents outside retained period.
countly.eventsEvent metadata retention/resetKeeps or resets event metadata depending on reset mode.
countly.events_dataEvent aggregate cleanupRemoves event aggregate documents outside retained reset scope.
countly.long_tasksTask cleanupDeletes app-scoped long-task records during cleanup.
countly_drill.drill_eventsGranular event cleanupRemoves granular events outside retained period or for full reset.
countly_drill.drill_metaDrill metadata cleanupRemoves or prunes app drill metadata.