> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vertracloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Database by ID

> Retrieves details of a specific database by its ID.

<ParamField path="id" type="string" required>
  The ID of the database to retrieve. If the database belongs to an workspace, include the workspace\_id in the format `dbId-workspace_id`.
</ParamField>

### Response

<ResponseField name="response" type="object">
  The details of the database.

  <Expandable title="Toggle object">
    <ResponseField name="id" type="string">
      The ID of the database.
    </ResponseField>

    <ResponseField name="cluster" type="number">
      The cluster ID where the database is hosted.
    </ResponseField>

    <ResponseField name="type" type="number">
      The type of the database.
    </ResponseField>

    <ResponseField name="name" type="string">
      The name of the database.
    </ResponseField>

    <ResponseField name="description" type="string">
      The description of the database.
    </ResponseField>

    <ResponseField name="owner_id" type="string">
      The ID of the database owner.
    </ResponseField>

    <ResponseField name="owner_plan_id" type="number">
      The ID of the owner's plan.
    </ResponseField>

    <ResponseField name="status" type="string">
      The status of the database (e.g., `up`).
    </ResponseField>

    <ResponseField name="ram" type="number">
      The RAM allocated to the database in MB.
    </ResponseField>

    <ResponseField name="host" type="string">
      The host address of the database.
    </ResponseField>

    <ResponseField name="port" type="number">
      The port used by the database.
    </ResponseField>

    <ResponseField name="created_at" type="string" format="date-time">
      The timestamp when the database was created.
    </ResponseField>

    <ResponseField name="updated_at" type="string" format="date-time">
      The timestamp when the database was last updated.
    </ResponseField>

    <ResponseField name="use_credits" type="boolean">
      Whether the database uses credits.
    </ResponseField>

    <ResponseField name="credits_used" type="number">
      The amount of credits used by the database.
    </ResponseField>

    <ResponseField name="offline_since" type="string | null" format="date-time">
      The timestamp since the database went offline, if applicable.
    </ResponseField>

    <ResponseField name="last_snapshot" type="string | null" format="date-time">
      The timestamp of the last snapshot, if available.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "response": {
      "id": "639d9aa35d8b4e559bcd066db4ddcc8c",
      "cluster": 1,
      "type": 3,
      "name": "MyDatabase",
      "description": "I have a description :)",
      "owner_id": "993591427428790342",
      "owner_plan_id": 1,
      "status": "up",
      "ram": 256,
      "host": "639d9aa35d8b4e559bcd066db4ddcc8c.db.usa1.vertraweb.app",
      "port": 12748,
      "use_credits": false,
      "credits_used": 0,
      "offline_since": null,
      "last_snapshot": "2026-03-14T19:58:00Z",
      "created_at": "2026-03-14T19:58:00Z",
      "updated_at": "2026-03-14T19:58:00Z"
    }
  }
  ```
</ResponseExample>

### Error Responses

<ResponseField name="code" type="string">
  The error code indicating the reason for failure. Possible values:

  * `UNAUTHORIZED`: The user is not authenticated or lacks sufficient permissions.
  * `DATABASE_NOT_FOUND`: The specified database does not exist or the user lacks access.
</ResponseField>

<ResponseField name="message" type="string">
  A descriptive message providing additional details about the error.
</ResponseField>

<ResponseExample>
  ```json Error Response (403) theme={null}
  {
    "code": "UNAUTHORIZED"
  }
  ```

  ```json Error Response (404) theme={null}
  {
    "code": "DATABASE_NOT_FOUND"
  }
  ```
</ResponseExample>
