Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Verify an email MFA code

Verifies the second factor of the session started by POST /api/v1/auth.

post
Authorizations
defguard_sessionstringRequired
Body
codestringRequired
Responses
200

Email MFA code verified, user is fully authenticated.

application/json

Return type needed for knowing if a user came from OpenID flow. If so, fill in the optional URL field to redirect him later.

urlstring · nullableOptional
post/api/v1/auth/email/verify
POST /api/v1/auth/email/verify HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "code": "text"
}
{
  "url": null,
  "user": {
    "authorized_apps": [
      {
        "oauth2client_id": 1,
        "oauth2client_name": "text"
      }
    ],
    "devices": [
      {
        "configured": true,
        "created": "2026-01-01T00:00:00.000Z",
        "description": null,
        "device_type": "user",
        "id": 1,
        "name": "text",
        "user_id": 1,
        "wireguard_pubkey": "text",
        "networks": [
          {
            "device_wireguard_ips": [
              "text"
            ],
            "is_active": true,
            "last_connected_at": null,
            "last_connected_ip": null,
            "location_mfa_mode": "disabled",
            "network_gateway_ip": "text",
            "network_id": 1,
            "network_name": "text"
          }
        ]
      }
    ],
    "email": "text",
    "email_mfa_enabled": true,
    "enrolled": true,
    "first_name": "text",
    "groups": [
      "text"
    ],
    "has_non_mfa_location_access": true,
    "has_non_posture_location_access": true,
    "id": 1,
    "is_active": true,
    "is_admin": true,
    "last_name": "text",
    "ldap_pass_requires_change": true,
    "mfa_enabled": true,
    "mfa_method": "None",
    "name": "text",
    "password_management_disabled": true,
    "phone": null,
    "totp_enabled": true,
    "username": "text"
  }
}

Last updated

Was this helpful?