Backfill historical agent artifacts

Create missing agent artifact records from existing files that meet source requirements.

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

Before you call this API

BASE_URL uses the product API prefix https://api.moi.matrixorigin.cn/v5. For a dedicated deployment, use its corresponding product API address.

Prepare identity, volume privileges, and version references.

Request

curl --request POST \
  "$BASE_URL/workspaces/$WORKSPACE_ID/agent-artifacts/backfill" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data '{"dry_run":true,"limit":200}'

Execution example after confirming the write:

curl --request POST \
  "$BASE_URL/workspaces/$WORKSPACE_ID/agent-artifacts/backfill" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data '{"dry_run":false,"limit":200}'

Parameter

Location

Type

Required

Description

workspace_id

Path

string

Yes

Workspace ID in the current environment.

dry_run

Body

boolean

No

Defaults to false and performs writes. true only counts candidates.

limit

Body

integer

No

Defaults to 200; 0 also means 200. Maximum 1000; negative values or values above 1000 are rejected.

Run dry_run=true first to inspect candidates. Run the false example only after confirming writes. An empty object, JSON null, no request body, or Content-Length of 0 uses false. An empty body of unknown length may be rejected during binding. dry-run skipped equals scanned candidates, not records that already existed. Backfill neither reruns the agent nor restores lost files.

Successful response

{
  "code": 0,
  "data": {
    "scanned": 1,
    "inserted": 0,
    "skipped": 1,
    "failed": 0,
    "dry_run": true
  }
}

Field

Type

Description

code

integer

0 on success; batch operations still require checking each item.

data

object

Corresponding response object.

Error response

Errors and result confirmation distinguishes overall failures, item failures, and invisible sources.

Last updated on