Create device password
Create device password (app-specific password) for MailUsers (email accounts) who have 2FA enabled and/or password authentication disabled 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 = requests.post(url, json=data, auth=("u2@vonmail.com","long-auth_token-here"))
try:
pprint(r.json())
except:
print(r.text)
Example response (JSON)
{'device_password': 'xjrBKNe1A7VCO4KYxVfg',
'friendly_name': 'Workstation',
'username': 'u2@vonmail.com'}