Claude Platform Docs

外掛程式

建立外掛程式
client.Beta.Organization.Plugins.New(ctx, params) (*BetaPlugin, error)
POST/v1/organizations/plugins

上傳版本的檔案,以建立組織擁有的外掛程式(Plugin)及其 第一個版本。

取得外掛程式
client.Beta.Organization.Plugins.Get(ctx, pluginID, params) (*BetaPlugin, error)
GET/v1/organizations/plugins/{plugin_id}

依 ID 擷取外掛程式。

更新外掛程式
client.Beta.Organization.Plugins.Update(ctx, pluginID, params) (*BetaPlugin, error)
POST/v1/organizations/plugins/{plugin_id}

變更向成員提供的組織擁有 Plugin 的已儲存版本,例如回復到較早的版本。這會釘選所提供的版本:之後上傳的版本仍會儲存,但不再改變所提供的內容,且目前無法取消釘選,無論在此處或在 claude.ai 中皆然。

列出 Plugin
client.Beta.Organization.Plugins.List(ctx, params) (*PageCursor[BetaPlugin], error)
GET/v1/organizations/plugins

列出在組織下建立的 Plugin,依最新優先排序:包括組織自有外掛程式市集中的 Plugin,以及成員個人外掛程式市集中的 Plugin。

刪除 Plugin
client.Beta.Organization.Plugins.Delete(ctx, pluginID, body) (*BetaDeletedPlugin, error)
DELETE/v1/organizations/plugins/{plugin_id}

永久刪除 Plugin 及其所有版本,效果與管理員在 claude.ai 中刪除時完全相同。該 Plugin 可以屬於組織或成員,包括已離開組織的成員。

Models
type BetaDeletedPlugin struct { Type: "plugin_deleted"; ID }
Type PluginDeleted

Always plugin_deleted.

defaultplugin_deleted
ID string

The deleted Plugin's ID.

type BetaPlugin struct { Type: "plugin"; ID; Components; /* 16 more */ }
type BetaPluginAPIActor struct { Type: "api_actor"; APIKeyID }
Type APIActor

An Admin API key, in the same form the Compliance API activity feed uses for it.

defaultapi_actor
APIKeyID string

The key's ID.

type BetaPluginComponent struct { Type; Description; Name }
Type BetaPluginComponentType

The kind of component.

One of the following:
const BetaPluginComponentTypeAgent BetaPluginComponentType = "agent"
const BetaPluginComponentTypeCli BetaPluginComponentType = "cli"
const BetaPluginComponentTypeCommand BetaPluginComponentType = "command"
const BetaPluginComponentTypeHook BetaPluginComponentType = "hook"
const BetaPluginComponentTypeMCPServer BetaPluginComponentType = "mcp_server"
const BetaPluginComponentTypeSkill BetaPluginComponentType = "skill"
Description string

What the component declares about itself; always null for MCP servers, hooks, and CLIs.

Name string

The component's name: a skill's, command's or agent's name, an MCP server's key in the manifest, the event a hook runs on, or a CLI's executable.

type BetaPluginContentScan struct { Assessment; Reason; Status }
Assessment BetaPluginContentScanAssessment

The scan's verdict; set only when status is completed.

One of the following:
const BetaPluginContentScanAssessmentFail BetaPluginContentScanAssessment = "fail"
const BetaPluginContentScanAssessmentPass BetaPluginContentScanAssessment = "pass"
const BetaPluginContentScanAssessmentUnknown BetaPluginContentScanAssessment = "unknown"
const BetaPluginContentScanAssessmentWarn BetaPluginContentScanAssessment = "warn"
Reason string

The primary mechanism behind a warn or fail, such as credential-exposure or guardrail-tampering; a mechanism this API does not yet name reads as other. Null on a pass, whenever assessment is null, and when no mechanism is reported for the verdict.

Status BetaPluginContentScanStatus

processing while a scan runs, completed when it ran to completion, errored when it could not run or its outcome cannot be read.

One of the following:
const BetaPluginContentScanStatusCompleted BetaPluginContentScanStatus = "completed"
const BetaPluginContentScanStatusErrored BetaPluginContentScanStatus = "errored"
const BetaPluginContentScanStatusProcessing BetaPluginContentScanStatus = "processing"
type BetaPluginOwnerOrganization struct { Type: "organization" }
Type Organization

The Plugin lives in a plugin marketplace the organization owns.

defaultorganization
type BetaPluginOwnerUser struct { Type: "user"; UserID }
Type User

The Plugin lives in one member's personal plugin marketplace.

defaultuser
UserID string

The member's User ID.

type BetaPluginTargetOrganization struct { Type: "organization" }
Type Organization

Every member of the organization.

defaultorganization
type BetaPluginTargetOrganizationMember struct { Type: "organization_member"; UserID }
Type OrganizationMember

One member of the organization.

defaultorganization_member
UserID string

The member's User ID.

type BetaPluginTargetRBACGroup struct { Type: "rbac_group"; RBACGroupID }
Type RBACGroup

An RBAC Group.

defaultrbac_group
RBACGroupID string

The RBAC Group's ID.

type BetaPluginUserActor struct { Type: "user_actor"; EmailAddress; UserID }
Type UserActor

A member of the organization.

defaultuser_actor
EmailAddress string

The member's email address; may be null, for example when they are no longer a member of the organization.

UserID string

The member's User ID.

外掛程式版本

建立 Plugin 版本
client.Beta.Organization.Plugins.Versions.New(ctx, pluginID, params) (*BetaPluginVersion, error)
POST/v1/organizations/plugins/{plugin_id}/versions

透過上傳新版本的檔案,為組織擁有的 Plugin 新增版本;除非該 Plugin 所提供的版本已被釘選,否則新版本會成為向成員提供的版本。

列出 Plugin 版本
client.Beta.Organization.Plugins.Versions.List(ctx, pluginID, params) (*PageCursor[BetaPluginVersion], error)
GET/v1/organizations/plugins/{plugin_id}/versions

列出 Plugin 的版本,依最新優先排序。

取得 Plugin 版本
client.Beta.Organization.Plugins.Versions.Get(ctx, version, params) (*BetaPluginVersion, error)
GET/v1/organizations/plugins/{plugin_id}/versions/{version}

依 ID 擷取 Plugin 的某個版本,或擷取 Plugin 的最新版本。

下載 Plugin 版本封存檔
client.Beta.Organization.Plugins.Versions.Download(ctx, version, params) (*Response, error)
GET/v1/organizations/plugins/{plugin_id}/versions/{version}/content

下載某個版本的 .zip 封存檔,內容與儲存時完全相同。每次從成員個人外掛程式市集下載 Plugin,都會記錄在 Compliance API 活動摘要中。

外掛程式安裝設定

列出 Plugin 安裝設定
client.Beta.Organization.Plugins.InstallationSettings.List(ctx, pluginID, params) (*PageCursor[BetaPluginInstallationSetting], error)
GET/v1/organizations/plugins/{plugin_id}/installation_settings

列出組織擁有的 Plugin 的安裝設定(用於指定該 Plugin 適用於哪些成員),依建立時間由新到舊排序。

設定 Plugin 安裝設定
client.Beta.Organization.Plugins.InstallationSettings.Set(ctx, target, params) (*BetaPluginInstallationSetting, error)
POST/v1/organizations/plugins/{plugin_id}/installation_settings/{target}

為整個組織或單一 RBAC 群組設定或變更組織擁有的 Plugin 的安裝設定。

移除 Plugin 安裝設定
client.Beta.Organization.Plugins.InstallationSettings.Remove(ctx, target, params) (*BetaDeletedPluginInstallationSetting, error)
DELETE/v1/organizations/plugins/{plugin_id}/installation_settings/{target}

移除組織擁有的 Plugin 針對整個組織或單一 RBAC 群組本身的安裝設定。

外掛程式分享

列出 Plugin 分享
client.Beta.Organization.Plugins.Shares.List(ctx, pluginID, params) (*PageCursor[BetaPluginShare], error)
GET/v1/organizations/plugins/{plugin_id}/shares

列出成員擁有的 Plugin 的擁有者所提供的分享(分享給組織的所有成員、某個 RBAC 群組或單一成員),依授予時間由新到舊排序。