Skip to main content

Data Transformations - Update Rule

Enterprise Only This API is available exclusively in Countly Enterprise.

Endpoint

/i/data-manager/transformation/edit

Overview

Updates an existing transformation rule by ID.

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.
idStringYesTransformation document ID.
transformationJSON String (Object)YesUpdated transformation payload.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

transformation Object Structure

FieldTypeRequiredDescription
actionTypeStringYesOperation type: rename, merge, change-value, copy-to-user-custom.
transformTargetArrayYesSource key(s) or event(s) to transform.
transformResultStringYesTarget key/name/value produced by transformation.
transformationProcessTargetStringNoProcessing scope metadata: incoming, existing, both.
parentEventStringNoEvent context or CUSTOM_PROPERTY.
targetRegexStringNoRegex pattern used by value-change and regex flows.
isRegexBoolean/StringNoRegex mode flag.
isRegexMergeBoolean/StringNoRegex merge mode flag.
sourceEventDeleteBoolean/StringNoSource cleanup flag for merge workflows.
isExistingEventBoolean/StringNoExisting-event handling flag.
statusStringNoRule status value.

Decoded example:

{
"actionType": "rename",
"parentEvent": "purchase",
"transformTarget": ["region_code"],
"transformResult": "region",
"transformationProcessTarget": "incoming"
}

Parameter Semantics

FieldExpected valuesBehavior
transformation.actionTyperename, merge, change-value, copy-to-user-customControls how the rule updates names, merges values, rewrites values, or copies segment values. Invalid combinations return generic 500 Error.
transformation.transformationProcessTargetincoming, existing, bothStored in rule metadata; this endpoint does not run historical reprocessing.

Response

Success Response

"Success"

Response Fields

FieldTypeDescription
(root value)StringSuccess when update completes.

Error Responses

  • 500
{
"result": "Error"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Update ruleAlwaysParses transformation payload and updates the matching rule by _id + app, including cleanup of removed optional fields.Raw root string: "Success"

Impact on Other Data

  • Updates transformation document in countly.datamanager_transforms.
  • Invalidates transformation cache for the app.

Audit & System Logs

ActionTriggerPayload
dm-transformation-editAfter successful update{ transform: JSON.stringify(transform), id: id }

Database Collections

CollectionUsed forData touched by this endpoint
countly.datamanager_transformsTransformation rule storageUpdates existing rule document by _id + app, including $set and $unset of optional fields.
countly.systemlogsAudit trailWrites dm-transformation-edit with updated payload and rule ID.

Examples

/i/data-manager/transformation/edit?
app_id=64f5c0d8f4f7ac0012ab3456&
id=67b860e39f2d3e0012ab9c44&
transformation={
"parentEvent":"purchase",
"transformTarget":["region_code"],
"transformResult":"region",
"actionType":"rename",
"transformationProcessTarget":"incoming"
}

Operational Considerations

  • No long-task branch is executed for update in the current endpoint behavior.

Limitations

  • Malformed JSON in transformation or invalid transform mapping returns generic 500 Error.


Last Updated

2026-02-16