Request OTP
curl --request GET \
--url https://app.anlytic.com/api/v1/users/otp \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://app.anlytic.com/api/v1/users/otp"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://app.anlytic.com/api/v1/users/otp', 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://app.anlytic.com/api/v1/users/otp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.anlytic.com/api/v1/users/otp"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.anlytic.com/api/v1/users/otp")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.anlytic.com/api/v1/users/otp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"message": "ok",
"mfa_required": true,
"challenge_token": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Request OTP
Send a one-time passcode to the user’s email.
Uses HTTP Basic Auth — pass email as username. The password field is ignored.
Authorization: Basic <encoded-value>
Example with cURL:
curl --request GET \
--url https://app.anlytic.com/api/v1/users/otp \
--header 'Authorization: Basic <encoded-value>'
Request OTP
curl --request GET \
--url https://app.anlytic.com/api/v1/users/otp \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://app.anlytic.com/api/v1/users/otp"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://app.anlytic.com/api/v1/users/otp', 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://app.anlytic.com/api/v1/users/otp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.anlytic.com/api/v1/users/otp"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.anlytic.com/api/v1/users/otp")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.anlytic.com/api/v1/users/otp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"message": "ok",
"mfa_required": true,
"challenge_token": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
HTTP Basic Auth. For OTP request: pass email as username only (password field is ignored).
For token exchange: pass email as username and the OTP code (received by email) in the password field (email:otp_code).
Response
OTP sent successfully, or MFA challenge initiated.
When MFA is not enabled for the user, returns {message: "ok"}.
When MFA is enabled, returns {mfa_required: true, challenge_token: "..."} — use challenge_token to proceed via POST /api/v1/users/mfa/challenge/{kid}.
Last modified on July 23, 2026