Update property or segment data types
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/data-type
Overview
Runs Data Manager type migration operations for event segments and user properties.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | String | Yes | Target app ID. |
ops | JSON String (Object) | Yes | Type migration operations keyed by event key + segment key. |
api_key | String | Conditional | Required if auth_token is not provided. |
auth_token | String | Conditional | Required if api_key is not provided. |
ops Object Structure
ops is a JSON-stringified object keyed by event|segment, where each value describes one type migration operation.
| Field | Type | Required | Description |
|---|---|---|---|
event | String | Yes | Target domain key (custom, up, or event key). |
segment | String | Yes | Segment/property key to migrate. |
newDataType | String | Yes | New type code (for example s, n). |
prevDataType | String | Yes | Previous type code. |
Decoded example:
{
"purchase|price": {
"event": "purchase",
"segment": "price",
"newDataType": "n",
"prevDataType": "s"
}
}
Examples
Update a custom user property type
/i/data-manager/data-type?
app_id=64f5c0d8f4f7ac0012ab3456&
ops={"custom|plan":{"event":"custom","segment":"plan","newDataType":"s","prevDataType":"n"}}
Update an event segment type
/i/data-manager/data-type?
app_id=64f5c0d8f4f7ac0012ab3456&
ops={"purchase|price":{"event":"purchase","segment":"price","newDataType":"n","prevDataType":"s"}}
Response
Success Response
"Success"
Response Fields
| Field | Type | Description |
|---|---|---|
(root value) | String | Success when migration request is accepted. |
Error Responses
500
500
Behavior
- Parses
opsand forces user-property mode (ops.isUserProperty = true). - Runs
migrateDataType(...)for each operation. - Updates type metadata in
countly_drill.drill_metaand app overrides incountly.apps. - Triggers type migration through drill processing and invalidates Data Manager cache.
Operational Considerations
- Type migration can touch large historical datasets and may run for a long time on high-volume apps.
- Plan migrations during low-traffic windows to reduce contention with write-heavy workloads.
Limitations
- On runtime exceptions, this endpoint can return HTTP
200with raw JSON body500.
Related Endpoints
Implementation details
Audit & System Logs
| Action | Trigger | Payload |
|---|---|---|
dm-dt-custom | User custom-property type migration (event=custom) | { query, id: "custom.segment_key" } |
dm-dt-up | Built-in user property type migration (event=up) | { query, id: "up.segment_key" } |
dm-dt-event-sg | Event segment type migration (event_key + segment_key) | { query } |
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly_drill.drill_meta | Source-of-truth metadata for event segments and user properties | Updates type metadata (type, prev_type) for custom, up, and event segment targets. |
countly.apps | App-level type override cache | Updates ovveridden_types.events.* / ovveridden_types.prop.* entries used by downstream reads. |
countly.systemlogs | Audit trail | Writes migration actions (dm-dt-custom, dm-dt-up, dm-dt-event-sg) with migrated target details. |