---
title: "Finish a sign-in with a recovery code instead, each code once (p19,"
method: POST
path: "/auth/two-step/recover"
tags: ["Auth"]
---

# Finish a sign-in with a recovery code instead, each code once (p19,

`POST /auth/two-step/recover`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/auth/two-step/recover`
- Auth: none required

Case, spaces and the dash are ignored. A wrong or used code is 401 TWO_STEP_RECOVERY_WRONG and counts on the account lock (5 wrong in a row lock it for 15 minutes: 401 TWO_STEP_LOCKED). Answers as login does, plus `data.recoveryCodesLeft` ("7 of 8 left"). Behind its own rate limit.

## Request body

- object
  - `challengeToken` string, required
  - `recoveryCode` string, required

## Response `200`

Signed in

- AuthResponse
  - `success` boolean
  - `data` object
    - `user` User
      - `id` string, uuid
      - `email` string, email
      - `name` string
      - `phone` string, nullable
      - `jobTitle` string, nullable
      - `createdAt` string, date-time
      - `updatedAt` string, date-time
    - `accessToken` string
    - `refreshToken` string
    - `expiresIn` integer: Access token TTL in seconds
    - `companyId` string, nullable: Primary company for customer-app session routing
    - `canSeeInternalUi` boolean: True when the primary company is allowlisted for customer-app preview UI
    - `memberships` UserContextMembership[]
      - `companyId` string, uuid
      - `companyName` string, nullable
      - `role` 'owner' | 'admin' | 'cfo' | 'member' | 'viewer'

## Other responses

- `401`: Authentication required
- `422`: Request failed validation

## Changes

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

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/auth/two-step/recover/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)
