Get plugin account authorization status¶
Read a plugin account’s authorization state, connection version, and authorization generation.
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/plugin-connections/{connection_id}/authorization
Before you call this API¶
Prepare the target workspace ID and a personal access token with resource access and permission for this action. Use actual resource identifiers for path workspace_id and connection_id, and put the workspace ID in X-Workspace-ID. See common objects and inputs for environment variable sources.
Path parameters¶
curl -X GET "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/plugin-connections/$CONNECTION_ID/authorization" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
An active connection does not mean the account is authorized. Without an authorization record, the response is not_connected with generation/revision 0. Not every authorization method returns attempt_id. Retain a nonempty attempt ID obtained from the authorization action.
This action accepts no request body.
Successful response¶
{
"code": 0,
"data": {
"workspace_id": "workspace_example",
"connection_id": "connection_example",
"status": "not_connected",
"generation": 0,
"revision": 0,
"connection_version": 1
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
0 on success. |
|
object |
Data returned by this action. |
|
string |
Resource fields; see common objects and states. |
|
string |
Resource fields; see common objects and states. |
|
string |
Current state; assess it using this page’s conditions and common objects. |
|
integer |
Authorization generation, used as expected_generation for disconnect. May be 0 before authorization. |
|
integer |
Resource fields; see common objects and states. |
|
integer |
Resource fields; see common objects and states. |
Error responses¶
Handle business errors with numeric code, message, and details.reason separately from authorization-layer errors with string codes. See errors and states. On state or version conflicts, read the current resource before changing identifiers or retrying writes.