---
title: "Verify and save 2FA account config (verifyAndSaveTwoFaAccountConfig)"
method: POST
path: "/api/2fa/account/config"
tags: ["two-factor-auth-config-controller"]
---

# Verify and save 2FA account config (verifyAndSaveTwoFaAccountConfig)

`POST /api/2fa/account/config`

Checks the verification code for submitted config, and if it is correct, saves the provided account config. 

Returns whole account's 2FA settings object.
Will throw an error (Bad Request) if the provider is not configured for usage. 

Available for any authorized user.

## Query parameters

- `verificationCode` string

## Request body

- union
  - BackupCodeTwoFaAccountConfig
    - `useByDefault` boolean
    - `providerType` string, required
    - `codes` string[], required
    - `codesLeft` integer
  - EmailTwoFaAccountConfig
    - `useByDefault` boolean
    - `providerType` string, required
    - `email` string, required
  - SmsTwoFaAccountConfig
    - `useByDefault` boolean
    - `providerType` string, required
    - `phoneNumber` string, required
  - TotpTwoFaAccountConfig
    - `useByDefault` boolean
    - `providerType` string, required
    - `authUrl` string, required

## Response `200`

OK

- AccountTwoFaSettings
  - `configs` object

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
