Update Credential
Update one credential's content or configuration in a vault.
/anthropic/v1/vaults/{vault_id}/credentials/{credential_id}◐ PartialRequest parameters
vault_idstring必填path: Vault ID (path or query parameter).
credential_idstring必填path: Path parameter: the credential ID.
vault_idstring必填query: Vault ID (path or query parameter).
authobject可选Updated authentication details for a credential.
▸ 展开子字段(8)
typestring必填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.
Returns
200
Supports environment_variable and static_bearer. environment_variable networking supports limited only; unrestricted returns 400. secret_name may contain only uppercase letters, digits and underscores and cannot start with a digit. injection_location defaults match the official API. A static_bearer token is usable only on the host of its mcp_server_url. Creating or updating mcp_oauth returns 501 (not_implemented_error), produces no side effects, and the official SDK does not retry; use one-click authorization at /vault/v1/authorizations for OAuth tokens. A vault holds at most 20 active credentials. Metadata keys starting with anthropic. are reserved and cannot be written.
Errors follow the Claude Managed Agents format — see error codes
Response
HTTP 200
Successful response
application/json
| Name | Type | Description |
|---|---|---|
| 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. |