# Query Catalog list

Returns the list of catalogs accessible in the current workspace.

```text
POST https://moi.matrixorigin.cn/newmoi/catalog/list
```

## Preparation before calling

Prepare a personal access token and target workspace ID that has access to the target workspace.

The example below uses:

- `$AI_STUDIO_API_KEY`: The actual personal access token, passed through the `X-API-Key` Header.
- `$WORKSPACE_ID`: Target workspace ID, passed through `X-Workspace-ID` Header.

## Request example

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

## Successful response

On success, `200` and the Catalog list that can be read by the current identity are returned.

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "list": [
      {
        "id": 1,
        "name": "sales",
        "display_name": "sales",
        "description": "销售数据",
        "database_count": 1,
        "volume_count": 1,
        "file_count": 2,
        "table_count": 3,
        "created_at": "2026-08-18T10:00:00Z",
        "created_by": "user-001",
        "updated_at": "2026-08-18T10:00:00Z",
        "updated_by": "user-001",
        "reserved": false,
        "allowed_actions": ["catalog.read", "catalog.update"]
      }
    ]
  }
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | `OK` on success. |
| `msg` | string | `OK` on success. |
| `data.list` | object[] | Catalog list; empty array when there is no readable catalog. |
| `data.list[].id` | integer | Catalog ID. |
| `data.list[].name` | string | Catalog name. |
| `data.list[].description` | string | Catalog description. |
| `data.list[].display_name` | string | Catalog display name; returned if there is a value. |
| `data.list[].display_description` | string | Catalog Display description; return if there is a value. |
| `data.list[].database_count` | integer | Number of subordinate databases. |
| `data.list[].volume_count` | integer | Number of subordinate volumes; returned if there is a value. |
| `data.list[].file_count` | integer | Number of subordinate files; returned if there is a value. |
| `data.list[].table_count` | integer | Number of subordinate tables; returned if there is a value. |
| `data.list[].created_at` | string | Creation time; returned if there is a value. |
| `data.list[].created_by` | string | Creator ID; returned if there is a value. |
| `data.list[].updated_at` | string | Update time; returned if there is a value. |
| `data.list[].updated_by` | string | Updater ID; returned if there is a value. |
| `data.list[].reserved` | boolean | Whether to reserve the Catalog. |
| `data.list[].allowed_actions` | string[] | Operations allowed by the current identity. |

In this document, `[]` after a type means an array; for example, `object[]` is an array of objects. In field paths, `[]` means each item in an array; for example, `data.list[].id` is the `id` field of each item in `data.list`.

## Error response

```json
{
  "code": "ErrServer",
  "msg": "服务器内部错误",
  "data": null
}
```

### Common HTTP errors

```{list-table}
:header-rows: 1
:widths: 12 22 32 34

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `401`
  - `ErrUnauthorized`
  - Missing or invalid access credentials.
  - Check API Key and Workspace Header.
* - `500`
  - `ErrServer`
  - The server failed to read the Catalog list.
  - Try again later.
```

## Follow-up operations

Use `data.list[].id` [Query Catalog details](get-catalog.md).
