Claude Platform Docs

插件

创建插件
client.beta.organization.plugins.create(params, options?): BetaPlugin
POST/v1/organizations/plugins

通过上传版本文件,创建组织拥有的插件及其第一个版本。

获取插件
client.beta.organization.plugins.retrieve(pluginID, params?, options?): BetaPlugin
GET/v1/organizations/plugins/{plugin_id}

按 ID 检索插件。

更新插件
client.beta.organization.plugins.update(pluginID, params, options?): BetaPlugin
POST/v1/organizations/plugins/{plugin_id}

更改向成员提供的组织所有插件的已存储版本,例如回滚到较早的版本。此操作会固定所提供的版本:之后上传的版本仍会被存储,但不再改变所提供的内容,并且固定目前无法撤销,无论是在此处还是在 claude.ai 中。

列出插件
client.beta.organization.plugins.list(params?, options?): PageCursor<BetaPlugin>
GET/v1/organizations/plugins

列出在组织下创建的插件,按从新到旧排序:包括组织自有插件市场中的插件以及成员个人插件市场中的插件。

删除插件
client.beta.organization.plugins.delete(pluginID, params?, options?): BetaDeletedPlugin
DELETE/v1/organizations/plugins/{plugin_id}

永久删除一个插件及其包含的所有版本,效果与管理员在 claude.ai 中删除它完全相同。该插件可以属于组织,也可以属于某个成员,包括此后已离开组织的成员。

Models
interface BetaDeletedPlugin { type: "plugin_deleted"; id }
type: "plugin_deleted"

Always plugin_deleted.

defaultplugin_deleted
id: string

The deleted Plugin's ID.

interface BetaPlugin { type: "plugin"; id; components; /* 16 more */ }
interface BetaPluginAPIActor { type: "api_actor"; api_key_id }
type: "api_actor"

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

defaultapi_actor
api_key_id: string

The key's ID.

interface BetaPluginComponent { type; description; name }
type: "agent" | "cli" | "command" | 3 more

The kind of component.

One of the following:
"agent"
"cli"
"command"
"hook"
"mcp_server"
"skill"
description: string | null

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.

interface BetaPluginContentScan { assessment; reason; status }
assessment: "fail" | "pass" | "unknown" | "warn" | null

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

One of the following:
"fail"
"pass"
"unknown"
"warn"
reason: string | null

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: "completed" | "errored" | "processing"

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:
"completed"
"errored"
"processing"
interface BetaPluginOwnerOrganization { type: "organization" }
type: "organization"

The Plugin lives in a plugin marketplace the organization owns.

defaultorganization
interface BetaPluginOwnerUser { type: "user"; user_id }
type: "user"

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

defaultuser
user_id: string

The member's User ID.

interface BetaPluginTargetOrganization { type: "organization" }
type: "organization"

Every member of the organization.

defaultorganization
interface BetaPluginTargetOrganizationMember { type: "organization_member"; user_id }
type: "organization_member"

One member of the organization.

defaultorganization_member
user_id: string

The member's User ID.

interface BetaPluginTargetRBACGroup { type: "rbac_group"; rbac_group_id }
type: "rbac_group"

An RBAC Group.

defaultrbac_group
rbac_group_id: string

The RBAC Group's ID.

interface BetaPluginUserActor { type: "user_actor"; email_address; user_id }
type: "user_actor"

A member of the organization.

defaultuser_actor
email_address: string | null

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

user_id: string

The member's User ID.

插件版本

创建插件版本
client.beta.organization.plugins.versions.create(pluginID, params, options?): BetaPluginVersion
POST/v1/organizations/plugins/{plugin_id}/versions

通过上传新版本的文件为组织所有的插件添加一个版本;除非该插件的提供版本已被固定,否则新版本将成为向成员提供的版本。

列出插件版本
client.beta.organization.plugins.versions.list(pluginID, params?, options?): PageCursor<BetaPluginVersion>
GET/v1/organizations/plugins/{plugin_id}/versions

列出插件的版本,按从新到旧排序。

获取插件版本
client.beta.organization.plugins.versions.retrieve(version, params, options?): BetaPluginVersion
GET/v1/organizations/plugins/{plugin_id}/versions/{version}

按 ID 检索插件的某个版本,或检索插件的最新版本。

下载插件版本归档
client.beta.organization.plugins.versions.download(version, params, options?): Response
GET/v1/organizations/plugins/{plugin_id}/versions/{version}/content

按原样下载某个版本的 .zip 归档文件。每次从成员个人插件市场下载插件都会记录在 Compliance API 活动源中。

插件安装设置

列出插件安装设置
client.beta.organization.plugins.installationSettings.list(pluginID, params?, options?): PageCursor<BetaPluginInstallationSetting>
GET/v1/organizations/plugins/{plugin_id}/installation_settings

列出组织所有插件的安装设置(这些设置说明插件面向哪些成员),按创建时间从新到旧排序。

设置插件安装设置
client.beta.organization.plugins.installationSettings.set(target, params, options?): BetaPluginInstallationSetting
POST/v1/organizations/plugins/{plugin_id}/installation_settings/{target}

为整个组织或某个 RBAC 组设置或更改组织所有插件的安装设置。

移除插件安装设置
client.beta.organization.plugins.installationSettings.remove(target, params, options?): BetaDeletedPluginInstallationSetting
DELETE/v1/organizations/plugins/{plugin_id}/installation_settings/{target}

移除组织所有插件针对整个组织或某个 RBAC 组的自身安装设置。

插件共享

列出插件共享
client.beta.organization.plugins.shares.list(pluginID, params?, options?): PageCursor<BetaPluginShare>
GET/v1/organizations/plugins/{plugin_id}/shares

列出成员所有插件的所有者所授予的共享(共享给组织的所有成员、某个 RBAC 组或某个成员),按授予时间从新到旧排序。