Set up 2FA (start) (v2)
curl --request POST \
--url https://api.next.orenda.finance/v2/auth/security-setup/mfa/setup \
--header 'Content-Type: application/json' \
--header 'x-program-id: <x-program-id>' \
--data '
{
"sessionToken": "3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b"
}
'import requests
url = "https://api.next.orenda.finance/v2/auth/security-setup/mfa/setup"
payload = { "sessionToken": "3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b" }
headers = {
"x-program-id": "<x-program-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-program-id': '<x-program-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({sessionToken: '3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b'})
};
fetch('https://api.next.orenda.finance/v2/auth/security-setup/mfa/setup', 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.next.orenda.finance/v2/auth/security-setup/mfa/setup",
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([
'sessionToken' => '3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-program-id: <x-program-id>"
],
]);
$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.next.orenda.finance/v2/auth/security-setup/mfa/setup"
payload := strings.NewReader("{\n \"sessionToken\": \"3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-program-id", "<x-program-id>")
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.next.orenda.finance/v2/auth/security-setup/mfa/setup")
.header("x-program-id", "<x-program-id>")
.header("Content-Type", "application/json")
.body("{\n \"sessionToken\": \"3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.next.orenda.finance/v2/auth/security-setup/mfa/setup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-program-id"] = '<x-program-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sessionToken\": \"3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"secret": "JBSWY3DPEHPK3PXP",
"qrUri": "otpauth://totp/Orenda:ada.lovelace@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Orenda"
}
}Security setup
Set up 2FA (start) (v2)
Step 1 of the 2FA path for a user finishing a SECURITY_SETUP_REQUIRED challenge. Send the challenge’s sessionToken. You get back a secret and an otpauth:// qrUri to render as a QR code. The user scans it into their authenticator app, then you confirm with the first 6-digit code. No bearer token; this runs before the user has tokens.
POST
/
v2
/
auth
/
security-setup
/
mfa
/
setup
Set up 2FA (start) (v2)
curl --request POST \
--url https://api.next.orenda.finance/v2/auth/security-setup/mfa/setup \
--header 'Content-Type: application/json' \
--header 'x-program-id: <x-program-id>' \
--data '
{
"sessionToken": "3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b"
}
'import requests
url = "https://api.next.orenda.finance/v2/auth/security-setup/mfa/setup"
payload = { "sessionToken": "3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b" }
headers = {
"x-program-id": "<x-program-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-program-id': '<x-program-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({sessionToken: '3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b'})
};
fetch('https://api.next.orenda.finance/v2/auth/security-setup/mfa/setup', 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.next.orenda.finance/v2/auth/security-setup/mfa/setup",
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([
'sessionToken' => '3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-program-id: <x-program-id>"
],
]);
$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.next.orenda.finance/v2/auth/security-setup/mfa/setup"
payload := strings.NewReader("{\n \"sessionToken\": \"3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-program-id", "<x-program-id>")
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.next.orenda.finance/v2/auth/security-setup/mfa/setup")
.header("x-program-id", "<x-program-id>")
.header("Content-Type", "application/json")
.body("{\n \"sessionToken\": \"3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.next.orenda.finance/v2/auth/security-setup/mfa/setup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-program-id"] = '<x-program-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sessionToken\": \"3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"secret": "JBSWY3DPEHPK3PXP",
"qrUri": "otpauth://totp/Orenda:ada.lovelace@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Orenda"
}
}Headers
Identifies the program. Can also be sent as the programId query parameter.
Body
application/json
From the SECURITY_SETUP_REQUIRED challenge.
Example:
"3f1c2e8a-9b4d-4e6f-8a1b-2c3d4e5f6a7b"