# Resolve agent artifact file references

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

Resolve artifact IDs and versions to currently accessible file and placement identifiers.


```http
POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-artifacts/resolve
```

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`. For private deployments, use the corresponding product API URL.

[Prepare identity, volume permissions, and version references](objects.md#prepare).

## Request

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

```bash
curl --request POST \
  "$BASE_URL/workspaces/$WORKSPACE_ID/agent-artifacts/resolve" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data '{"items":[{"artifact_id":"artifact-example","version":1},{"artifact_id":"artifact-unavailable","version":1}]}'
```

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

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | Path | string | Yes | Workspace ID in the current environment. |
| `items` | Body | array (references) | No | Version references to resolve. Omission/null/an empty array selects no artifacts. |
| `items[].artifact_id` | Body | string | Yes | Artifact ID. |
| `items[].version` | Body | integer | Yes | Positive integer version. |

Use the result's current file/volume/placement identifiers to call the corresponding file APIs. This does not generate content, rerun tasks, or repair artifacts. HTTP200 may still include failed. The same 100-item limit as deletion has not been verified for this API; do not assume it applies.

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

## Successful response

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

```json
{
  "code": 0,
  "data": {
    "items": [
      {
        "artifact_id": "artifact-example",
        "version": 1,
        "file_id": "file-example",
        "volume_id": 10,
        "placement_id": 23,
        "file_name": "summary.txt",
        "content_type": "text/plain",
        "size": 128,
        "status": "completed"
      }
    ],
    "failed": [
      {
        "artifact_id": "artifact-unavailable",
        "version": 1,
        "reason": "not_found"
      }
    ]
  }
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | 0 on success; batch operations still require checking each item result. |
| `data` | object | [Corresponding response object](objects.md#responses). |

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

## Error responses

[Errors and result confirmation](boundaries.md#errors) distinguishes whole-request failure, per-item failure, and invisible sources.
