<span id="按资产-id-查询数据资产"></span>

# Get a data asset by asset ID

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Query an asset, its derivations, and applicable parsing manifest by asset ID.

```text
GET https://api.moi.matrixorigin.cn/v5/catalog/data-assets/{id}
```

<span id="调用前准备"></span>

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`; use the corresponding product API URL for a dedicated deployment.

Obtain asset_id from actual asset results. Prepare a personal access token with read permission on the asset root volume and a workspace ID. `BASE_URL` includes the product prefix in the same environment; `MOI_KEY` and `WORKSPACE_ID` are product credentials and workspace ID. Example IDs and data are placeholders.

<span id="请求参数"></span>

## Request parameters

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --fail-with-body -sS -X GET "$BASE_URL/catalog/data-assets/asset-example" \
  -H "X-API-Key: $MOI_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

:::::
:::::{tab-item} Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | Asset ID in the path, not numeric record id, original file_id, or asset_ref. |

Asset IDs and original file IDs use different read endpoints. Continue using the existing file-query API for file-based queries.

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "asset": {
      "id": 1,
      "asset_id": "asset-example",
      "name": "orders.csv",
      "raw_file_id": "file-example",
      "volume_id": 30,
      "source": "workflow",
      "meta": {
        "source": "sample"
      },
      "created_at": 1794390000,
      "updated_at": 1794390001,
      "asset_type": "file",
      "asset_ref": "file-example"
    },
    "derivations": [
      {
        "id": 2,
        "asset_id": "asset-example",
        "kind": "parsed_from",
        "file_id": "parsed-file-example",
        "meta": {
          "step": "parse"
        },
        "created_at": 1794390000,
        "updated_at": 1794390001,
        "root_asset_id": "asset-example",
        "source_asset_id": "asset-example",
        "target_asset_id": "parsed-asset-example",
        "case_id": "case-example",
        "producer_workitem_id": "producer-example",
        "recorded_by_workitem_id": "recorder-example",
        "parallel_index": 1,
        "logical_slot": "parsed",
        "idempotency_key": "key-example"
      }
    ],
    "manifest": {
      "id": 3,
      "asset_id": "asset-example",
      "raw_file_id": "file-example",
      "parsed_file_id": "parsed-file-example",
      "manifest": {
        "format": "sample"
      },
      "created_at": 1794390000,
      "updated_at": 1794390001,
      "root_asset_id": "asset-example",
      "source_file_id": "file-example",
      "parsed_asset_id": "parsed-asset-example"
    },
    "assets_by_id": {
      "asset-example": {
        "id": 1,
        "asset_id": "asset-example",
        "name": "orders.csv",
        "raw_file_id": "file-example",
        "volume_id": 30,
        "source": "workflow",
        "meta": {
          "source": "sample"
        },
        "created_at": 1794390000,
        "updated_at": 1794390001,
        "asset_type": "file",
        "asset_ref": "file-example"
      },
      "parsed-asset-example": {
        "id": 1,
        "asset_id": "parsed-asset-example",
        "name": "parsed.jsonl",
        "volume_id": 30,
        "source": "workflow",
        "meta": {
          "source": "sample"
        },
        "created_at": 1794390000,
        "updated_at": 1794390001,
        "asset_type": "file",
        "asset_ref": "parsed-file-example"
      }
    }
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success. |
| `msg` | string | OK on success. |
| `data.asset` | object | Target asset. See [asset object](objects.md#asset) for fields. |
| `data.derivations` | object[] | Derivations; may be omitted when empty. See [derivation](objects.md#derivation) for fields. |
| `data.manifest` | object | Parsing manifest; omitted when absent. See [manifest object](objects.md#manifest) for fields. |
| `data.assets_by_id` | object | Related assets indexed by asset_id, using the same asset structure. May be omitted when empty. |

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error responses

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "ErrNotFound",
  "msg": "示例错误信息"
}
```

:::::
:::::{tab-item} Fields

| HTTP | code | Condition |
| --- | --- | --- |
| 404 | ErrNotFound | The business read found no target asset; permission boundaries may return their own errors first. |
| 400 | ErrParamInvalid | Invalid asset identifier or workspace input. |

For identity, permission, and dependency failures, use actual code, msg, and diagnostic fields. Error wording may vary by language.

:::::
::::::
:::::::
