Verify a challenge
curl --request POST \
--url https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verifyimport requests
url = "https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify', 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://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"access": "<string>",
"refresh": "<string>",
"csrf": "<string>",
"access_expires_at": "2023-11-07T05:31:56Z",
"refresh_expires_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"challenge": {
"token": "ch_abc123xyz789",
"status": "pending",
"purpose": "authenticate",
"method": "email_otp",
"expires_at": "2023-11-07T05:31:56Z",
"remaining_attempts": 3,
"time_remaining": 540,
"intent": "<string>",
"delivery_required": true
},
"mfa_required": true,
"mfa_challenge": {
"token": "ch_abc123xyz789",
"status": "pending",
"purpose": "authenticate",
"method": "email_otp",
"expires_at": "2023-11-07T05:31:56Z",
"remaining_attempts": 3,
"time_remaining": 540,
"intent": "<string>",
"delivery_required": true
},
"available_methods": [
"totp",
"sms",
"email"
],
"status": "completed",
"intent": "<string>",
"intent_fields": {}
}{
"error": "Invalid code",
"remaining_attempts": 2
}Challenges
Verify a challenge
Submit verification for a challenge.
For OTP/backup code verification: Send code parameter
For WebAuthn verification: Send credential parameter with assertion
On successful verification:
authenticateandmfachallenges return session tokensstep_up,verify_contact,customchallenges return completion status- If MFA is required after authentication, returns
mfa_required: truewith a new MFA challenge
POST
/
v1
/
auth
/
{app_id}
/
challenges
/
{token}
/
verify
Verify a challenge
curl --request POST \
--url https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verifyimport requests
url = "https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify', 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://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/auth/{app_id}/challenges/{token}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"access": "<string>",
"refresh": "<string>",
"csrf": "<string>",
"access_expires_at": "2023-11-07T05:31:56Z",
"refresh_expires_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"challenge": {
"token": "ch_abc123xyz789",
"status": "pending",
"purpose": "authenticate",
"method": "email_otp",
"expires_at": "2023-11-07T05:31:56Z",
"remaining_attempts": 3,
"time_remaining": 540,
"intent": "<string>",
"delivery_required": true
},
"mfa_required": true,
"mfa_challenge": {
"token": "ch_abc123xyz789",
"status": "pending",
"purpose": "authenticate",
"method": "email_otp",
"expires_at": "2023-11-07T05:31:56Z",
"remaining_attempts": 3,
"time_remaining": 540,
"intent": "<string>",
"delivery_required": true
},
"available_methods": [
"totp",
"sms",
"email"
],
"status": "completed",
"intent": "<string>",
"intent_fields": {}
}{
"error": "Invalid code",
"remaining_attempts": 2
}Response
verification successful - step-up/custom
JWT access token
JWT refresh token
CSRF token
App user ID
Show child attributes
Show child attributes
Example:
true
Show child attributes
Show child attributes
Available MFA methods for the user
Example:
["totp", "sms", "email"]
Example:
"completed"
The custom intent name
Intent-specific data
Was this page helpful?