Update channel instance¶
Partially updates an already created channel instance. Fields not provided remain unchanged.
PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/channels/{provider}/instances/{instance_id}
Before you call¶
First query the channel instance details and confirm the instance to be updated. Prepare a personal access token with access to the target workspace, target workspace ID, channel provider ID, and instance ID.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed through theX-Workspace-IDHeader and also asworkspace_idin the path.$PROVIDER: Channel Provider ID, asproviderin the path.$INSTANCE_ID: Channel instance ID to update, asinstance_idin the path.
channel_type must be provided consistent with the saved channel type.
Request example¶
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/channels/$PROVIDER/instances/$INSTANCE_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "生产告警通道"
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
|
string |
Yes |
Channel Provider ID. |
|
string |
Yes |
Channel instance ID. |
Request body¶
Updatable channel_type, name, description, config, secrets, visibility and labels.
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Channel type in Provider; must be consistent with the saved type when provided. |
|
string |
No |
Instance name. |
|
string |
No |
Example description. |
|
object |
No |
Non-sensitive configuration. |
|
object |
No |
Keys and other sensitive configuration. |
|
string |
No |
Visible range. |
|
object |
No |
Tag key-value pair. |
Successful response¶
Returns 200 and the updated instance on success. The new key will not be echoed in the response; after updating the configuration or keys, re-perform the connection test.
{
"code": 0,
"data": {
"id": "inst_01",
"workspace_id": "ws_01",
"provider": "wecom",
"channel_type": "wecom_mail",
"name": "生产告警通道",
"status": "active",
"credential_ref": "cred_01",
"updated_at": "2026-08-18T01:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Instance ID and workspace. |
|
string |
Instance ID and workspace. |
|
string |
Provider, channel type and current status. |
|
string |
Provider, channel type and current status. |
|
string |
Provider, channel type and current status. |
|
string |
Updated name, description, and non-sensitive configuration. |
|
string |
Updated name, description, and non-sensitive configuration. |
|
object |
Updated name, description, and non-sensitive configuration. |
|
string |
Credential reference, not clear text key. |
|
string |
Last updated time, using RFC 3339 format. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid instance ID, provider, channel type, configuration, or key. |
Check the path and make sure |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to update the instance. |
Check workspace authorization. |
|
|
The instance does not exist or does not belong to the Provider in the path. |
Check the Provider and Instance ID. |
|
|
Channel instance services or authorization dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Test the created channel instance after updating the key or connection configuration.