---
title: "Begin TOTP (authenticator app) enrollment"
method: POST
path: "/v1/totp/enroll"
tags: ["TOTP"]
---

# Begin TOTP (authenticator app) enrollment

`POST /v1/totp/enroll`

## Request

- Base URL: `https://identity-api.paymongo.com`
- URL: `https://identity-api.paymongo.com/v1/totp/enroll`
- Auth: HTTP bearer

Generates a fresh authenticator secret for the caller and returns the otpauth:// URL (render as a QR code) plus the base32 secret for manual entry. The secret is returned only here; it is not confirmed until a code is submitted to /v1/totp/enroll/confirm. Re-enrolling replaces any existing authenticator and requires re-confirmation. The body is optional: `current_password` is required only when a confirmed authenticator already exists, since that enrollment un-confirms the live second factor. Omitting it then returns 422 on current_password.

## Request body

- MfaEnrollTOTPRequestEnvelopeDTO
  - `data` object
    - `attributes` MfaEnrollTOTPRequestDTO
      - `current_password` string

## Response `201`

Created

- object: Standard response containing data and its metadata if any
  - `data` object
    - `attributes` MfaEnrollTOTPAttributesDTO
      - `secret` string
      - `url` string
    - `id` string
    - `type` string
  - `has_more` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/paymongo/apis/identity.md) - [All operations](https://skmtc.dev/paymongo/apis/identity/llms.txt) - [OpenAPI document](https://skmtc.dev/paymongo/apis/identity/revisions/cc3056164874?raw)
