Update data source management settings¶
Updates a source’s label, expiration date, and activation status. The Catalog table source only supports updating the expiration time and activation status, and does not support labels or forced activation after expiration. Before updating the file source to enabled, confirm that the process has been created and that the vector table is visible to the current caller; otherwise the request will fail.
PATCH https://moi.matrixorigin.cn/newmoi/semantic-models/{model_id}/sources/{source_row_id}/governance
Preparation before calling¶
First query the data source list to obtain the source record 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: Knowledge Base ID.$SOURCE_ROW_ID: Source record ID to update.
Request example¶
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/semantic-models/$MODEL_ID/sources/$SOURCE_ROW_ID/governance" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"tags": ["product"]
}'
Path parameters¶
Parameters |
Type |
Description |
|---|---|---|
|
integer |
Knowledge base ID. |
|
string |
Source record ID. |
Request body¶
Governance settings such as label, expiration time, enabled, and forced activation after expiration can be submitted. You can set the label for the file source first; when you need to change the enabled status, wait for the processing to be completed before submitting.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string[] |
No |
Override source tag. |
|
integer or null |
No |
Unix timestamp; passing in |
|
boolean |
No |
The enabled status of the configuration. |
|
boolean |
No |
Whether to force activation after the source expires. |
[] after a type means an array. For example, string[] is an array of strings.
Successful response¶
Returns 200 and the updated source on success. Read effective_enabled to determine actual availability, do not rely solely on submitted enabled.
{
"code": "OK",
"msg": "OK",
"data": {
"source": {
"row_id": "src_01",
"source_type": "file",
"model_id": 401,
"resource_id": "file_01",
"tags": ["product"],
"enabled": false,
"effective_enabled": false,
"governance_status": "managed"
}
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
The updated source record. |
|
string |
Source record ID. |
|
string |
Source type. |
|
string[] |
Updated label; may be omitted if not set. |
|
integer |
Unix timestamp of expiration time; |
|
boolean |
The enabled state of the configuration; |
|
boolean |
Current actual effective status. |
|
boolean |
Whether to force enable after expiration. |
|
string |
Current governance status. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "invalid governance parameters",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path ID, label, expiration, or enable field is invalid; the vector table for the file source has not been created or is not currently visible; or the label, |
For the file source, first query the processing status and document details, and then update |
|
|
The API Key is invalid or has expired. |
Check API Key. |
|
|
The caller does not have permission to update origin governance settings. |
Check workspace and object authorization. |
|
|
The knowledge base or source does not exist or is not visible to the current caller. |
Reconfirm the path ID. |
|
|
The service failed to update governance settings. |
Keep the desensitized response information and try again. |
Follow-up operations¶
Query data source list Confirm that the governance settings have taken effect.