# Query volume details

Query root volume details by ID.

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

## Preparation before calling

First [query the object](list-database-objects.md) in the database to obtain the target volume ID. Prepare the personal access token, target workspace ID, and volume ID that have 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.
- `$VOLUME_ID`: Volume ID to query.

## Request example

```bash
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/volume/info" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "'"$VOLUME_ID"'"
  }'
```

## Request body

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | Volume ID. |

## Successful response

Returns `200` and volume information on success. The caller must have read permissions on the volume.

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "volume": {
      "id": 789,
      "name": "sales_files",
      "display_name": "销售文件",
      "description": "销售文件",
      "display_description": "销售文件"
    }
  }
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | `OK` on success. |
| `msg` | string | `OK` on success. |
| `data.volume.id` | integer | Volume ID. |
| `data.volume.name` | string | Volume name. |
| `data.volume.display_name` | string | Volume display name; may be omitted if not provided. |
| `data.volume.description` | string | Volume description; may be omitted if not provided. |
| `data.volume.display_description` | string | Volume display description; may be omitted if not provided. |

## Error response

```json
{
  "code": "ErrParamInvalid",
  "msg": "id 无效",
  "data": null
}
```

### Common HTTP errors

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

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - `ErrParamInvalid`
  - `id` is missing or in an invalid format.
  - Pass in a valid volume ID.
* - `403`
  - `ErrForbidden`
  - The current identity does not have read permission for the volume.
  - Use credentials with read access, or contact your administrator for authorization.
* - `500`
  - `ErrServer`
  - The service cannot read the volume information.
  - Record the request time and error message and try again; if it continues to fail, contact support.
```

## Follow-up operations

When modifications are needed [Update volume](update-volume.md). When returning the list [Query file products](list-file-artifacts.md).
