更新凭据
/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必填access_tokenstring可选Updated OAuth access token. Not used when type is static_bearer, environment_variable.
expires_atstring可选A timestamp in RFC 3339 format Not used when type is static_bearer, environment_variable.
refreshobject可选Parameters for updating OAuth refresh token configuration. Not used when type is static_bearer, environment_variable.
tokenstring可选Updated static bearer token value. Not used when type is mcp_oauth, environment_variable.
injection_locationobject可选Updated injection location. Not used when type is mcp_oauth, static_bearer.
networkingobject可选Updated networking scope. Full replacement. Not used when type is mcp_oauth, static_bearer.
secret_valuestring可选Updated secret value. Not used when type is mcp_oauth, static_bearer.
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 格式返回,参见 错误码
请求示例
curl
curl https://api.deepraxis.com/anthropic/v1/vaults/vlt_123/credentials/vsec_123 \
-H "x-api-key: $PRAXIS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: managed-agents-2026-04-01" \
-H "Content-Type: application/json" \
-d '{"metadata":{"team":"docs"}}'Python
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.deepraxis.com/anthropic",
api_key="$PRAXIS_API_KEY",
)
result = client.beta.vaults.credentials.update("vsec_123", vault_id='vlt_123', metadata={'team': 'docs'})
print(result)TypeScript
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.deepraxis.com/anthropic",
apiKey: "$PRAXIS_API_KEY",
});
const result = await client.beta.vaults.credentials.update("vsec_123", {
"vault_id": "vlt_123",
"metadata": {
"team": "docs"
}
});
console.log(result);响应示例 200
{
"id": "vsec_33fbcd3aebec462da14c6aba91a66219",
"type": "vault_credential",
"vault_id": "vlt_95e96f6f23dd406595834f2951239d55",
"display_name": "walk-vault-r1-docs2-credential",
"metadata": {
"team": "docs"
},
"auth": {
"type": "environment_variable",
"secret_name": "GITHUB_TOKEN",
"networking": {
"type": "limited",
"allowed_hosts": [
"api.github.com"
]
},
"injection_location": {
"header": true,
"body": true
}
},
"created_at": "2026-10-12T11:36:10.622Z",
"updated_at": "2026-10-12T11:36:13.822Z",
"archived_at": null
}响应
HTTP 200
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the credential. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| auth | object | Authentication details for a credential. |
| auth.mcp_server_url | string | URL of the MCP server this credential authenticates against. |
| auth.type | string | |
| auth.expires_at | null | string | A timestamp in RFC 3339 format |
| auth.refresh | null | object | OAuth refresh token configuration returned in credential responses. |
| auth.injection_location | object | Where in the outbound request the secret value is substituted. |
| auth.networking | object | Outbound hosts the secret value is substituted on. |
| auth.secret_name | string | Name of the environment variable. |
| created_at | string | A timestamp in RFC 3339 format |
| metadata | object | Arbitrary key-value metadata attached to the credential. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_id | string | Identifier of the vault this credential belongs to. |
| display_name | null | string | Human-readable name for the credential. |