MAILGENT

vault.totp

Generate a TOTP 2FA code

Scope: vault:read

Generate the current 6-digit TOTP code from a stored credential with a TOTP secret.

Parameters

NameTypeRequiredDescription
namestringYesCredential name with TOTP

Example

Agent: "Get my AWS 2FA code"

-> vault.totp({ name: "aws-login" })

Returns

{
  "code": "482901",
  "remaining": 18,
  "backupCodesRemaining": 8
}
FieldTypeDescription
codestringCurrent 6-digit TOTP code
remainingnumberSeconds until code rotates
backupCodesRemainingnumberCount of single-use backup codes stored. 0 when none. The actual codes are never returned here — fetch them via vault.get (data.backupCodes).

REST Equivalent

GET /v0/vault/:name/totp

On this page