Skip to content

Prepare two-factor authentication

POST
/profile/2fa/setup
curl --request POST \
--url https://api.proxyrequest.com/api/v1/profile/2fa/setup \
--header 'Accept-Language: de' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "password": "Correct-Horse-Battery-Staple-42" }'

Confirms the primary factor and prepares a pending secret without disabling current protection.

Accept-Language
string
default: en

Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English.

Examples
de
object
password
string
>= 1 characters
credential
string
>= 1 characters
code
string
>= 1 characters /^[0-9]{6}$/
Examples

Initial setup

{
"password": "Correct-Horse-Battery-Staple-42"
}

The operation completed successfully.

Media typeapplication/json
object
secret
required
string
otpauth_url
required
string
qr_png_base64
string
Examples
ExampleTOTPSetup

TOTP setup

{
"secret": "JBSWY3DPEHPK3PXP",
"otpauth_url": "otpauth://totp/PremiumPorts:developer%40example.com?secret=JBSWY3DPEHPK3PXP&issuer=PremiumPorts",
"qr_png_base64": "iVBORw0KGgoAAAANSUhEUgAA..."
}

The request is malformed or violates a business rule.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExampleValidationError

Validation error

{
"non_field_errors": [
"The request could not be processed."
]
}
Content-Language
string

Language used for human-readable errors.

Authentication credentials are missing, expired, or invalid.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExampleAuthenticationRequired

Authentication required

{
"detail": "Authentication credentials were not provided."
}
Content-Language
string

Language used for human-readable errors.

The authenticated account cannot perform this operation.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExamplePermissionDenied

Permission denied

{
"detail": "You do not have permission to perform this action."
}
Content-Language
string

Language used for human-readable errors.