Verify login 2FA (step 2)
curl --request POST \
--url https://api.flowxi.app/api/v1/auth/2fa/verify-login \
--header 'Content-Type: application/json' \
--data '
{
"challenge_id": "6ff8f7f6-1eb3-3525-be4a-3932c805afed",
"code": "123456"
}
'import requests
url = "https://api.flowxi.app/api/v1/auth/2fa/verify-login"
payload = {
"challenge_id": "6ff8f7f6-1eb3-3525-be4a-3932c805afed",
"code": "123456"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({challenge_id: '6ff8f7f6-1eb3-3525-be4a-3932c805afed', code: '123456'})
};
fetch('https://api.flowxi.app/api/v1/auth/2fa/verify-login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flowxi.app/api/v1/auth/2fa/verify-login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'challenge_id' => '6ff8f7f6-1eb3-3525-be4a-3932c805afed',
'code' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flowxi.app/api/v1/auth/2fa/verify-login"
payload := strings.NewReader("{\n \"challenge_id\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",\n \"code\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flowxi.app/api/v1/auth/2fa/verify-login")
.header("Content-Type", "application/json")
.body("{\n \"challenge_id\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",\n \"code\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flowxi.app/api/v1/auth/2fa/verify-login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"challenge_id\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",\n \"code\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"code": "TOKEN_ISSUED",
"message": "Token issued.",
"access_token": "125|XXXXXXXXXXXXXXXXXXXXXXXX",
"token_type": "Bearer",
"user_id": 123,
"account_status": "active"
}{
"code": "MFA_CHALLENGE_INVALID",
"message": "Invalid challenge."
}{
"code": "MFA_CODE_INVALID",
"message": "Invalid 2FA code."
}{
"code": "MFA_CHALLENGE_GONE",
"message": "Challenge expired."
}{
"code": "MFA_TOO_MANY_ATTEMPTS",
"message": "Too many attempts."
}{
"code": "SERVER_ERROR",
"message": "Server error."
}Two-factor authentication
Verify login 2FA (step 2)
Validates TOTP and issues a token (enforces 1 token/device). Challenge bound to IP + User-Agent + device_id.
POST
/
api
/
v1
/
auth
/
2fa
/
verify-login
Verify login 2FA (step 2)
curl --request POST \
--url https://api.flowxi.app/api/v1/auth/2fa/verify-login \
--header 'Content-Type: application/json' \
--data '
{
"challenge_id": "6ff8f7f6-1eb3-3525-be4a-3932c805afed",
"code": "123456"
}
'import requests
url = "https://api.flowxi.app/api/v1/auth/2fa/verify-login"
payload = {
"challenge_id": "6ff8f7f6-1eb3-3525-be4a-3932c805afed",
"code": "123456"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({challenge_id: '6ff8f7f6-1eb3-3525-be4a-3932c805afed', code: '123456'})
};
fetch('https://api.flowxi.app/api/v1/auth/2fa/verify-login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flowxi.app/api/v1/auth/2fa/verify-login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'challenge_id' => '6ff8f7f6-1eb3-3525-be4a-3932c805afed',
'code' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flowxi.app/api/v1/auth/2fa/verify-login"
payload := strings.NewReader("{\n \"challenge_id\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",\n \"code\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flowxi.app/api/v1/auth/2fa/verify-login")
.header("Content-Type", "application/json")
.body("{\n \"challenge_id\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",\n \"code\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flowxi.app/api/v1/auth/2fa/verify-login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"challenge_id\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",\n \"code\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"code": "TOKEN_ISSUED",
"message": "Token issued.",
"access_token": "125|XXXXXXXXXXXXXXXXXXXXXXXX",
"token_type": "Bearer",
"user_id": 123,
"account_status": "active"
}{
"code": "MFA_CHALLENGE_INVALID",
"message": "Invalid challenge."
}{
"code": "MFA_CODE_INVALID",
"message": "Invalid 2FA code."
}{
"code": "MFA_CHALLENGE_GONE",
"message": "Challenge expired."
}{
"code": "MFA_TOO_MANY_ATTEMPTS",
"message": "Too many attempts."
}{
"code": "SERVER_ERROR",
"message": "Server error."
}Body
application/json
Response
Token issued.
⌘I

