Claude Platform Docs

Credentials

Create Credential
client.beta.vaults.credentials.create(stringvaultID, CredentialCreateParamsparams, RequestOptionsoptions?): BetaManagedAgentsCredential
POST/v1/vaults/{vault_id}/credentials
List Credentials
client.beta.vaults.credentials.list(stringvaultID, CredentialListParamsparams?, RequestOptionsoptions?): PageCursor<BetaManagedAgentsCredential>
GET/v1/vaults/{vault_id}/credentials
Get Credential
client.beta.vaults.credentials.retrieve(stringcredentialID, CredentialRetrieveParamsparams, RequestOptionsoptions?): BetaManagedAgentsCredential
GET/v1/vaults/{vault_id}/credentials/{credential_id}
Update Credential
client.beta.vaults.credentials.update(stringcredentialID, CredentialUpdateParamsparams, RequestOptionsoptions?): BetaManagedAgentsCredential
POST/v1/vaults/{vault_id}/credentials/{credential_id}
Delete Credential
client.beta.vaults.credentials.delete(stringcredentialID, CredentialDeleteParamsparams, RequestOptionsoptions?): BetaManagedAgentsDeletedCredential
DELETE/v1/vaults/{vault_id}/credentials/{credential_id}
Archive Credential
client.beta.vaults.credentials.archive(stringcredentialID, CredentialArchiveParamsparams, RequestOptionsoptions?): BetaManagedAgentsCredential
POST/v1/vaults/{vault_id}/credentials/{credential_id}/archive
Validate Credential
client.beta.vaults.credentials.mcpOAuthValidate(stringcredentialID, CredentialMCPOAuthValidateParamsparams, RequestOptionsoptions?): BetaManagedAgentsCredentialValidation
POST/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate
Models
BetaManagedAgentsCredential { id, archived_at, auth, 6 more }

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

BetaManagedAgentsCredentialNetworkingParams = BetaManagedAgentsUnrestrictedCredentialNetworkingParams { type } | BetaManagedAgentsLimitedCredentialNetworkingParams { allowed_hosts, type }

Substitute the secret on any host the session's Environment network policy permits egress to. The Environment's network policy is the only boundary on where the secret can reach.

One of the following:
BetaManagedAgentsUnrestrictedCredentialNetworkingParams { type }

Substitute the secret on any host the session's Environment network policy permits egress to. The Environment's network policy is the only boundary on where the secret can reach.

type: "unrestricted"
BetaManagedAgentsLimitedCredentialNetworkingParams { allowed_hosts, type }

Substitute the secret only on requests to the listed hosts.

allowed_hosts: Array<string>

Hostnames on which the secret will be substituted. Each entry is a bare hostname (api.example.com), an IPv4 address (192.0.2.1), or a *.-prefixed wildcard (*.example.com). URLs, ports, paths, and IPv6 addresses are not accepted. At most 16 entries.

type: "limited"
BetaManagedAgentsCredentialValidation { credential_id, has_refresh_token, mcp_probe, 5 more }

Result of live-probing a credential against its configured MCP server.

BetaManagedAgentsCredentialValidationStatus = "valid" | "invalid" | "unknown"

Overall verdict of a credential validation probe.

One of the following:
"valid"
"invalid"
"unknown"
BetaManagedAgentsDeletedCredential { id, type }

Confirmation of a deleted credential.

id: string

Unique identifier of the deleted credential.

type: "vault_credential_deleted"
BetaManagedAgentsEnvironmentVariableAuthResponse { injection_location, networking, secret_name, type }

Environment variable credential details. The secret value is never returned.

BetaManagedAgentsEnvironmentVariableCreateParams { networking, secret_name, secret_value, 2 more }

Parameters for creating an environment variable credential.

BetaManagedAgentsEnvironmentVariableUpdateParams { type, injection_location, networking, secret_value }

Parameters for updating an environment variable credential. secret_name is immutable.

BetaManagedAgentsInjectionLocationParams { body, header }

Where in the outbound request the secret value may be substituted.

body?: boolean

Substitute when the placeholder appears in the request body.

header?: boolean

Substitute when the placeholder appears in a request header value.

BetaManagedAgentsInjectionLocationResponse { body, header }

Where in the outbound request the secret value is substituted.

body: boolean

Whether the placeholder is substituted in the request body.

header: boolean

Whether the placeholder is substituted in request header values.

BetaManagedAgentsInjectionLocationUpdateParams { body, header }

Updated injection location.

body?: boolean

Substitute when the placeholder appears in the request body.

header?: boolean

Substitute when the placeholder appears in a request header value.

BetaManagedAgentsLimitedCredentialNetworkingParams { allowed_hosts, type }

Substitute the secret only on requests to the listed hosts.

allowed_hosts: Array<string>

Hostnames on which the secret will be substituted. Each entry is a bare hostname (api.example.com), an IPv4 address (192.0.2.1), or a *.-prefixed wildcard (*.example.com). URLs, ports, paths, and IPv6 addresses are not accepted. At most 16 entries.

type: "limited"
BetaManagedAgentsLimitedCredentialNetworkingResponse { allowed_hosts, type }

The secret is substituted only on requests to the listed hosts.

allowed_hosts: Array<string>

Hostnames on which the secret will be substituted. An entry matches the request host exactly; a *.-prefixed entry matches any subdomain of the named domain but not the domain itself.

type: "limited"
BetaManagedAgentsMCPOAuthAuthResponse { mcp_server_url, type, expires_at, refresh }

OAuth credential details for an MCP server.

mcp_server_url: string

URL of the MCP server this credential authenticates against.

type: "mcp_oauth"
expires_at?: string | null

A timestamp in RFC 3339 format

formatdate-time
refresh?: BetaManagedAgentsMCPOAuthRefreshResponse { client_id, token_endpoint, token_endpoint_auth, 2 more } | null

OAuth refresh token configuration returned in credential responses.

BetaManagedAgentsMCPOAuthCreateParams { access_token, mcp_server_url, type, 2 more }

Parameters for creating an MCP OAuth credential.

access_token: string

OAuth access token.

minLength1
maxLength8192
mcp_server_url: string

URL of the MCP server this credential authenticates against.

minLength1
maxLength2047
type: "mcp_oauth"
expires_at?: string | null

A timestamp in RFC 3339 format

formatdate-time
refresh?: BetaManagedAgentsMCPOAuthRefreshParams { client_id, refresh_token, token_endpoint, 3 more } | null

OAuth refresh token parameters for creating a credential with refresh support.

BetaManagedAgentsMCPOAuthRefreshParams { client_id, refresh_token, token_endpoint, 3 more }

OAuth refresh token parameters for creating a credential with refresh support.

BetaManagedAgentsMCPOAuthRefreshResponse { client_id, token_endpoint, token_endpoint_auth, 2 more }

OAuth refresh token configuration returned in credential responses.

BetaManagedAgentsMCPOAuthRefreshUpdateParams { refresh_token, scope, token_endpoint_auth }

Parameters for updating OAuth refresh token configuration.

BetaManagedAgentsMCPOAuthUpdateParams { type, access_token, expires_at, refresh }

Parameters for updating an MCP OAuth credential. The mcp_server_url is immutable.

type: "mcp_oauth"
access_token?: string | null

Updated OAuth access token.

minLength1
maxLength8192
expires_at?: string | null

A timestamp in RFC 3339 format

formatdate-time
refresh?: BetaManagedAgentsMCPOAuthRefreshUpdateParams { refresh_token, scope, token_endpoint_auth } | null

Parameters for updating OAuth refresh token configuration.

BetaManagedAgentsMCPProbe { http_response, method }

The failing step of an MCP validation probe.

http_response: BetaManagedAgentsRefreshHTTPResponse { body, body_truncated, content_type, status_code } | null

An HTTP response captured during a credential validation probe.

body: string

Response body. May be truncated and has sensitive values scrubbed.

body_truncated: boolean

Whether body was truncated.

content_type: string

Value of the Content-Type response header.

status_code: number

HTTP status code.

formatint32
method: string

The MCP method that failed (for example initialize or tools/list).

BetaManagedAgentsRefreshHTTPResponse { body, body_truncated, content_type, status_code }

An HTTP response captured during a credential validation probe.

body: string

Response body. May be truncated and has sensitive values scrubbed.

body_truncated: boolean

Whether body was truncated.

content_type: string

Value of the Content-Type response header.

status_code: number

HTTP status code.

formatint32
BetaManagedAgentsRefreshObject { http_response, status }

Outcome of a refresh-token exchange attempted during credential validation.

http_response: BetaManagedAgentsRefreshHTTPResponse { body, body_truncated, content_type, status_code } | null

An HTTP response captured during a credential validation probe.

body: string

Response body. May be truncated and has sensitive values scrubbed.

body_truncated: boolean

Whether body was truncated.

content_type: string

Value of the Content-Type response header.

status_code: number

HTTP status code.

formatint32
status: "succeeded" | "failed" | "connect_error" | "no_refresh_token"

Outcome of a refresh-token exchange attempted during credential validation.

One of the following:
"succeeded"
"failed"
"connect_error"
"no_refresh_token"
BetaManagedAgentsStaticBearerAuthResponse { mcp_server_url, type }

Static bearer token credential details for an MCP server.

mcp_server_url: string

URL of the MCP server this credential authenticates against.

type: "static_bearer"
BetaManagedAgentsStaticBearerCreateParams { token, mcp_server_url, type }

Parameters for creating a static bearer token credential.

token: string

Static bearer token value.

minLength1
maxLength8192
mcp_server_url: string

URL of the MCP server this credential authenticates against.

minLength1
maxLength2047
type: "static_bearer"
BetaManagedAgentsStaticBearerUpdateParams { type, token }

Parameters for updating a static bearer token credential. The mcp_server_url is immutable.

type: "static_bearer"
token?: string | null

Updated static bearer token value.

minLength1
maxLength8192
BetaManagedAgentsTokenEndpointAuthBasicParam { client_secret, type }

Token endpoint uses HTTP Basic authentication with client credentials.

client_secret: string

OAuth client secret.

minLength1
maxLength512
type: "client_secret_basic"
BetaManagedAgentsTokenEndpointAuthBasicResponse { type }

Token endpoint uses HTTP Basic authentication with client credentials.

type: "client_secret_basic"
BetaManagedAgentsTokenEndpointAuthBasicUpdateParam { type, client_secret }

Updated HTTP Basic authentication parameters for the token endpoint.

type: "client_secret_basic"
client_secret?: string | null

Updated OAuth client secret.

minLength1
maxLength512
BetaManagedAgentsTokenEndpointAuthNoneParam { type }

Token endpoint requires no client authentication.

type: "none"
BetaManagedAgentsTokenEndpointAuthNoneResponse { type }

Token endpoint requires no client authentication.

type: "none"
BetaManagedAgentsTokenEndpointAuthPostParam { client_secret, type }

Token endpoint uses POST body authentication with client credentials.

client_secret: string

OAuth client secret.

minLength1
maxLength512
type: "client_secret_post"
BetaManagedAgentsTokenEndpointAuthPostResponse { type }

Token endpoint uses POST body authentication with client credentials.

type: "client_secret_post"
BetaManagedAgentsTokenEndpointAuthPostUpdateParam { type, client_secret }

Updated POST body authentication parameters for the token endpoint.

type: "client_secret_post"
client_secret?: string | null

Updated OAuth client secret.

minLength1
maxLength512
BetaManagedAgentsUnrestrictedCredentialNetworkingParams { type }

Substitute the secret on any host the session's Environment network policy permits egress to. The Environment's network policy is the only boundary on where the secret can reach.

type: "unrestricted"
BetaManagedAgentsUnrestrictedCredentialNetworkingResponse { type }

The secret is substituted on any host the session's Environment network policy permits egress to.

type: "unrestricted"