Query Grafana tool connection¶
Query the Grafana tool connection status of the current workspace. This interface does not return the service account token.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/tools/grafana/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.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/tools/grafana/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. |
Successful response¶
Returns 200 on success. When the connection is not saved, the interface returns to the disconnected state.
{
"code": 0,
"data": {
"tool_id": "moi.grafana.tools",
"status": "disconnected",
"requires_reconnect": false
}
}
When connection is available:
{
"code": 0,
"data": {
"tool_id": "moi.grafana.tools",
"grafana_url": "https://grafana.example.com",
"credential_ref": "cred_01",
"status": "connected",
"connected_at": "2026-01-02T15:04:05Z",
"requires_reconnect": false
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Grafana built-in tool identifier. |
|
string |
The saved base URL; may not be returned if connection is unavailable. |
|
string |
|
|
string |
Credential reference and connection time; not returned if not connected. |
|
string |
Credential reference and connection time; not returned if not connected. |
|
boolean |
|
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid workspace ID. |
Check path parameters. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to read the tool connection. |
Check workspace authorization. |
|
|
Grafana tool connection service or authorization dependency is temporarily unavailable. |
Try again later. |
Follow-up operations¶
When modifications are needed Update tool. When returning the list Query tool tag.