# Generate 2FA secret | Copenhagen Truck Wash API

### Copenhagen Truck Wash API Help

# Generate 2FA secret

This endpoint documentation is generated directly from `openapi.yaml`.

## Endpoint

POST /auth/2fa/setup

## Operation

Operation ID: `setup2fa`

Generate a new TOTP secret for the authenticated user/subuser

## Authentication

Security requirements:

Scheme | Scopes
--- | ---
BearerAuth | -

## Request Body

Required: no.

Content type: `application/json`

{}

## Responses

Status | Description | Content Types
--- | --- | ---
200 | 2FA secret generated successfully | application/json
401 |  |

Schema for response `200` (`application/json`):

{ "properties": { "qr_code_url": { "description": "An otpauth URL for generating a QR code", "type": "string" }, "secret": { "description": "The base32 encoded TOTP secret", "type": "string" } }, "type": "object" }
17 March 2026