---
title: "Generate a new TOTP secret"
method: POST
path: "/admin/totp/generate"
tags: ["admins"]
---

# Generate a new TOTP secret

`POST /admin/totp/generate`

Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in admin

## Request body

- object
  - `config_name` string — name of the configuration to use to generate the secret

## Response `200`

successful operation

- object
  - `config_name` string
  - `issuer` string
  - `secret` string
  - `url` string
  - `qr_code` string, byte — QR code png encoded as BASE64

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal Server Error
- `default` — Unexpected Error

---

[API](https://skmtc.net/kanton-bern/apis/sftpgo.md) · [All operations](https://skmtc.net/kanton-bern/apis/sftpgo/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kanton-bern/sftpgo/versions/d8d616a479b0/schema)
