---
title: "Get a database (password only with ?reveal=true)"
method: GET
path: "/databases/{databaseId}"
tags: ["Databases"]
---

# Get a database (password only with ?reveal=true)

`GET /databases/{databaseId}`

## Request

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

## Path parameters

- `databaseId` string, uuid, required

## Query parameters

- `reveal` '0' | '1' | 'true' | 'false': Return secret values (needs the reveal scope)

## Response `200`

The database

- object
  - `id` string, uuid, required
  - `organizationId` string, uuid, required
  - `projectId` string, uuid, nullable, required
  - `name` string, required
  - `engine` 'postgresql' | 'mysql' | 'mariadb' | 'redis' | 'mongodb', required
  - `version` string, nullable, required
  - `status` 'provisioning' | 'running' | 'stopped' | 'error' | 'deleting', required
  - `isPublic` boolean, required
  - `internalHost` string, nullable, required: reachable from the organization's projects
  - `port` integer, nullable, required
  - `publicHost` string, nullable, required
  - `publicPort` integer, nullable, required
  - `databaseName` string, nullable, required
  - `username` string, nullable, required
  - `password` string, nullable, required: only with databases:reveal and ?reveal=true
  - `connectionUrl` string, nullable, required: masked unless revealed
  - `backupScheduled` boolean: false: the database has no backup schedule, so nothing is backed up (absent for Redis, which has no scheduled backups). PUT /databases/{id}/backups {"frequency": "0 3 * * *", "retentionDays": 30} turns on daily backups.
  - `resources` object, required: CPU and memory limits of the database container; change them with POST /databases/{id}/resources (restarts it)
    - `cpus` number, required
    - `memoryMb` integer, required
  - `createdAt` string, required: ISO-8601 timestamp

## 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)
- `429`: Too many requests (code rate_limited); see Retry-After
- `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)
