---
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.

## Changes

> 52 revisions in range; 15 could not be searched.

- **2019-07-23** `11c8459a5c04` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/pallets-eco/apis/flask-security-external-api/changes/tf-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)
