Import event schema from CSV
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/import-schema
Overview
Imports event/segment schema definitions from a CSV file and upserts metadata.
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. |
import_file | File | Yes | CSV schema file uploaded as multipart form-data. |
api_key | String | Conditional | Required if auth_token is not provided. |
auth_token | String | Conditional | Required if api_key is not provided. |
Examples
Endpoint formation
/i/data-manager/import-schema?
app_id=64f5c0d8f4f7ac0012ab3456
Multipart fields
import_file=schema.csv (binary)
app_id=64f5c0d8f4f7ac0012ab3456
api_key=YOUR_API_KEY
Response
Success Response
"Success"
Response Fields
| Field | Type | Description |
|---|---|---|
(root value) | String | Success when import completes. |
Error Responses
500
{
"result": "Error"
}
Behavior
- Parses CSV with
csvtojsonfrom uploadedimport_file. - Upserts event metadata into
countly_drill.drill_meta. - Updates
countly.eventsmap/list/segments. - Inserts missing categories into
countly.event_categories. - Supports list segment options by writing
biglistmetadata records.
Operational Considerations
- Large schema files can trigger many upserts and category writes in one request.
- Import updates event metadata and segment definitions together; run during controlled maintenance windows for large schema changes.
Related Endpoints
Implementation details
Audit & System Logs
- This endpoint does not emit
/systemlogsactions.
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly_drill.drill_meta | Imported event/segment metadata storage | Bulk-upserts event metadata documents and segment option metadata (biglist records). |
countly.events | Event list/map/segment index | Updates app-level event list, segments, and map objects to match imported schema. |
countly.event_categories | Category dictionary | Reads existing categories and inserts new category documents discovered in CSV. |