Complete the relationship between historical data sources

A knowledge base created by an older version of the process might already have content available, but lack the records to manage the data sources. The “historical data source relationship” here is the association record between the knowledge base, its original files or data tables, and processing tasks; only after completion can the data source list, processing status, and subsequent governance operations identify these old data.

This operation only adds management records and does not re-upload or re-import the original data. Called only when query data source list returns legacy_backfill_required: true; routine calls are not required for newly created knowledge bases.

POST https://moi.matrixorigin.cn/newmoi/semantic-models/{model_id}/sources/backfill-legacy

Preparation before calling

First query the data source list, and confirm that legacy_backfill_required in the response is true. 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.

  • $MODEL_ID: The knowledge base ID to complete the historical source relationship.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/semantic-models/$MODEL_ID/sources/backfill-legacy" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameters

Type

Description

model_id

integer

The ID of the knowledge base to complete the historical source relationship.

Successful response

Returns 200 on success. After completion, query the data source list again to confirm the legacy_backfill_required status.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "updated": true
  }
}

The response fields are as follows.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.updated

boolean

true indicates that the completion operation has been completed.

Error response

{
  "code": "ErrNotFound",
  "msg": "resource not found",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

model_id is invalid.

Use the knowledge base ID from the response.

401

ErrUnauthorized

The API Key is invalid or has expired.

Check API Key.

403

ErrForbidden

The caller does not have permission to update the source.

Check workspace and object authorization.

404

ErrNotFound

The knowledge base does not exist or is not visible.

Reconfirm model_id.

500

ErrServer

The service failed to patch up the old source relationship.

Keep the desensitized response information and try again.

Follow-up operations

Query data source list Confirm the completed results.

Last updated on