Skip to content

Start two-factor setup

POST
/profile/2fa/setup
curl --request POST \
--url https://api.proxyrequest.com/api/v1/profile/2fa/setup \
--header 'Authorization: Bearer <token>'

Creates a new TOTP secret and provisioning URI. Two-factor authentication remains disabled until the code is confirmed.

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>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
Exampleexample

Validation error

{
"non_field_errors": [
"The request could not be processed."
],
"translation": "errors.request.invalid"
}

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>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExampleAuthenticationRequired

Authentication required

{
"detail": "Authentication credentials were not provided."
}

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>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExamplePermissionDenied

Permission denied

{
"detail": "You do not have permission to perform this action."
}