Drill - Read Users of a Query
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
/o?method=segmentation_users
Overview
Returns the user IDs (uid) of the users who match a Drill query for one event in the requested period.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
Requires drill Read permission.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
method | String | Yes | Must be segmentation_users. |
app_id | String | Yes | Target app ID. |
event | String | Yes | Event key to query. |
queryObject | JSON String (Object) | Yes | Mongo-style Drill filter object. Use {} for no additional filters. |
period | String or JSON String (Array) | Yes | month, day, yesterday, hour, prevMonth, <number>days (for example 30days), or a custom range as a JSON array. |
bucket | String | Yes | hourly, daily, weekly, or monthly. |
api_key | String | Conditional | Required if auth_token is not provided. |
auth_token | String | Conditional | Required if api_key is not provided. |
Examples
Read users who ran an event in the last 30 days
/o?method=segmentation_users&
app_id=64f5c0d8f4f7ac0012ab3456&
api_key=YOUR_API_KEY&
event=[CLY]_session&
queryObject={}&
period=30days&
bucket=daily
Response
Success Response
An array of user IDs:
[
"a1b2c3d4",
"e5f6a7b8"
]
Response Fields
| Field | Type | Description |
|---|---|---|
(root) | Array | uid values of the matching users. Empty when no user matches. |
Error Responses
400
{
"result": "Missing request parameter: event"
}
400
{
"result": "Missing request parameter: queryObject"
}
400
{
"result": "Bad request parameter: queryObject"
}
400
{
"result": "Missing request parameter: period"
}
400
{
"result": "Bad request parameter: period"
}
400
{
"result": "Missing request parameter: bucket"
}
400
{
"result": "Bad request parameter: bucket"
}
Behavior
- The
queryObjectfilter is applied to the event data of the period. - If the query refers to cohorts, the result is limited to users who are in those cohorts.