Skip to main content
Version: 26.01

Cleanup Center - Entities Read

Endpoint​

/o/cleanup/entities

Overview​

Returns a page of cohorts, dashboards, funnels and formulas with their usage figures, so that unused ones can be found. Entities of all apps are listed.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

Requires cleanup_center Read permission.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
app_idStringConditionalApp id. Required for users who are not global admins.
typeStringNoOnly return one kind of entity: cohort, dashboard, funnel or formula. All kinds are returned by default.
qStringNoOnly return entities whose key or display name contains this text (case-insensitive).
pageIntegerNoPage number, starting at 1. Defaults to 1.
limitIntegerNoEntities per page. Values are limited to 1-100; defaults to 25.
sortByStringNolastSeen, usage30d, createdAt, updatedAt or name. Defaults to lastSeen.
sortOrderStringNoasc or desc. Defaults to desc.

Examples​

List the least recently used entities​

/o/cleanup/entities?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&sortBy=lastSeen&sortOrder=asc

List funnels matching a text​

/o/cleanup/entities?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&type=funnel&q=checkout&limit=10

Response​

Success Response​

{
"entities": [
{
"id": "cohort_6991c75b024cb89cdc04efd2_65f1f7b2ad5b9b001f12ab34",
"type": "cohort",
"key": "Active buyers",
"displayName": "Active buyers",
"status": "live",
"hidden": false,
"blocked": false,
"owner": "65f1f7b2ad5b9b001f12ab00",
"lastSeen": "2026-09-01T10:00:00.000Z",
"usage30d": 4,
"totalViews": 12,
"createdAt": 1682328445330,
"updatedAt": 1682328445330,
"tags": [],
"userCount": 250,
"description": null,
"appId": "6991c75b024cb89cdc04efd2",
"viewUsers": [],
"isUnused": false
}
],
"total": 1,
"page": 1,
"limit": 25,
"sortBy": "lastSeen",
"sortOrder": "desc"
}

Response Fields​

FieldTypeDescription
entitiesArrayEntities of the requested page.
entities[].idStringEntity id, built from the type, app and entity id.
entities[].typeStringcohort, dashboard, funnel or formula.
entities[].keyStringEntity key or name.
entities[].displayNameStringName shown for the entity.
entities[].statusStringAlways live.
entities[].hiddenBooleanAlways false.
entities[].blockedBooleanAlways false.
entities[].ownerStringId of the member who owns the entity, or null.
entities[].lastSeenStringTime of the latest recorded view, or null.
entities[].usage30dNumberViews in the last 30 days.
entities[].totalViewsNumberRecorded views.
entities[].createdAtNumberCreation time in milliseconds, or null.
entities[].updatedAtNumberLast update time in milliseconds, or null.
entities[].tagsArrayAlways empty.
entities[].userCountNumberUsers in the cohort. Cohorts only.
entities[].descriptionStringCohort description, or null. Cohorts only.
entities[].appIdStringApp id, or global for dashboards and entities without an app.
entities[].viewUsersArrayRecorded views, each with the member id and the date.
entities[].isUnusedBooleantrue when the entity was not viewed in the last 30 days.
totalNumberNumber of entities matching the request, before paging.
pageNumberReturned page.
limitNumberEntities per page.
sortByStringSort field used.
sortOrderStringSort order used.

Error Responses​

  • 500
{
"result": "Error fetching entities: ..."
}

Behavior​

  • Entities of all apps are returned, whichever app_id is sent.
  • Sorting by an unknown sortBy value keeps the original order.