Delete mail tool connection¶
Delete the mail tool connections and associated credentials saved in the current workspace. The interface returns a disconnected status even if there is no current connection.
DELETE https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/tools/mail/{provider}/connect
Before you call¶
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.
The request body of this interface must be empty.
Request example¶
curl -X DELETE "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/tools/mail/qq/connect" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
Mail provider to disconnect: |
Successful response¶
Returns 200 on success. After disconnection, subsequent mail tool calls cannot continue to use the deleted connection credentials.
{
"code": 0,
"data": {
"tool_id": "moi.qq.mail",
"provider": "qq",
"status": "disconnected",
"requires_reconnect": false
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Email built-in tool ID and provider. |
|
string |
Email built-in tool ID and provider. |
|
string |
|
|
boolean |
|
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
|
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to manage tool connections. |
Check workspace authorization. |
|
|
The email connection service or authorization dependency is temporarily unavailable. |
Try again later. |
Follow-up operations¶
Query tool tag, confirm that the target no longer appears.