---
title: "Validate passcode sent and store setup method."
method: POST
path: "/us-setup/{token}"
---

# Validate passcode sent and store setup method.

`POST /us-setup/{token}`

## Request body

- UsSetupValidateRequest
  - `passcode` string, required — Code/Passcode as received from method being setup.

## Response `200`

Successfully validated and persisted sign in method.

- UsSetupValidateJsonResponse
  - `meta` object, required
    - `code` integer, required — Http status code
  - `response` object, required
    - `chosen_method` string — The chosen_method as passed into API.
    - `phone` string — Phone number if set.

## Other responses

- `302` — Redirect based on success or failure.
- `400` — Failed - bad code, expired token, bad token.

## Changes

- **2023-10-22** `b647a0e917e6` — 1 breaking, 3 info
  - the response's body type/format changed from ``/`` to `object`/`` for status `400`
  - removed `#/components/schemas/BaseJsonResponse, subschema #2` from the response body `allOf` list for the response status `400`
  - added the required property `meta` to the response with the `400` status
  - added the required property `response` to the response with the `400` status
- **2022-07-22** `4b3ea48a957a` — 4 breaking, 2 warning, 3 info
  - the response's body type/format changed from `object`/`` to ``/`` for status `200`
  - the `allOf[subschema #2]/response/errors` response's property type/format changed from `object`/`` to `array`/`` for status `400`
  - removed the required property `meta` from the response with the `200` status
  - removed the required property `response` from the response with the `200` status
  - …5 more
- **2022-04-11** `afed188e0556` — 3 breaking, 1 info
  - the response's body type/format changed from `object`/`` to ``/`` for status `400`
  - removed the required property `meta` from the response with the `400` status
  - removed the required property `response` from the response with the `400` status
  - added `#/components/schemas/BaseJsonResponse, subschema #2` to the response body `allOf` list for the response status `400`
- **2020-04-17** `4c0828c411ce` — 1 breaking, 1 info
  - added required request body
  - added the non-success response with the status `400`
- …earlier changes not shown

[Full history](https://skmtc.dev/pallets-eco/apis/flask-security-external-api/changes/us-setup/:token/post.md)

---

[API](https://skmtc.dev/pallets-eco/apis/flask-security-external-api.md) · [All operations](https://skmtc.dev/pallets-eco/apis/flask-security-external-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pallets-eco/flask-security-external-api/revisions/ee92f388dafa/schema)
