Query data source list¶
Paginated query of data sources and their processing status in the knowledge base. The returned source record ID is an input parameter for subsequent details, governance, segmentation, and deletion interfaces.
GET https://moi.matrixorigin.cn/newmoi/semantic-models/{model_id}/sources
Preparation before calling¶
First query the knowledge base list to obtain the knowledge base ID. 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 theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$MODEL_ID: ID of the knowledge base to be queried.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/semantic-models/$MODEL_ID/sources?page=1&page_size=20" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Description |
|---|---|---|
|
integer |
Knowledge base ID. |
Query parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
Page number, must be a positive integer. |
|
integer |
No |
The number of items on a single page, ranging from |
Successful response¶
Returns 200 on success. Save data.items[].row_id; it is used by subsequent details, governance, segmentation, and deletion interfaces.
{
"code": "OK",
"msg": "OK",
"data": {
"items": [
{
"row_id": "src_01",
"source_type": "file",
"model_id": 401,
"resource_id": "file_01",
"display_name": "product-guide.pdf",
"path": ["docs", "product-guide.pdf"],
"ingest_status": "ready",
"enabled": true,
"effective_enabled": true,
"segment_version_id": "ver_02",
"index_version": 2,
"governance_status": "managed"
}
],
"total": 1,
"page": 1,
"page_size": 20,
"legacy_backfill_required": false
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object[] |
Current page source record. |
|
string |
Source record ID. |
|
string |
Source type: |
|
integer |
ID of the knowledge base. |
|
string |
Source resource ID. |
|
string |
Display name. |
|
string[] |
Source path. |
|
string |
Source processing status. |
|
boolean |
Configured enabled status. |
|
boolean |
Actual effective status. |
|
string |
Current segment version; may be empty if not generated. |
|
integer |
Current index version; may be empty if not generated. |
|
string |
Processing error summary; may be empty if there are no errors. |
|
string |
Source governance status. |
|
integer |
Total number of source records matching the criteria. |
|
integer |
Current page number. |
|
integer |
Current page size. |
|
boolean |
Whether the old source relationship needs to be completed. |
In this document, [] after a type means an array; for example, string[] is an array of strings. In field paths, [] means each item in an array; for example, data.items[].row_id is the row_id field of each item in data.items.
Read next page¶
Calculate the last page based on data.total and page_size at the time of request, and then add page in sequence.
Error response¶
{
"code": "ErrParamInvalid",
"msg": "page_size is invalid",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Correct the paging parameters and try again. |
|
|
The API Key is invalid or has expired. |
Check API Key. |
|
|
The caller does not have permission to read the source. |
Check workspace and object authorization. |
|
|
The knowledge base does not exist or is not visible. |
Reconfirm |
|
|
The service failed to query the source. |
Keep the desensitized response information and try again. |
Follow-up operations¶
When legacy_backfill_required is marked as needing to be supplemented, first Complete the relationship between historical data sources; otherwise, Update data source management settings or Delete data source.