Complete a two-factor login
POST
/v2/portal/auth/2fa/login-verify
curl --request POST \ --url https://api.sipstack.com/v2/portal/auth/2fa/login-verify \ --header 'Content-Type: application/json' \ --data '{ "tempToken": "example", "code": "123456" }'import requests
url = "https://api.sipstack.com/v2/portal/auth/2fa/login-verify"
payload = { "tempToken": "example", "code": "123456"}headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const url = 'https://api.sipstack.com/v2/portal/auth/2fa/login-verify';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"tempToken":"example","code":"123456"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}import axios from 'axios';
const options = { method: 'POST', url: 'https://api.sipstack.com/v2/portal/auth/2fa/login-verify', headers: {'Content-Type': 'application/json'}, data: {tempToken: 'example', code: '123456'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}Exchanges the tempToken from the MFA-challenged login response plus a 6-digit TOTP code for a full session.
Request Body required
Section titled “Request Body required ” Media type application/json
object
tempToken
required
string
code
required
string
Example
123456Responses
Section titled “ Responses ”Session created — same shape as a successful login.
Missing tempToken or code.
Invalid or expired challenge/code.
Too many verification attempts.