---
title: "Finish a sign-in with the authenticator code (p19,"
method: POST
path: "/auth/two-step/verify"
tags: ["Auth"]
---

# Finish a sign-in with the authenticator code (p19,

`POST /auth/two-step/verify`

## Request

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

The challenge from login plus a code, accepted one step either side and never for the same step twice (401 TWO_STEP_CODE_WRONG; an expired or forged challenge is 401 TWO_STEP_CHALLENGE_EXPIRED). `trustBrowser` sets the httpOnly `median_trusted_browser` cookie for 30 days. Answers as login does. A wrong code counts on the account lock shared with password sign-in (5 in a row lock it for 15 minutes: 401 TWO_STEP_LOCKED); a right one resets it. Behind its own rate limit. The challenge is signed with its own key and is never accepted as a Bearer access token.

## Request body

- object
  - `challengeToken` string, required
  - `code` string, required
  - `trustBrowser` boolean

## 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
- `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/verify/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)
