Skip to main content
Activate a new 2FA method by verifying the code.

Signature

VastAI.tfa_activate(
    method_type: Optional[str] = 'totp',
    secret: Optional[str] = None,
    phone_number: Optional[str] = None,
    label: Optional[str] = None
) -> dict

Parameters

method_type
Optional[str]
default:"totp"
New 2FA Method type to activate
secret
Optional[str]
Secret token from setup process (required)
phone_number
Optional[str]
Phone number for SMS method (E.164 format)
label
Optional[str]
Label for the new 2FA method

Returns

dict

Example

from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.tfa_activate()
print(result)