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

code

integer

0 on success.

data

object

Data returned by this action.

data.workspace_id

string

Resource fields; see common objects and states.

data.connection_id

string

Resource fields; see common objects and states.

data.status

string

Current state; assess it using this page’s conditions and common objects.

data.generation

integer

Authorization generation, used as expected_generation for disconnect. May be 0 before authorization.

data.revision

integer

Resource fields; see common objects and states.

data.connection_version

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.

Last updated on