Skip to main content

/i/data-manager/event/change-category

Endpoint

/i/data-manager/event/change-category

Overview

Assigns or changes category mapping for one or more events in the selected app's event map.

Authentication

Countly API supports three authentication methods:

  1. API Key (parameter): api_key=YOUR_API_KEY
  2. Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  3. Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Required permission: data_manager Update.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.
app_idStringYesTarget app ID.
eventsJSON String (Array)YesJSON-stringified array of event keys to update.
categoryStringYesCategory name/value to assign in event map.

Example:

{
"events": ["Purchase Completed", "Checkout Started"],
"category": "Revenue"
}

Response

Success Response

"Success"

Response Fields

FieldTypeDescription
(root)StringRaw string Success.

Error Responses

500 Internal Server Error

{
"result": "Error"
}

400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

401 Unauthorized

{
"result": "User does not have right"
}

Behavior/Processing

  • Validates update access for data_manager.
  • Parses events JSON string and loads app event document.
  • Ensures events.map exists and sets map[event].category for each provided event key.
  • Persists updated map back to events document.

Impact on Other Data

  • Updates map.{event}.category entries in countly.events app document.

Audit & System Logs

ActionTriggerPayload
dm-event-editDispatched once per event after update attempt{ ev: event_key, category: category_value }

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission validationReads member record by api_key or auth_token to verify update access.
countly.appsApp context validationReads app record for the requested app_id during access validation.
countly.eventsStores event definitions, segments, and map metadata per appReads app event document and updates event-category mappings in map.
countly.systemlogsStores audit trail for management actionsReceives one audit entry per event updated.

Examples

Assign Revenue category to two events

/i/data-manager/event/change-category?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&events=["Purchase Completed","Checkout Started"]&category=Revenue

Limitations

  • If app event document is missing or malformed, endpoint returns generic Error.
  • Events not present in map are created in map with only category field.

Last Updated

2026-02-17