Query GitHub tool connection¶
Query the GitHub tool connection status of the current workspace. This interface only returns the credential reference and status, not the access token.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/tools/github/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¶
curl "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/tools/github/connect" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID. |
Successful response¶
{
"code": 0,
"data": {
"tool_id": "moi.github.tools",
"status": "disconnected",
"requires_reconnect": false
}
}
{
"code": 0,
"data": {
"tool_id": "moi.github.tools",
"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 still returns the disconnected status successfully.
When a connection is available, the response contains a credential reference and establishment time:
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
GitHub built-in tool identification. |
|
string |
|
|
string |
Credentials reference when the connection is available or needs to be reconnected. Does not return when not connected. |
|
string |
The original connection establishment time. Does not return when not connected. |
|
boolean |
|
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Common reasons: The workspace ID is invalid. Recommended Action: Check the path parameters. |
|
|
Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key. |
|
|
Common reasons: The current identity does not have permission to read the tool connection. Recommended Action: Check the workspace authorization. |
|
|
Common reasons: The GitHub tool connection service or authorization dependency is temporarily unavailable. Recommended Action: Try again later. |