更新我的 2FA 偏好设置
curl --request PUT \
--url https://api.qbank.cl/platform/v1/otp/preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "payout",
"required": true,
"channel": "totp"
}
'import requests
url = "https://api.qbank.cl/platform/v1/otp/preferences"
payload = {
"action": "payout",
"required": True,
"channel": "totp"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({action: 'payout', required: true, channel: 'totp'})
};
fetch('https://api.qbank.cl/platform/v1/otp/preferences', 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.qbank.cl/platform/v1/otp/preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'payout',
'required' => true,
'channel' => 'totp'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.qbank.cl/platform/v1/otp/preferences"
payload := strings.NewReader("{\n \"action\": \"payout\",\n \"required\": true,\n \"channel\": \"totp\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.qbank.cl/platform/v1/otp/preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"payout\",\n \"required\": true,\n \"channel\": \"totp\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/otp/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"payout\",\n \"required\": true,\n \"channel\": \"totp\"\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"actions": [
{
"action": "payout",
"required": true,
"channel": "totp",
"source": "account"
}
]
}更新我的 2FA 偏好设置
允许账户所有者配置自己的 2FA。你随时可以加固(启用操作、切换到更强渠道:totp > email > sms/whatsapp),但绝不能低于组织下限。弱化(停用已启用的操作或降低渠道)需要针对 security_settings 操作的 X-OTP-Token。选择 channel:totp 需要已注册验证器应用。通过电话渠道(sms/whatsapp)为 login 操作启用 2FA 时,账户电话号码必须已验证(完成任意 SMS/WhatsApp OTP 挑战);否则请求会被拒绝并返回 409 phone_verification_required — 防止因号码输入错误而把自己锁在账户外。
PUT
/
v1
/
otp
/
preferences
更新我的 2FA 偏好设置
curl --request PUT \
--url https://api.qbank.cl/platform/v1/otp/preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "payout",
"required": true,
"channel": "totp"
}
'import requests
url = "https://api.qbank.cl/platform/v1/otp/preferences"
payload = {
"action": "payout",
"required": True,
"channel": "totp"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({action: 'payout', required: true, channel: 'totp'})
};
fetch('https://api.qbank.cl/platform/v1/otp/preferences', 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.qbank.cl/platform/v1/otp/preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'payout',
'required' => true,
'channel' => 'totp'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.qbank.cl/platform/v1/otp/preferences"
payload := strings.NewReader("{\n \"action\": \"payout\",\n \"required\": true,\n \"channel\": \"totp\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.qbank.cl/platform/v1/otp/preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"payout\",\n \"required\": true,\n \"channel\": \"totp\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/otp/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"payout\",\n \"required\": true,\n \"channel\": \"totp\"\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"actions": [
{
"action": "payout",
"required": true,
"channel": "totp",
"source": "account"
}
]
}授权
会话 JWT(来自注册/登录)或 API key(pk_...)。
也接受 X-API-Key: <token> 作为替代请求头。
请求头
请求体
application/json
响应
更新后的有效策略。
最后修改于 2026年7月19日
⌘I