/o/themes
Endpoint
/o/themes
Overview
Returns available dashboard theme names discovered from the frontend themes directory.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
- Required permission: Authenticated user.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes (or use auth_token) | API key for authentication. |
auth_token | String | No | Auth token as query parameter or countly-token header. |
Examples
Read available themes
/o/themes?api_key=YOUR_API_KEY
Response
Success Response
[
"",
"dark",
"light"
]
Response Fields
| Field | Type | Description |
|---|---|---|
(root) | Array | Raw array of theme names. |
[] | String | Theme name; empty string entry represents default/no explicit theme. |
Error Responses
400 Bad Request
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
400 Bad Request
{
"result": "Token not valid"
}
401 Unauthorized
{
"result": "User does not exist"
}
401 Unauthorized
{
"result": "User does not have right"
}
401 Unauthorized
{
"result": "User is locked"
}
401 Unauthorized
{
"result": "Token is invalid"
}
Behavior
- Reads the frontend themes directory.
- Ensures output is always an array.
- Prepends empty-string default entry.
- Removes
.gitignorefrom the returned list.
Limitations
- Output reflects filesystem directory names; it does not validate theme completeness.
- If theme directory listing fails, response may only contain the default empty-string entry.
Related Endpoints
Implementation details
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.members | User authentication | Reads authenticated user account for access validation. |