---
title: "Enroll a user into totp"
method: POST
path: "/user/settings/totp/enroll"
tags: ["user"]
---

# Enroll a user into totp

`POST /user/settings/totp/enroll`

Creates an initial setup for the user in the db. After this step, the user needs to verify they have a working totp setup with the "enable totp" endpoint.

## Response `200`

OK

- UserTOTP
  - `enabled` boolean — The totp entry will only be enabled after the user verified they have a working totp setup.
  - `secret` string
  - `url` string — The totp url used to be able to enroll the user later

## Other responses

- `400` — Something's invalid.
- `404` — User does not exist.
- `500` — Internal server error.

---

[API](https://skmtc.net/go-vikunja/apis/vikunja-api.md) · [All operations](https://skmtc.net/go-vikunja/apis/vikunja-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/go-vikunja/vikunja-api/revisions/feb3f68bbdf1/schema)
