Skip to main content
Version: 25.03

Update event metadata

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/data-manager/event/edit

Overview​

Updates event metadata and segment definitions for an existing event.

Authentication​

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

Permissions​

Requires data_manager Update permission.

Request Parameters​

ParameterTypeRequiredDescription
app_idStringYesTarget app ID.
eventJSON String (Object)YesEvent payload including key, optional status, and segments array.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

event Object Structure​

FieldTypeRequiredDescription
keyStringYesEvent key to update.
nameStringNoHuman-readable event name.
descriptionStringNoEvent description text.
statusStringNoEvent status value.
segmentsArrayNoSegment definitions used to refresh segment metadata.

Decoded example:

{
"key": "purchase",
"name": "Purchase",
"description": "Completed purchases",
"status": "live",
"segments": [
{
"name": "country",
"type": "s"
}
]
}

Examples​

/i/data-manager/event/edit?
app_id=64f5c0d8f4f7ac0012ab3456&
event={
"key":"purchase",
"status":"approved",
"segments":[
{"name":"country","type":"s","required":false},
{"name":"price","type":"n","required":true}
]
}

Response​

Success Response​

"Success"

Response Fields​

FieldTypeDescription
(root value)StringSuccess when event metadata update completes.

Error Responses​

  • 500
{
"result": "Error"
}

Behavior​

  • Validates and normalizes event key.
  • Rebuilds segment map (sg) and default segment statuses.
  • Updates event record in countly_drill.drill_meta.
  • Updates segment list in countly.events.
  • Runs data-type migration when segment types change.
  • Writes dm-event-edit system log and invalidates cache.
Implementation details

Audit & System Logs

ActionTriggerPayload
dm-event-editAfter event metadata update{ event: JSON.stringify(event), ev: shortEventKey }

Database Collections

CollectionUsed forData touched by this endpoint
countly_drill.drill_metaEvent metadata storageUpdates event metadata (status, segment definitions under sg) for the target event hash document.
countly.eventsEvent list/map metadataUpdates segments.{event} list for UI/schema consumers.
countly.appsApp-level type override cache (indirect via type migration helper)Updates override keys when changed segment types are migrated.
countly.systemlogsAudit trailWrites dm-event-edit and type-migration log actions when data types change.