---
title: "Non-consuming OTP precheck for the SPA's two-step register/reset flows"
method: POST
path: "/api/auth/check-otp"
tags: ["auth"]
---

# Non-consuming OTP precheck for the SPA's two-step register/reset flows

`POST /api/auth/check-otp`

## Request

- Base URL: `https://api.monacloud.vn`
- URL: `https://api.monacloud.vn/api/auth/check-otp`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Token`

Tạo dữ liệu hoặc thực thi thao tác tại `/api/auth/check-otp`. Phản hồi dùng JSON và tuân theo schema được công bố bên dưới.

## Request body

- CheckOtpRequest: Non-consuming OTP check (POST /api/auth/check-otp). Powers the SPA's two-step register / reset flows where the OTP is validated in step 1 so the user gets immediate feedback, and the real consume happens at the final submit in step 2. `purpose` is constrained to the two OTP flows the SPA owns — pinning the literal here means a typo (`"reset"` vs `"reset_password"`) is caught by Pydantic, not by a silent 400 from the OTP lookup.
  - `email` string, required
  - `otp` string, required
  - `purpose` 'register' | 'reset_password', required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud.md) · [All operations](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud/llms.txt) · [OpenAPI document](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud/revisions/34a120ed37ce?raw)
