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

# Validate code sent and store setup method.

`POST /tf-setup/{token}`

## Request body

- TfSetupValidateRequest
  - `code` string, required — Code as received from method being setup.

## Response `200`

Successfully validated and persisted two-factor method.

- TfSetupValidateJsonResponse
  - `meta` object, required
    - `code` integer, required — Http status code
  - `response` object, required
    - `tf_method` string — The method as passed into API.
    - `tf_primary_method` string — The method as passed into API.
    - `tf_phone` string — Phone number if set.

## Other responses

- `302` — Success or Failure.
- `400` — Failed - bad code, expired token, bad token.

---

[API](https://skmtc.net/pallets-eco/apis/flask-security-external-api.md) · [All operations](https://skmtc.net/pallets-eco/apis/flask-security-external-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pallets-eco/flask-security-external-api/versions/5ee7c28d6e1e/schema)
