Skip to content
MultiloginHelp Center

How to enable 2FA (two-factor authentication) with Postman

Use the Multilogin 2FA endpoints in Postman to set up and manage 2FA for an email-and-password account.

➡️ Import the Multilogin API collection → authenticate your Postman requests → run “Set up 2FA” → add the generated authenticator entry → send the current code with “Enable 2FA”.

If you sign in to Multilogin with Google, Apple, or another social provider, manage 2FA with that provider instead of Multilogin.

If you rather do it via Multilogin CLI tool, follow our CLI article How to enable 2FA in CLI.

Before you start

Use this workflow only if you sign in to Multilogin with an email and password.

If you sign in with Google, Apple, or another social provider, manage 2FA through that provider instead of Multilogin.

Make sure:

  • Postman is installed
  • The Multilogin API collection is imported
  • Your Postman requests use a valid Multilogin API token
  • You sign in to Multilogin with an email and password
  • You have a compatible authenticator app ready

How to set up Google Authenticator

Use a compatible authenticator app, such as Google Authenticator or Microsoft Authenticator, to generate your 2FA codes.

  1. Download Google Authenticator in your app store (iOS, Android)
  2. Open the app → sign in to your Google account
  3. Click the plus (+) icon at the lower right area
  4. Choose “Enter a setup key”. You’ll enter the key locally in the next section instead of using an online QR converter.

How to use 2FA endpoints with Postman

How to set up 2FA for a user

  1. Go to the Documenter page and locate or import the 2FA endpoints
  2. Use the “Set up 2FA” endpoint to get your device_id and otp_url_bytes objects
  3. Keep device_id for the next request. Decode otp_url_bytes locally with the Python 3 example below. Do not paste it into a website, chat or support ticket.
  4. Save the example as decode_2fa.py, run python3 decode_2fa.py (or python decode_2fa.py on Windows), then paste otp_url_bytes at the hidden prompt. The script makes no network requests.
  5. In your authenticator app, add an account manually using the displayed account name and Secret. Select time-based codes. Match the displayed algorithm, digit count and period; if your app cannot match them, use a compatible authenticator instead of changing the values.
  6. Continue with “Enable 2FA” below using the current code. After setup, clear the copied setup information from your clipboard and close the terminal. Keep the secret private.

Local decoding example (requires Python 3). It displays the setup key only on your computer; no QR-conversion website is needed.

import base64
import getpass
from urllib.parse import parse_qs, unquote, urlparse

encoded = getpass.getpass("otp_url_bytes: ").strip()
uri = urlparse(base64.b64decode(encoded, validate=True).decode("utf-8"))
if uri.scheme != "otpauth" or uri.netloc != "totp":
    raise ValueError("Expected a time-based otpauth setup URI")
settings = parse_qs(uri.query)
secret = settings.get("secret", [""])[0]
if not secret:
    raise ValueError("The setup URI has no secret")
print("Account:", unquote(uri.path.lstrip("/")))
print("Secret:", secret)
print("Algorithm:", settings.get("algorithm", ["SHA1"])[0])
print("Digits:", settings.get("digits", ["6"])[0])
print("Period:", settings.get("period", ["30"])[0])
Postman Set up 2FA request with device_name in Body and device_id and otp_url_bytes in the response.

How to enable 2FA for a user

  1. Go to “Enable 2FA” endpoint → head over to “Body”
  2. Use your previously obtained device_id
  3. Type the code from Google Authenticator in totp_code → press “Send”
  4. Your backup codes will be generated → store them in a safe place
  5. A success message will appear in the output

How to set up 2FA for a new device

  1. Get the new device_id via “Set up 2FA” endpoint
  2. Go to “Set up new device for 2FA” endpoint
  3. Fill in the new device_id
  4. Insert the code from Google Authenticator in totp_code → press “Send”
  5. A success message will appear in the output
Postman Set up new device for 2FA request with device_id, totp_code, and a success response.

How to enable/disable 2FA from workspace

  1. Go to “Enable/Disable 2FA for workspace” endpoint
  2. On the “Body” tab → select true or false to activate/deactivate it
  3. Click “Send” → a confirmation message will appear
Postman Enable/Disable 2FA for Workspace request with enable: true and a confirmation response.

How to remove 2FA from a device

  1. Go to “Revoke device for 2FA” endpoint
  2. Go to “Body”
  3. Fill in the device_id you wish to remove → press “Send”
  4. A success/failure message appears as output
Postman Revoke device for 2FA request with device_id and a device-removal confirmation response.

Stay in the loop

Catch the latest updates, exchange advice, explore practical use cases.

Get product updatesTelegram channelAsk other usersTelegram chatExplore use casesDiscord community