更新外掛程式
變更向成員提供的組織擁有 Plugin 的已儲存版本,例如回復到較早的版本。這會釘選所提供的版本:之後上傳的版本仍會儲存,但不再改變所提供的內容,且目前無法取消釘選,無論在此處或在 claude.ai 中皆然。
以 served_version_id 傳入版本:傳入較早的版本以回復;傳入較新的版本,以開始提供一個已儲存但尚未提供的版本;或傳入目前已提供的版本,以在不改變所提供內容的情況下將其釘選。此操作不會建立新版本。
當組織已啟用內容掃描時,掃描仍在進行中的版本會以 409 拒絕(error_code scan_pending;請在掃描完成後重試),而掃描失敗、發生錯誤或未得出判定的版本會以 400 拒絕(scan_failed;warn 則會被接受)。當 Plugin 位於組織的程式庫市集中時,若目前所提供版本以外的版本中,有某個技能的名稱已被組織技能(管理員在 claude.ai 中為整個組織上傳的技能)佔用,該版本也會以 409 拒絕:error_code skill_name_taken,該名稱位於 details.skill_name。成員擁有的 Plugin 無法在此更新(403)。
此端點不會寫入安裝設定;安裝設定是在 /v1/organizations/plugins/{plugin_id}/installation_settings/{target} 寫入。
**接受的憑證:**具有 write:plugins 範圍的 Admin API 金鑰。
每個請求都必須包含 beta 標頭 anthropic-beta: ce-plugins-2026-09-01。缺少此標頭的請求會傳回 404,與端點不存在時完全相同。Plugins API 目前為 beta 版,僅供 Claude Enterprise 組織使用。Claude Platform(Claude Console)組織或已啟用 HIPAA 就緒功能的組織無法使用。
Parameters
Returns
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get(
"ANTHROPIC_API_KEY"
), # This is the default and can be omitted
)
beta_plugin = client.beta.organization.plugins.update(
plugin_id="plugin_id",
served_version_id="pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
)
print(beta_plugin.id){
"id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
"components": [
{
"description": "description",
"name": "review-pr",
"type": "skill"
}
],
"content_scan": {
"assessment": "warn",
"reason": "credential-exposure",
"status": "completed"
},
"created_at": "2026-03-14T09:26:53.589793Z",
"created_by": {
"email_address": "user@example.com",
"type": "user_actor",
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
},
"description": "Reviews pull requests against your team's conventions.",
"display_name": "Code Review Helper",
"latest_version_id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
"manifest_version": "1.2.0",
"marketplace_id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
"name": "code-review-helper",
"organization_installation_preference": "available",
"organization_installation_preference_inherited": true,
"owner": {
"type": "organization"
},
"reach": "contained",
"served_version_id": "pluginver_01K9wPcHd4Rm2Tx8Vq6Ln3Sb",
"served_version_pinned": true,
"type": "plugin",
"updated_at": "2026-03-14T09:26:53.589793Z"
}Returns Examples
{
"id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
"components": [
{
"description": "description",
"name": "review-pr",
"type": "skill"
}
],
"content_scan": {
"assessment": "warn",
"reason": "credential-exposure",
"status": "completed"
},
"created_at": "2026-03-14T09:26:53.589793Z",
"created_by": {
"email_address": "user@example.com",
"type": "user_actor",
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
},
"description": "Reviews pull requests against your team's conventions.",
"display_name": "Code Review Helper",
"latest_version_id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
"manifest_version": "1.2.0",
"marketplace_id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
"name": "code-review-helper",
"organization_installation_preference": "available",
"organization_installation_preference_inherited": true,
"owner": {
"type": "organization"
},
"reach": "contained",
"served_version_id": "pluginver_01K9wPcHd4Rm2Tx8Vq6Ln3Sb",
"served_version_pinned": true,
"type": "plugin",
"updated_at": "2026-03-14T09:26:53.589793Z"
}