Archive Credential API

Trust: ★★★☆☆ (0.90) · 0 validations · developer_reference

Published: 2026-05-10 · Source: crawler_authoritative

Tình huống

API reference for archiving credentials stored in a vault using the Anthropic Python SDK. Targets developers integrating with Anthropic’s managed credentials system.

Insight

The archive credential endpoint archives an existing credential within a vault. The method signature is beta.vaults.credentials.archive(str credential_id, CredentialArchiveParams **kwargs) -> BetaManagedAgentsCredential. It accepts a credential_id as a path parameter and supports optional beta header parameters through betas. The beta parameters include numerous version identifiers such as ‘message-batches-2024-09-24’, ‘prompt-caching-2024-07-31’, ‘computer-use-2024-10-22’, ‘computer-use-2025-01-24’, ‘pdfs-2024-09-25’, ‘token-counting-2024-11-01’, ‘token-efficient-tools-2025-02-19’, ‘output-128k-2025-02-19’, ‘files-api-2025-04-14’, ‘mcp-client-2025-04-04’, ‘mcp-client-2025-11-20’, ‘dev-full-thinking-2025-05-14’, ‘interleaved-thinking-2025-05-14’, ‘code-execution-2025-05-22’, ‘extended-cache-ttl-2025-04-11’, ‘context-1m-2025-08-07’, ‘context-management-2025-06-27’, ‘model-context-window-exceeded-2025-08-26’, ‘skills-2025-10-02’, ‘fast-mode-2026-02-01’, ‘output-300k-2026-03-24’, ‘user-profiles-2026-03-24’, ‘advisor-tool-2026-03-01’, and ‘managed-agents-2026-04-01’. The response returns a BetaManagedAgentsCredential object with fields including id, archived_at (RFC 3339 timestamp), auth (authentication details), created_at, metadata (Dict[str, str]), type (always ‘vault_credential’), updated_at, vault_id, and display_name. Supported auth types include BetaManagedAgentsMCPOAuthAuthResponse for OAuth credentials (with token endpoint auth types: ‘none’, ‘client_secret_basic’, ‘client_secret_post’) and BetaManagedAgentsStaticBearerAuthResponse for static bearer tokens. Sensitive fields are never returned in responses.

Hành động

To archive a credential, create an Anthropic client and call client.beta.vaults.credentials.archive() with a valid credential_id and vault_id. Both IDs are required path parameters. The vault_id identifies the vault containing the credential, while credential_id is the unique identifier of the credential to archive. Optionally pass beta version identifiers via the betas parameter. Example: client.beta.vaults.credentials.archive(credential_id='vcrd_011CZkZEMt8gZan2iYOQfSkw', vault_id='vlt_011CZkDLs7fYzm1hXNPeRjv'). The method returns the archived credential object with an archived_at timestamp populated.

Kết quả

Returns a BetaManagedAgentsCredential object representing the archived credential. The archived_at field will be populated with an RFC 3339 timestamp. Sensitive authentication fields are never returned in responses.

Điều kiện áp dụng

This is a beta API. Requires valid vault_id and credential_id. Credential IDs follow the format ‘vcrd_…’ and vault IDs follow ‘vlt_…‘.


Nội dung gốc (Original)

Archive

beta.vaults.credentials.archive(strcredential_id, CredentialArchiveParams**kwargs) -> BetaManagedAgentsCredential

post /v1/vaults/{vault_id}/credentials/{credential_id}/archive

Archive Credential

Parameters

  • vault_id: str

  • credential_id: str

  • betas: Optional[List[AnthropicBetaParam]]

    Optional header to specify the beta version(s) you want to use.

    • str

    • Literal["message-batches-2024-09-24", "prompt-caching-2024-07-31", "computer-use-2024-10-22", 21 more]

      • "message-batches-2024-09-24"

      • "prompt-caching-2024-07-31"

      • "computer-use-2024-10-22"

      • "computer-use-2025-01-24"

      • "pdfs-2024-09-25"

      • "token-counting-2024-11-01"

      • "token-efficient-tools-2025-02-19"

      • "output-128k-2025-02-19"

      • "files-api-2025-04-14"

      • "mcp-client-2025-04-04"

      • "mcp-client-2025-11-20"

      • "dev-full-thinking-2025-05-14"

      • "interleaved-thinking-2025-05-14"

      • "code-execution-2025-05-22"

      • "extended-cache-ttl-2025-04-11"

      • "context-1m-2025-08-07"

      • "context-management-2025-06-27"

      • "model-context-window-exceeded-2025-08-26"

      • "skills-2025-10-02"

      • "fast-mode-2026-02-01"

      • "output-300k-2026-03-24"

      • "user-profiles-2026-03-24"

      • "advisor-tool-2026-03-01"

      • "managed-agents-2026-04-01"

Returns

  • class BetaManagedAgentsCredential: …

    A credential stored in a vault. Sensitive fields are never returned in responses.

    • id: str

      Unique identifier for the credential.

    • archived_at: Optional[datetime]

      A timestamp in RFC 3339 format

    • auth: Auth

      Authentication details for a credential.

      • class BetaManagedAgentsMCPOAuthAuthResponse: …

        OAuth credential details for an MCP server.

        • mcp_server_url: str

          URL of the MCP server this credential authenticates against.

        • type: Literal["mcp_oauth"]

          • "mcp_oauth"
        • expires_at: Optional[datetime]

          A timestamp in RFC 3339 format

        • refresh: Optional[BetaManagedAgentsMCPOAuthRefreshResponse]

          OAuth refresh token configuration returned in credential responses.

          • client_id: str

            OAuth client ID.

          • token_endpoint: str

            Token endpoint URL used to refresh the access token.

          • token_endpoint_auth: TokenEndpointAuth

            Token endpoint requires no client authentication.

            • class BetaManagedAgentsTokenEndpointAuthNoneResponse: …

              Token endpoint requires no client authentication.

              • type: Literal["none"]

                • "none"
            • class BetaManagedAgentsTokenEndpointAuthBasicResponse: …

              Token endpoint uses HTTP Basic authentication with client credentials.

              • type: Literal["client_secret_basic"]

                • "client_secret_basic"
            • class BetaManagedAgentsTokenEndpointAuthPostResponse: …

              Token endpoint uses POST body authentication with client credentials.

              • type: Literal["client_secret_post"]

                • "client_secret_post"
          • resource: Optional[str]

            OAuth resource indicator.

          • scope: Optional[str]

            OAuth scope for the refresh request.

      • class BetaManagedAgentsStaticBearerAuthResponse: …

        Static bearer token credential details for an MCP server.

        • mcp_server_url: str

          URL of the MCP server this credential authenticates against.

        • type: Literal["static_bearer"]

          • "static_bearer"
    • created_at: datetime

      A timestamp in RFC 3339 format

    • metadata: Dict[str, str]

      Arbitrary key-value metadata attached to the credential.

    • type: Literal["vault_credential"]

      • "vault_credential"
    • updated_at: datetime

      A timestamp in RFC 3339 format

    • vault_id: str

      Identifier of the vault this credential belongs to.

    • display_name: Optional[str]

      Human-readable name for the credential.

Example

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_managed_agents_credential = client.beta.vaults.credentials.archive(
    credential_id="vcrd_011CZkZEMt8gZan2iYOQfSkw",
    vault_id="vlt_011CZkZDLs7fYzm1hXNPeRjv",
)
print(beta_managed_agents_credential.id)

Liên kết

Xem thêm: