Update a connector¶
Update the name, purpose, data-source type, or configuration of a saved connector. Send only fields that need to change; all other fields retain their current values.
PUT https://moi.matrixorigin.cn/newmoi/connectors/{connector_id}
Before you call¶
First get connector details to confirm the connector to change. Prepare a personal access token that can access the target workspace, the target workspace ID, and the connector ID.
The example uses:
$AI_STUDIO_API_KEY: your personal access token, sent in theX-API-Keyheader.$WORKSPACE_ID: the target workspace ID, sent in theX-Workspace-IDheader.$CONNECTOR_ID: the connector ID to update.$NEW_CONNECTOR_NAME: the updated connector name.
When changing source_type or config, send the complete nested configuration that matches the target data-source type. For complete types, fields, and authentication branches, see Type-specific configuration fields for creating a connector. Do not send usage_type: 0 or an empty array; omit usage_type to retain the current purpose.
Request example¶
curl -X PUT "https://moi.matrixorigin.cn/newmoi/connectors/$CONNECTOR_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{
\"name\": \"$NEW_CONNECTOR_NAME\"
}"
Path parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Connector ID to update. |
Request body¶
All request-body fields are optional. The example changes only the connector name.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
New connector name. |
|
integer |
No |
New data-source type code. When changing it, also send the |
|
integer or integer[] |
No |
New purpose bitmask: |
|
object |
No |
Type-specific connection configuration. When sent, it replaces the saved connection configuration. For top-level keys and complete fields, see Type-specific configuration fields for creating a connector. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
When the response code is OK, the update request has completed. data is null; get connector details again to confirm the result.
{
"code": "OK",
"msg": "OK",
"data": null
}
Response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
This endpoint does not return the updated connector object. |
Error response¶
HTTP 200 does not necessarily mean that the update succeeded. Always check code; only code: "OK" means the update completed.
{
"code": "ErrParamInvalid",
"msg": "invalid connector parameters",
"data": null
}
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
|
|
Invalid JSON, a name with disallowed characters, or an invalid purpose value was submitted. |
Correct the request body and retry. |
|
|
The request or existing connector uses a data-source type that is not currently enabled. |
Select a currently available data-source type. |
|
|
The service could not update the connector. |
Check |
Next steps¶
This endpoint returns data: null on success. Use the same connector_id to get connector details and confirm its name, purpose, and status. If you changed the connection configuration, validate connector configuration before using it in tasks. To remove the connector, first confirm that it has no related tasks, then delete the connector.