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:
api_key=YOUR_API_KEYauth_token=YOUR_AUTH_TOKENcountly-token: YOUR_AUTH_TOKEN
Permissions
Requires DB Viewer access (dbviewer read right for app-scoped users).
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Conditional | Required if auth_token is not provided. |
auth_token | String | Conditional | Required if api_key is not provided. |
app_id | String | No | Restricts 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
| Field | Type | Description |
|---|---|---|
[] | Array | List of accessible databases. |
[].name | String | Database name. ClickHouse databases are prefixed with clickhouse_. |
[].collections | Object | Map 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, andaction=get_indexesare all omitted, this endpoint runs in database-list mode. - MongoDB collections
system.indexesandsessions_*are excluded. - Collection/table entries are filtered by user access (
dbviewerrights and app scoping). - ClickHouse databases/tables are included only if ClickHouse plugin is enabled.
- Collection names are transformed into UI-friendly labels in the
collectionsobject keys.
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.apps | App lookup for name mapping and app filtering | Reads 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
Related Endpoints
- DB Viewer - Collection Read
- DB Viewer - Document Read
- DB Viewer - Indexes Read
- DB Viewer - Aggregation Query
Last Updated
2026-03-07