Get the current TOTP code
POST /api/v1/vault/:id/totp returns the current authenticator code for a credential with TOTP configured. Requires vault:use, and the credential must be marked agent-readable.
The equivalent MCP tool is get_totp_code.
Get a TOTP code
Response fields
The raw TOTP secret is never returned by any endpoint after it is stored. Only the current code is accessible, and every call is recorded in the org’s audit history.
Store a TOTP secret
TOTP is an optional field on alogin or api_key credential. Pass the base32 seed or otpauth://totp/... URI as totp when creating or updating it. Creating and updating require vault:write.
To add TOTP to an existing credential, send only totp in PATCH /api/v1/vault/:id, or use update_credential with credential_id and totp. The secret field changes the password or API key and must not be used for an authenticator seed. The examples below use a sample seed; replace it with the one issued for your account.
MCP tool
From a chat client, use theget_totp_code tool directly: