Query email tool connection

Query the email tool connection status of the current workspace. This interface does not return passwords.

HTTP
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/tools/mail/{provider}/connect

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace.

Request parameters

Shell
curl "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/tools/mail/qq/connect" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameter

Type

Required

Description

workspace_id

string

Yes

Current workspace ID.

provider

string

Yes

Email provider to query: qq or wecom.

Successful response

JSON
{
  "code": 0,
  "data": {
    "tool_id": "moi.qq.mail",
    "provider": "qq",
    "status": "disconnected",
    "requires_reconnect": false
  }
}
JSON
{
  "code": 0,
  "data": {
    "tool_id": "moi.qq.mail",
    "provider": "qq",
    "email": "user@example.com",
    "credential_ref": "cred_01",
    "status": "connected",
    "connected_at": "2026-01-02T15:04:05Z",
    "requires_reconnect": false
  }
}

Returns 200 on success. When the connection is not saved, the interface returns to disconnected status.

When connection is available:

Field

Type

Description

code

integer

0 on success.

data.tool_id

string

Email built-in tool identification and provider.

data.provider

string

Email built-in tool identification and provider.

data.email

string

Saved email address. May not be returned if not connected or if credentials are not available.

data.status

string

connected, disconnected or needs_reconnect.

data.credential_ref

string

Credential reference and connection time. Does not return when not connected.

data.connected_at

string

Credential reference and connection time. Does not return when not connected.

data.requires_reconnect

boolean

true when credentials are not available.

Error response

JSON
{
  "code": 2,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

Common reasons: provider or the workspace ID is invalid. Recommended Action: provider Use only qq or wecom and check the path parameters.

401

6(UNAUTHENTICATED)

Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key.

403

5(PERMISSION_DENIED)

Common reasons: The current identity does not have permission to read the tool connection. Recommended Action: Check the workspace authorization.

503

15(UNAVAILABLE)

Common reasons: The email connection service or authorization dependency is temporarily unavailable. Recommended Action: Try again later.

Last updated on