AnthropicClaude 托管智能体

更新凭据

更新保险库中一条凭据的内容或配置。

POST /anthropic/v1/vaults/{vault_id}/credentials/{credential_id}◐ 部分支持

请求参数

  • vault_idstring必填

    path: 保险库 ID(路径或查询参数)。

  • credential_idstring必填

    path: 路径参数:凭据 ID。

  • vault_idstring必填

    query: 保险库 ID(路径或查询参数)。

  • authobject可选

    Updated authentication details for a credential.

    ▸ 展开子字段(8)
    • typestring必填
      取值 environment_variable
    • access_tokenstring可选

      Updated OAuth access token.

    • expires_atstring可选

      A timestamp in RFC 3339 format

    • refreshobject可选

      Parameters for updating OAuth refresh token configuration.

    • tokenstring可选

      Updated static bearer token value.

    • injection_locationobject可选

      Updated injection location.

    • networkingobject可选

      Updated networking scope. Full replacement.

    • secret_valuestring可选

      Updated secret value.

  • display_namestring可选

    Updated human-readable name for the credential. 1-255 characters.

  • metadataobject可选

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.

返回

200

支持 environment_variable 与 static_bearer。environment_variable 的 networking 只支持 limited,传 unrestricted 返回 400;secret_name 只能使用大写字母、数字和下划线,且不能以数字开头;injection_location 的默认值与官方一致。static_bearer 的令牌只在 mcp_server_url 所在主机上可用。创建或更新 mcp_oauth 返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试;需要 OAuth 令牌时请使用 /vault/v1/authorizations 一键授权。每个库最多 20 个有效凭据。以 anthropic. 开头的 metadata 键由平台保留,不能写入。

错误按 Claude Managed Agents 格式返回,参见 错误码

响应

HTTP 200

Successful response

application/json

名称类型说明
idstringUnique identifier for the credential.
archived_atnull | stringA timestamp in RFC 3339 format
authobjectAuthentication details for a credential.
auth.mcp_server_urlstringURL of the MCP server this credential authenticates against.
auth.typestring
auth.expires_atnull | stringA timestamp in RFC 3339 format
auth.refreshnull | objectOAuth refresh token configuration returned in credential responses.
auth.injection_locationobjectWhere in the outbound request the secret value is substituted.
auth.networkingobjectOutbound hosts the secret value is substituted on.
auth.secret_namestringName of the environment variable.
created_atstringA timestamp in RFC 3339 format
metadataobjectArbitrary key-value metadata attached to the credential.
typestring
updated_atstringA timestamp in RFC 3339 format
vault_idstringIdentifier of the vault this credential belongs to.
display_namenull | stringHuman-readable name for the credential.