Disconnect plugin account authorization

Disconnect plugin account authorization while retaining the connection record.

POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/plugin-connections/{connection_id}/disconnect

Before you call this API

Prepare the target workspace ID and a personal access token with access to the resources and permission for this action. Use actual resource identifiers for workspace_id and connection_id in the path. Also set X-Workspace-ID to that workspace ID. The example uses jq to construct JSON; install it first. See common objects and inputs for environment variable sources.

Request body

curl -X POST "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/plugin-connections/$CONNECTION_ID/disconnect" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  --data-binary "$(jq -n --argjson GENERATION "$GENERATION" '
{
  "expected_generation": $GENERATION
}
')"

This action revokes local authorization state without deleting the connection or plugin installation. Read the latest generation, submit, then reread disconnected and the new generation. Managed sessions also require executor cleanup. Provider revocation may happen later; local disconnection does not mean provider revocation has completed.

Field

Type

Required

Description

expected_generation

integer

Yes

generation from the latest authorization state; must be greater than 0.

JSON objects reject unknown fields, duplicate keys, and multiple consecutive objects. The entire request body must not exceed 1 MiB.

Successful response

{
  "code": 0,
  "data": {
    "status": "disconnected"
  }
}

Field

Type

Description

code

integer

0 on success.

data

object

Data returned by this action.

data.status

string

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

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