Skip to main content

Read segmentation metadata

Enterprise Only
This API is available exclusively in Countly Enterprise.

Endpoint

/o?method=segmentation_meta

Overview

Returns metadata for event segmentation fields and user properties.

The endpoint merges app-level user property metadata with event-level segmentation metadata. It can also add plugin-specific maps for cohorts, feedback widgets, journeys, content blocks, and geolocation targets when those plugins have relevant data.

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 drill Read permission for most events.
  • Requires crashes read permission when event=[CLY]_crash.

Request Parameters

ParameterTypeRequiredDescription
methodStringYesMust be segmentation_meta.
app_idStringYesTarget app ID.
eventStringYesEvent key to inspect.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Configuration Impact

SettingDefaultAffectsUser-visible impact
api.*Server API defaultsShared API execution controls (for example processing thresholds/limits).Changes to API-level controls can affect runtime behavior, limits, or response timing for this endpoint.

Response

Success Response

{
"e": "[CLY]_session",
"up": {
"p": {
"type": "l",
"values": ["iOS", "Android"]
},
"cc": {
"type": "l",
"values": ["US", "DE"]
},
"av": {
"type": "s"
}
},
"sg": {
"source": {
"type": "s",
"values": ["organic", "paid"]
}
},
"chr": {
"type": "l",
"values": ["67ad1e..."]
},
"geo": {
"type": "l",
"values": [
{
"_id": "65f1f7b2ad5b9b001f12ab34",
"title": "Berlin Store",
"app": "64f5c0d8f4f7ac0012ab3456"
}
]
}
}

Feedback Event Response Additions

For [CLY]_survey, [CLY]_nps, and [CLY]_star_rating, the response can include widget/question maps and normalized widget_id values.

{
"e": "[CLY]_star_rating",
"sg": {
"widget_id": {
"type": "s",
"values": ["65f1f7b2ad5b9b001f12ab34"]
},
"rating": {
"type": "n",
"values": [1, 2, 3, 4, 5]
}
},
"widget_map": [
{
"_id": "65f1f7b2ad5b9b001f12ab34",
"name": "App Rating"
}
]
}

Journey/Content Event Response Additions

For journey/content internal events, the response can include journey_map and content_map. When present, related segment values are replaced with ids from those maps.

{
"e": "[CLY]_content_shown",
"sg": {
"journey_definition_id": {
"type": "s",
"values": ["65f1f7b2ad5b9b001f12ab34"]
},
"content_block_id": {
"type": "s",
"values": ["65f1f7b2ad5b9b001f12ab35"]
}
},
"journey_map": [
{
"_id": "65f1f7b2ad5b9b001f12ab34",
"name": "Onboarding Journey"
}
],
"content_map": [
{
"_id": "65f1f7b2ad5b9b001f12ab35",
"name": "Welcome Banner"
}
]
}

Response Fields

FieldTypeDescription
(root object)ObjectMerged metadata object for user properties, event segments, and optional plugin maps.
eStringEvent key represented by this metadata response.
upObjectUser-property metadata map from app-level _meta_up. Keys use stored user-property names such as p, cc, av, and custom fields.
up.<field>.typeStringField type. Common values include s string, n number, d date, l list, and a array/list-like values.
up.<field>.valuesArrayKnown sampled values for the user property, when recorded and not masked.
up.<field>.ttlNumberProperty expiration setting, when configured.
sgObjectSegment metadata map for the selected event.
sg.<field>.typeStringSegment field type.
sg.<field>.valuesArrayKnown sampled segment values. Survey answer fields with keys starting answ- are omitted from this metadata response.
chrObjectCohort selector metadata. Present when cohorts exist for the app.
chr.valuesArrayCohort ids available as Drill filters.
geoObjectGeolocation selector metadata. Present when geolocation targets exist.
geo.values[]ArrayGeo target objects with _id, title, and app.
widget_mapArrayFeedback widget id/name map for feedback events.
questionMapArraySurvey question metadata for [CLY]_survey, when available.
journey_mapArrayJourney id/name map for journey/content internal events.
content_mapArrayContent block id/name map for content internal events.

Error Responses

  • 500
{
"result": "Internal error"
}

Behavior/Processing

  • Merges app-level meta (_meta_up) and event-level meta (_meta_<hash>).
  • Omits masked user-property values when Data Manager masking is enabled.
  • Omits survey answer fields whose segment keys start with answ-.
  • Enriches output with cohorts and optional plugin maps (journeys/content/feedback/geos).
  • Returns preset field types when record_meta is disabled.

Database Collections

CollectionUsed forData touched by this endpoint
countly_drill.drill_metaDrill metadata modelStores event/segment/property metadata dictionaries used by this endpoint.
countly.cohortsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.feedback_widgetsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.content_blocksEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.journey_definitionEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.

Examples

Read session metadata

/o?method=segmentation_meta&
app_id=64f5c0d8f4f7ac0012ab3456&
event=[CLY]_session

Read custom event metadata

/o?method=segmentation_meta&
app_id=64f5c0d8f4f7ac0012ab3456&
event=purchase

Read feedback widget metadata

/o?method=segmentation_meta&
app_id=64f5c0d8f4f7ac0012ab3456&
event=[CLY]_star_rating

Read crash metadata

/o?method=segmentation_meta&
app_id=64f5c0d8f4f7ac0012ab3456&
event=[CLY]_crash


Last Updated

2026-04-17