Create device password

Create device password (app-specific password) for 2FA-enabled MailUsers (email accounts) for logging in to IMAP/POP/SMTP clients.

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

Request parameters

Parameter Type Description Required
friendly_name str Name (identifier) for device password Required

Response parameters

Parameter Type Description
device_password str Device password
friendly_name str Name (identifier) of device password
username str Your account username

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/2fa/device_password/"
data = {
"friendly_name" : "Workstation"
r =, json=data, auth=("","long-auth_token-here"))

Example response (JSON)

{'device_password': 'xjrBKNe1A7VCO4KYxVfg',
 'friendly_name': 'Workstation',
 'username': ''}