Skip to main content

Data Transformations - Run on Historical Range

Enterprise Only This API is available exclusively in Countly Enterprise.

Endpoint

/i/data-manager/transform-history

Overview

Runs a transformation payload against historical data for a selected date range.

Authentication

Countly API supports three authentication methods:

  1. API key query parameter: api_key=YOUR_API_KEY
  2. Auth token query parameter: auth_token=YOUR_AUTH_TOKEN
  3. Auth token header: countly-token: YOUR_AUTH_TOKEN

Permissions

Requires data_manager_transformations Update permission.

Request Parameters

ParameterTypeRequiredDescription
app_idStringYesTarget app ID.
transformationJSON String (Object)YesHistorical transformation object. Expects historical action values such as SEGMENT_RENAME, EVENT_MERGE, PROPERTY_VALUE.
periodStringNoRelative period selector for historical range.
date, from, toStringNoExplicit date range inputs for timestamp range query.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

transformation Object Structure

FieldTypeRequiredDescription
actionTypeStringYesHistorical transformation action type (for example SEGMENT_RENAME, EVENT_MERGE, PROPERTY_VALUE).
parentEventStringNoEvent context or CUSTOM_PROPERTY where applicable.
transformTargetArrayYesSource key(s) or event(s) to transform.
transformResultStringYesTarget key/name/value after transformation.
targetRegexStringNoRegex pattern used by value-change operations.

Decoded example:

{
"actionType": "SEGMENT_RENAME",
"parentEvent": "purchase",
"transformTarget": ["country_code"],
"transformResult": "country"
}

Parameter Semantics

FieldExpected valuesBehavior
transformation.actionTypeValues starting with SEGMENT, EVENT, or PROPERTYSelects which historical entity domain is transformed (event segment, event, or user property).
period / date / from / toStandard Countly date selectorsDefines the historical time window processed by this request.

Response

Success Response

"Success"

Response Fields

FieldTypeDescription
(root value)StringSuccess when historical operation is triggered/executed.

Error Responses

  • 500
{
"result": "Error"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Historical runAlwaysBuilds historical date range, selects processing branch from actionType, and executes historical transformation run.Raw root string: "Success"

Impact on Other Data

  • Applies transformation logic to historical event/segment/property data stores.

Audit & System Logs

  • This endpoint does not emit a dedicated /systemlogs action.

Database Collections

CollectionUsed forData touched by this endpoint
countly_drill.drill_eventsHistorical drill event source/targetReads and updates historical event rows affected by the requested transformation action.
countly.events_dataAggregated historical metricsReads and updates aggregate metric rows impacted by rename/merge operations.
countly_drill.drill_metaMetadata reference and update targetReads/writes related metadata needed by persistence branch execution.

Examples

/i/data-manager/transform-history?
app_id=64f5c0d8f4f7ac0012ab3456&
period=30days&
transformation={
"actionType":"SEGMENT_RENAME",
"parentEvent":"purchase",
"transformTarget":["country_code"],
"transformResult":"country"
}

Operational Considerations

  • Historical execution runs in request context here (no task manager wrapper in this endpoint).
  • Large historical ranges can increase runtime significantly.

Limitations

  • Endpoint currently executes only rename and merge action branches in this path.
  • Malformed transformation JSON returns generic 500 Error.


Last Updated

2026-02-16