Skip to main content

DB Viewer - Databases List

Endpoint

/o/db

Overview

Returns the list of databases and collections/tables available to the current user in DB Viewer.

  • Global admins get all available MongoDB databases plus ClickHouse databases (if ClickHouse plugin is enabled).
  • Non-admin users get only collections/tables they can access for their assigned apps.

Authentication

Countly API supports three authentication methods:

  1. api_key=YOUR_API_KEY
  2. auth_token=YOUR_AUTH_TOKEN
  3. countly-token: YOUR_AUTH_TOKEN

Permissions

Requires DB Viewer access (dbviewer read right for app-scoped users).

Request Parameters

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
app_idStringNoRestricts output to collections/tables accessible for that app (when user has access).

Response

Success Response

[
{
"name": "countly",
"collections": {
"members (Users)": "members",
"apps (Applications)": "apps",
"sessions": "sessions",
"events": "events"
}
},
{
"name": "countly_drill",
"collections": {
"drill_events": "drill_events"
}
},
{
"name": "clickhouse_countly_drill",
"collections": {
"events_data": "events_data",
"drill_events": "drill_events"
}
}
]

Response Fields

FieldTypeDescription
[]ArrayList of accessible databases.
[].nameStringDatabase name. ClickHouse databases are prefixed with clickhouse_.
[].collectionsObjectMap of pretty collection/table labels to actual collection/table names.

Error Responses

  • 404
{
"result": "Database not found."
}
  • 404
{
"result": "ClickHouse plugin is disabled."
}

Standard authentication and authorization errors from user validation can also be returned.

Behavior/Processing

  • When db/dbs, collection, document, aggregation, and action=get_indexes are all omitted, this endpoint runs in database-list mode.
  • MongoDB collections system.indexes and sessions_* are excluded.
  • Collection/table entries are filtered by user access (dbviewer rights and app scoping).
  • ClickHouse databases/tables are included only if ClickHouse plugin is enabled.
  • Collection names are transformed into UI-friendly labels in the collections object keys.

Database Collections

CollectionUsed forData touched by this endpoint
countly.appsApp lookup for name mapping and app filteringReads app IDs and names used to generate readable collection labels and app-scoped filtering.

Examples

List accessible databases

/o/db?api_key=YOUR_API_KEY

List databases scoped to one app

/o/db?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2

Last Updated

2026-03-07