curl --request POST \
--url https://ivs.idenfy.com/age-estimation/token/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"min_age": 60,
"confidence_threshold": 50,
"buffer": 0,
"escalation": "DOC",
"retry_limit": 3,
"save_photo": true,
"expiry_minutes": 60,
"success_redirect": "",
"underage_redirect": "",
"uncertain_redirect": "",
"webhook_url": "",
"client_id": "<string>"
}
'import requests
url = "https://ivs.idenfy.com/age-estimation/token/"
payload = {
"min_age": 60,
"confidence_threshold": 50,
"buffer": 0,
"escalation": "DOC",
"retry_limit": 3,
"save_photo": True,
"expiry_minutes": 60,
"success_redirect": "",
"underage_redirect": "",
"uncertain_redirect": "",
"webhook_url": "",
"client_id": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
min_age: 60,
confidence_threshold: 50,
buffer: 0,
escalation: 'DOC',
retry_limit: 3,
save_photo: true,
expiry_minutes: 60,
success_redirect: '',
underage_redirect: '',
uncertain_redirect: '',
webhook_url: '',
client_id: '<string>'
})
};
fetch('https://ivs.idenfy.com/age-estimation/token/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://ivs.idenfy.com/age-estimation/token/")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ivs.idenfy.com/age-estimation/token/",
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([
'min_age' => 60,
'confidence_threshold' => 50,
'buffer' => 0,
'escalation' => 'DOC',
'retry_limit' => 3,
'save_photo' => true,
'expiry_minutes' => 60,
'success_redirect' => '',
'underage_redirect' => '',
'uncertain_redirect' => '',
'webhook_url' => '',
'client_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://ivs.idenfy.com/age-estimation/token/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://ivs.idenfy.com/age-estimation/token/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
request.AddJsonBody("{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ivs.idenfy.com/age-estimation/token/"
payload := strings.NewReader("{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}")
val request = Request.Builder()
.url("https://ivs.idenfy.com/age-estimation/token/")
.post(body)
.addHeader("Authorization", "Basic <encoded-value>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()import Foundation
let parameters = [
"min_age": 60,
"confidence_threshold": 50,
"buffer": 0,
"escalation": "DOC",
"retry_limit": 3,
"save_photo": true,
"expiry_minutes": 60,
"success_redirect": "",
"underage_redirect": "",
"uncertain_redirect": "",
"webhook_url": "",
"client_id": "<string>"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://ivs.idenfy.com/age-estimation/token/")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self)){
"token": "<string>",
"session_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"min_age": 123,
"confidence_threshold": 123,
"buffer": 123,
"escalation": "DOC",
"retry_limit": 123,
"save_photo": true,
"expiry_minutes": 123,
"client_id": "<string>"
}{
"message": "Action not allowed due to lack of funds or exceeded limit.",
"code": "insufficient_finances",
"detail": {
"detail": "<string>",
"missing_limits": [
"<unknown>"
],
"missing_additional_step_limits": [
"<unknown>"
],
"missing_funds": "<unknown>",
"missing_pool_funds": [
{
"fund_pool": "<string>",
"missing": 123
}
],
"expired_expenses": [
"<unknown>"
]
}
}Create session
Creates an age estimation session. Your Age Estimation finances are pre-checked; insufficient finances reject the request with 402.
curl --request POST \
--url https://ivs.idenfy.com/age-estimation/token/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"min_age": 60,
"confidence_threshold": 50,
"buffer": 0,
"escalation": "DOC",
"retry_limit": 3,
"save_photo": true,
"expiry_minutes": 60,
"success_redirect": "",
"underage_redirect": "",
"uncertain_redirect": "",
"webhook_url": "",
"client_id": "<string>"
}
'import requests
url = "https://ivs.idenfy.com/age-estimation/token/"
payload = {
"min_age": 60,
"confidence_threshold": 50,
"buffer": 0,
"escalation": "DOC",
"retry_limit": 3,
"save_photo": True,
"expiry_minutes": 60,
"success_redirect": "",
"underage_redirect": "",
"uncertain_redirect": "",
"webhook_url": "",
"client_id": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
min_age: 60,
confidence_threshold: 50,
buffer: 0,
escalation: 'DOC',
retry_limit: 3,
save_photo: true,
expiry_minutes: 60,
success_redirect: '',
underage_redirect: '',
uncertain_redirect: '',
webhook_url: '',
client_id: '<string>'
})
};
fetch('https://ivs.idenfy.com/age-estimation/token/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://ivs.idenfy.com/age-estimation/token/")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ivs.idenfy.com/age-estimation/token/",
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([
'min_age' => 60,
'confidence_threshold' => 50,
'buffer' => 0,
'escalation' => 'DOC',
'retry_limit' => 3,
'save_photo' => true,
'expiry_minutes' => 60,
'success_redirect' => '',
'underage_redirect' => '',
'uncertain_redirect' => '',
'webhook_url' => '',
'client_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://ivs.idenfy.com/age-estimation/token/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://ivs.idenfy.com/age-estimation/token/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
request.AddJsonBody("{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ivs.idenfy.com/age-estimation/token/"
payload := strings.NewReader("{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"min_age\": 60,\n \"confidence_threshold\": 50,\n \"buffer\": 0,\n \"escalation\": \"DOC\",\n \"retry_limit\": 3,\n \"save_photo\": true,\n \"expiry_minutes\": 60,\n \"success_redirect\": \"\",\n \"underage_redirect\": \"\",\n \"uncertain_redirect\": \"\",\n \"webhook_url\": \"\",\n \"client_id\": \"<string>\"\n}")
val request = Request.Builder()
.url("https://ivs.idenfy.com/age-estimation/token/")
.post(body)
.addHeader("Authorization", "Basic <encoded-value>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()import Foundation
let parameters = [
"min_age": 60,
"confidence_threshold": 50,
"buffer": 0,
"escalation": "DOC",
"retry_limit": 3,
"save_photo": true,
"expiry_minutes": 60,
"success_redirect": "",
"underage_redirect": "",
"uncertain_redirect": "",
"webhook_url": "",
"client_id": "<string>"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://ivs.idenfy.com/age-estimation/token/")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self)){
"token": "<string>",
"session_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"min_age": 123,
"confidence_threshold": 123,
"buffer": 123,
"escalation": "DOC",
"retry_limit": 123,
"save_photo": true,
"expiry_minutes": 123,
"client_id": "<string>"
}{
"message": "Action not allowed due to lack of funds or exceeded limit.",
"code": "insufficient_finances",
"detail": {
"detail": "<string>",
"missing_limits": [
"<unknown>"
],
"missing_additional_step_limits": [
"<unknown>"
],
"missing_funds": "<unknown>",
"missing_pool_funds": [
{
"fund_pool": "<string>",
"missing": 123
}
],
"expired_expenses": [
"<unknown>"
]
}
}Authorizations
The request must contain basic auth headers where username is API key and password is API secret.
In order for you to start using our API you will need an API key and API secret.
Both can be retrieved by contacting iDenfy's support or iDenfy's sales team.
Body
Minimum age the end user must meet.
1 <= x <= 120Minimum model confidence to accept an estimate without a step-up.
0 <= x <= 100Age band (in years) around min_age that triggers a step-up instead of an immediate decision. Must not exceed min_age. Applies to the AI estimate only, never to a document-derived age.
0 <= x <= 20Action when the estimate is uncertain. DOC = document step-up; NONE = resolve as UNCERTAIN.
DOC, NONE Max estimation attempts before the session locks.
1 <= x <= 3Whether the analysed selfie is stored for sessions from this token.
Token validity window in minutes from creation.
5 <= x <= 1440Redirect after a SUCCESS outcome (blank = built-in result screen).
2048Redirect after an UNDERAGE outcome.
2048Redirect after a terminal UNCERTAIN outcome.
2048Per-session override for where the result notification is sent. Blank = use your account's default Age Estimation webhook notification.
2048Your own identifier for the end user; echoed back in the result webhook for correlation.
100Response
Opaque session credential used by the capture page.
URL to send the end user to.
Absolute UTC expiry.
DOC, NONE Related topics
Create sessionCreating a KYB SessionIdentity Verification API (KYC)Sole Proprietorship Workflow StepCreate a SessionWas this page helpful?