Regenerate 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/drill/regenerate_meta
Overview
Regenerates Drill event and user-property metadata for one app.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
Requires drill Update permission.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | String | Yes | Target app ID. |
period | String or JSON | No | Period used to limit source data. Defaults to 30days. Accepted keyword values are month, day, yesterday, hour, and prevMonth; relative values like 7days are also accepted. A JSON object with since is converted to [since, Date.now()]. |
wait_to_finish | Boolean String | No | If set, waits for regeneration to finish and returns Meta regeneration done. Otherwise returns immediately. |
api_key | String | Conditional | Required if auth_token is not provided. |
auth_token | String | Conditional | Required if api_key is not provided. |
Examples
Start async regeneration
/i/drill/regenerate_meta?
app_id=64f5c0d8f4f7ac0012ab3456&
period=30days
Wait for regeneration
/i/drill/regenerate_meta?
app_id=64f5c0d8f4f7ac0012ab3456&
period={"since":1735689600000}&
wait_to_finish=true
Response
Async Success Response
{
"result": "Meta regeneration started"
}
Wait Response
{
"result": "Meta regeneration done"
}
Response Fields
| Field | Type | Description |
|---|---|---|
result | String | Regeneration status message. |
Error Responses
404
{
"result": "Missing parameter app_id"
}
400
{
"result": "Bad request parameter: period"
}
Behavior
- Parses
period; invalid non-keyword periods returnBad request parameter: period. - Converts
period.sinceobjects to a timestamp range ending at request time. - Rebuilds the event list, then fixes Drill metadata for the app and selected period range.
- Writes completion status to system logs with action
meta_regeneration_finished. - Returns immediately unless
wait_to_finishis provided.
Related Endpoints
Implementation details
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.apps | App lookup | Reads target app metadata. |
countly_drill.drill_meta | Drill metadata model | Rebuilds and fixes metadata documents. |
countly_drill.drill_events{appId/hash} | Source event data | Reads Drill event data for metadata regeneration. |
countly.systemlogs | Audit trail | Stores meta_regeneration_finished completion status. |