Skip to main content

/i/data-manager/category/delete

Endpoint

/i/data-manager/category/delete

Overview

Deletes category documents by ID for the selected app.

Authentication

Countly API supports three authentication methods:

  1. API Key (parameter): api_key=YOUR_API_KEY
  2. Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  3. Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Required permission: data_manager Delete.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.
app_idStringYesTarget app ID.
categoryIdsJSON String (Array)YesJSON-stringified array of category document IDs to delete.

Example:

["65f0b7d9a1b2c3d4e5f60789", "65f0b7d9a1b2c3d4e5f60790"]

Response

Success Response

"Success"

Response Fields

FieldTypeDescription
(root)StringRaw string Success.

Error Responses

500 Internal Server Error

{
"result": "Error"
}

400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

401 Unauthorized

{
"result": "User does not have right"
}

Behavior/Processing

  • Validates delete access for data_manager.
  • Parses categoryIds JSON string.
  • Deletes matching category IDs scoped to app_id.
  • Returns success without waiting on delete result verification.

Impact on Other Data

  • Removes matching category records from countly.event_categories.

Audit & System Logs

ActionTriggerPayload
dm-category-deleteDelete request is accepted{ ids: [ ... ] }

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission validationReads member record by api_key or auth_token to verify delete access.
countly.appsApp context validationReads app record for the requested app_id during access validation.
countly.event_categoriesStores per-app event category definitionsDeletes records for provided IDs scoped by app.
countly.systemlogsStores audit trail for management actionsReceives audit entry dispatched for category delete.

Examples

Delete two categories

/i/data-manager/category/delete?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&categoryIds=["65f0b7d9a1b2c3d4e5f60789","65f0b7d9a1b2c3d4e5f60790"]

Limitations

  • Invalid JSON in categoryIds fails with generic Error.
  • Endpoint does not report per-ID delete counts.

Last Updated

2026-02-17