# View database list

List the databases you have access to. Use a name in the response to view the tables and views in that database.

```text
POST https://moi.matrixorigin.cn/newmoi/meta/db/info
```

## Preparation before calling

Prepare a personal access token and workspace ID that has access to the target workspace. The returned results only include databases accessible by the current identity.

The example below uses `$AI_STUDIO_API_KEY` as `X-API-Key` and `$WORKSPACE_ID` as `X-Workspace-ID`.

## Call example

```bash
curl -X POST "https://moi.matrixorigin.cn/newmoi/meta/db/info" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

## Request body

This interface does not require a request body.

## Successful response

```json
{
  "code": 200,
  "data": {
    "result": [
      {
        "db_name": "sales",
        "display_name": "销售数据"
      }
    ],
    "total": 1
  }
}
```

The response fields are as follows.


| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | `200` on success. |
| `data.result` | array | List of databases that can be read by the current access credentials. |
| `data.result[].db_name` | string | Database name. |
| `data.result[].display_name` | string | Display name; can be omitted if not set. |
| `data.result[].db_owner` | string | Database owner; currently returned may be an empty string. |
| `data.result[].is_internal` | boolean | Whether it is a built-in database in the system. |
| `data.result[].is_subscription` | boolean | Whether it is a subscription database. |
| `data.result[].has_published` | boolean | Whether to contain published data. |
| `data.result[].tables` | object | Table metadata object. |
| `data.result[].views` | object | View metadata object. |
| `data.total` | integer | Number of databases in `result`. |

In field paths, `[]` denotes each item in an array. For example, `items[].name` is the `name` field of each item in the `items` array.


After getting the database name from `data.result[].db_name`, use [Query table in database](list-database-tables.md) to continue viewing the object.

## Error response

::::{div} mo-api-split
:::{div} mo-api-split-main
```{raw} html
<dl class="mo-api-fields">
<div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">integer or string</span></dt><dd>Error code or status.</dd></div>
<div class="mo-api-field"><dt><code>message</code><span class="mo-api-field__type">string</span></dt><dd>Error message.</dd></div>
</dl>
```
:::
:::{div} mo-api-split-aside
```{raw} html
<p class="mo-api-example-label">Error response example</p>
```
```json
{
  "code": 503,
  "message": "服务暂不可用"
}
```
:::
::::
## Follow-up operations

Save the identification of the target item, and then [query table information](get-table-info.md).
