---
title: "Verify a TOTP or backup code for a user"
method: POST
path: "/users/{user_id}/verify_totp"
tags: ["Users"]
---

# Verify a TOTP or backup code for a user

`POST /users/{user_id}/verify_totp`

Verify that the provided TOTP or backup code is valid for the user.
Verifying a backup code will result it in being consumed (i.e. it will
become invalid).
Useful for custom auth flows and re-verification.

## Path parameters

- `user_id` string, required

## Request body

- object
  - `code` string, required — The TOTP or backup code to verify

## Response `200`

The provided TOTP or backup code was correct.

- object
  - `verified` boolean
  - `code_type` 'totp' | 'backup_code'

## Other responses

- `400` — The user does not have TOTP configured for their account.
- `404` — The user does not exist.
- `422` — The provided TOTP or backup code was incorrect.
- `500` — Request was not successful

---

[API](https://skmtc.net/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.net/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/versions/cf036e7951d3/schema)
