---
title: "Size, open connections, version and engine figures (cached for a minute; refresh=true reads them now)"
method: GET
path: "/databases/{databaseId}/insights"
tags: ["Databases"]
---

# Size, open connections, version and engine figures (cached for a minute; refresh=true reads them now)

`GET /databases/{databaseId}/insights`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/databases/{databaseId}/insights`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `databaseId` string, uuid, required

## Query parameters

- `refresh` '0' | '1' | 'true' | 'false'

## Response `200`

Insights

- object
  - `databaseId` string, uuid, required
  - `engine` 'postgresql' | 'mysql' | 'mariadb' | 'redis' | 'mongodb', required
  - `status` string, required: provisioning, running, stopped, error or deleting
  - `version` string, nullable, required: server version reported by the database (falls back to the image tag)
  - `image` string, nullable, required
  - `sizeBytes` number, nullable, required: data size: database size (PostgreSQL), tables + indexes (MySQL/MariaDB), storage (MongoDB), used memory (Redis)
  - `connections` integer, nullable, required: open client connections
  - `maxConnections` integer, nullable, required
  - `details` object[], required: engine-specific figures, e.g. tables, keys, collections, uptime
    - `label` string, required
    - `value` string, required
  - `state` 'fresh' | 'cached' | 'preparing' | 'unavailable', required: fresh: read just now; cached: from the last read; preparing: the database tools are starting, retry shortly; unavailable: the database is not running
  - `checkedAt` string, nullable, required: ISO-8601 timestamp
  - `error` string, nullable, required

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict); details.preparing = the database tools are starting, retry after details.retryAfterSeconds
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Not available on this server (code not_configured)
- `503`: Hosting engine unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
