Update connection¶
Update the agent connection’s metadata, endpoint, or credential configuration.
PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/connections/{connection_id}
Before you call¶
The examples below use $AI_STUDIO_API_KEY, $WORKSPACE_ID, and $CONNECTION_ID.
Request example¶
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/connections/$CONNECTION_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "新的 MCP 服务"
}'
Request body¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Connection name. |
|
string |
No |
Connection instructions. |
|
string |
No |
Connection status. |
|
string |
No |
Connection type. |
|
string |
No |
Connection service address. |
|
string |
No |
Authentication type. |
|
string |
No |
A reference to a saved credential. |
|
string[] |
No |
List of connection capabilities. |
|
string |
No |
Connection owner user ID. |
|
string |
No |
Visible range. |
|
object |
No |
Connection configuration. |
|
object |
no |
Label. |
|
object |
No |
Comment. |
|
object |
No |
Extended metadata. |
|
object |
No |
Credentials, which can contain |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
Returns 200 and the updated connection on success.
{"code":0,"data":{"id":"connection_01","name":"新的 MCP 服务"}}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
Connection ID. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{"code":5,"message":"connection not found"}