---
title: "Get a database"
method: GET
path: "/v1/databases/{databaseID}"
tags: ["Databases"]
---

# Get a database

`GET /v1/databases/{databaseID}`

## Request

- Base URL: `https://api.liara.ir`
- URL: `https://api.liara.ir/v1/databases/{databaseID}`
- Auth: HTTP bearer

Returns a database with its connection details and settings. The password is included once the database has been deployed. The response can include additional fields not listed here. Team permission: `view`, `operate` or `manage`.

## Path parameters

- `databaseID` string, required: 24-character hexadecimal ID.

## Query parameters

- `teamID` string: 24-character hexadecimal ID.

## Response `200`

The database.

- object
  - `database` Database
    - `_id` string
    - `hostname` string
    - `type` 'mysql' | 'mariadb' | 'postgres' | 'mongodb' | 'redis' | 'mssql' | 'elasticsearch' | 'rabbitmq' | 'clickhouse'
    - `status` 'STARTED' | 'DEPLOYED' | 'RUNNING' | 'FROZEN' | 'FAILED' | 'CRASH_LOOP' | 'SUSPENDED': `STARTED` and `DEPLOYED`: being created. `RUNNING`: running normally. `FROZEN`: stopped, for example because the balance ran out. `FAILED`: creation failed. `CRASH_LOOP`: keeps crashing on start. `SUSPENDED`: suspended by Liara.
    - `planID` string
    - `bundlePlanID` string
    - `scale` integer: `1` if the database is on, `0` if it's off.
    - `publicNetwork` boolean
    - `network` object
      - `_id` string
      - `name` string
      - `node` object
        - `host` string: Host for connecting over the public network.
    - `created_at` string, date-time
    - `version` string
    - `port` integer: Port for connecting over the public network.
    - `internalPort` integer: Port for connecting from the database's network.
    - `username` string, nullable: User name to connect with (`null` for `redis`).
    - `root_password` string: Password. Only returned once the database has been deployed.
    - `dbName` string: Default database name, if one was set.
    - `volumeSize` number: Disk size in GB.
    - `metaData` object: Options and settings set on the database.
    - `hourlyPrice` number: Hourly cost of the database's plan.
    - `bundleHourlyPrice` number: Hourly cost of the bundle plan.
    - `controlPanelSatus` string, nullable: State of the web control panel: `no-control-panel`, or the state of its deployment (for example `DEPLOYING` or `READY`).

## Other responses

- `400`: The body or a parameter is invalid (`message` says which), or `teamID` isn't a valid ID.
- `401`: The API token is missing, invalid or expired.
- `403`: With `teamID`: you aren't a member of the team (`team_not_found`), or you don't have the required permission on this database (`no_permission`).
- `404`: The database doesn't exist.

---

[API](https://skmtc.dev/liara-cloud/apis/dbaas.md) - [All operations](https://skmtc.dev/liara-cloud/apis/dbaas/llms.txt) - [OpenAPI document](https://skmtc.dev/liara-cloud/apis/dbaas/revisions/f6f78c6f05c6?raw)
