Verify & activate 2FA

Verify & activate two-factor authentication (2FA) for your account (authenticated account) with the derived OTP.

  • HTTP Method: POST
  • URL: https://example.domain.tld/api/v1/2fa/verify/
  • Require authentication: Yes
  • Permission level required: MasterAdmin / DomainAdmin / MailUser

Request parameters

Parameter Type Description Required
username str Account username Required
otp str One-time password (OTP) Required

Response parameters

Parameter Type Description
2fa dict The 2FA object
status str 2FA status
username str Your account username

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/2fa/verify/"
data = {
"username" : "u2@vonmail.com",
"otp" : "749463"
}
r = requests.post(url, json=data, auth=("u2@vonmail.com","long-auth_token-here"))
try:
    pprint(r.json())
except: 
    print(r.text)

Example response (JSON)

{'2fa': {'status': 'enabled', 'username': 'u2@vonmail.com'}}