---
title: "Start two-step setup; the authenticator secret and its otpauth link, shown once (p19,"
method: POST
path: "/auth/two-step/setup"
tags: ["Auth"]
---

# Start two-step setup; the authenticator secret and its otpauth link, shown once (p19,

`POST /auth/two-step/setup`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/auth/two-step/setup`
- Auth: HTTP bearer

A new 20-byte TOTP secret (RFC 6238, SHA-1, 6 digits, 30 s), stored encrypted with TWO_STEP_ENCRYPTION_KEY. It replaces an unconfirmed setup, never a confirmed one (409 TWO_STEP_ALREADY_ON). Without the key: 503 TWO_STEP_UNAVAILABLE.

## Response `200`

The secret (base32) and its otpauth:// link

- object
  - `success` true, required
  - `data` object, required
    - `secret` string, required
    - `otpauthUrl` string, required

## Other responses

- `401`: Authentication required
- `409`: Request conflicts with the durable onboarding state
- `503`: Required sandbox provider configuration or service is unavailable

## Changes

- **2026-11-26** `4a2098becaf9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/auth/two-step/setup/post.md)

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) - [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) - [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/4f4c2d34276b?raw)
