---
title: "Configure TOTP authentication"
method: PUT
path: "/api/users/{username}/totp"
tags: ["Users"]
---

# Configure TOTP authentication

`PUT /api/users/{username}/totp`

## Path parameters

- `username` string, required

## Request body

- object
  - `provisioning_uri` string — The provisioning_uri previously obtained from a GET request for this user.
  - `totp` number — Valid TOTP code for the given provisioning_uri

## Response `201`

When TOTP has been configured successfully.

## Other responses

- `400` — If the provisioning_uri is invalid.
- `403` — If TOTP is already configured for this user, or {username} is not the currently logged in user.
- `422` — If the TOTP code is invalid/does not match the provisioning_uri.
- `503` — If the user is using Passkey authentication, TOTP cannot be configured.

---

[API](https://skmtc.net/contao/apis/contao-manager-api.md) · [All operations](https://skmtc.net/contao/apis/contao-manager-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/contao/contao-manager-api/versions/074d8046de13/schema)
