Add a 2FA configuration to the user’s organization settings for automated two-factor authentication.
Python
import requests url = 'https://api.simplex.sh/add_2fa_config' headers = { 'X-API-Key': 'your_api_key_here' } data = { 'seed': 'your_2fa_seed', # Required: The 2FA seed/secret 'name': 'GitHub', # Optional: Name for the config 'partial_url': 'github.com' # Optional: URL pattern to match } response = requests.post(url, headers=headers, json=data) result = response.json() if result['succeeded']: print(f"2FA config added successfully") print(f"Total configs: {result['total_configs']}") else: print(f"Error: {result['error']}")
{ "succeeded": true, "added_config": { "type": "<string>", "two_fa_seed": "<string>", "name": "<string>", "partial_url": "<string>" }, "total_configs": 123, "all_configs": [ {} ], "error": "<string>" }
name
partial_url
seed
Simplex API Key
The 2FA seed/secret for generating TOTP codes.
Optional name for the 2FA configuration.
Optional partial URL to match for automatic 2FA code entry.
2FA configuration added successfully
Whether the operation succeeded.
The 2FA configuration that was added.
Show child attributes
Total number of 2FA configs for this organization.
Array of all 2FA configurations.
Error message if the operation failed.
Was this page helpful?