Integration
Mint an SDK token
Exchange your client ID and API key for a 15 minute bearer token to hand to the idto SDK.
POST
/
auth
/
sdk
/
token
Mint an SDK token
curl --request POST \
--url https://prod.idto.ai/auth/sdk/token \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "8f14e45f-ceea-467e-bd93-4a2c11e0a1b2",
"client_secret": "YOUR_API_KEY"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '8f14e45f-ceea-467e-bd93-4a2c11e0a1b2',
client_secret: 'YOUR_API_KEY'
})
};
fetch('https://prod.idto.ai/auth/sdk/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '8f14e45f-ceea-467e-bd93-4a2c11e0a1b2',
client_secret: 'YOUR_API_KEY'
})
};
fetch('https://prod.idto.ai/auth/sdk/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod.idto.ai/auth/sdk/token"
payload = {
"client_id": "8f14e45f-ceea-467e-bd93-4a2c11e0a1b2",
"client_secret": "YOUR_API_KEY"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod.idto.ai/auth/sdk/token"
payload := strings.NewReader("{\n \"client_id\": \"8f14e45f-ceea-467e-bd93-4a2c11e0a1b2\",\n \"client_secret\": \"YOUR_API_KEY\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod.idto.ai/auth/sdk/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([
'client_id' => '8f14e45f-ceea-467e-bd93-4a2c11e0a1b2',
'client_secret' => 'YOUR_API_KEY'
]),
CURLOPT_HTTPHEADER => [
"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://prod.idto.ai/auth/sdk/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"8f14e45f-ceea-467e-bd93-4a2c11e0a1b2\",\n \"client_secret\": \"YOUR_API_KEY\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://prod.idto.ai/auth/sdk/token")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"8f14e45f-ceea-467e-bd93-4a2c11e0a1b2\",\n \"client_secret\": \"YOUR_API_KEY\"\n}")
.asString();{
"access_token": "eyJhbGciOiJIUzI1NiJ9.example.sdk-token",
"token_type": "bearer",
"expires_in": 900
}Your API key must never reach a browser or a mobile app. Call this endpoint from your server, then pass only the returned
Use the key pair issued for the environment you call: staging keys do not work on production and the other way round.
Working server examples in nine stacks: Node Express, TypeScript, FastAPI, Flask, Django, Go, PHP, Ruby, Java.
Was this page helpful? Email us at tech@idto.ai with the page link.
access_token to the idto SDK. The token expires after 900 seconds; mint a fresh one for each verification flow you open.
1
Your server calls this endpoint
Send
client_id and client_secret (your API key) in the JSON body. No auth headers are needed.2
Return the token to your front end
Send only
access_token to your web page or app.3
Open the flow
Initialise the idto SDK with the token. See the SDK guides.
Environments
| Environment | Base URL | Notes |
|---|---|---|
| Production | https://prod.idto.ai | Keys from the dashboard after go-live. Billed. |
| Staging | https://dev.idto.ai | Keys on request from your idto account manager. Calls reach live sources, so use identities you are authorised to verify. Staging credits are deducted from your staging account. |
Errors
| Code | HTTP | Body | Billed |
|---|---|---|---|
| Client ID and API key do not match | 401 | {"detail": "Invalid client credentials"} | No |
| Client is inactive | 401 | {"detail": "Client is inactive"} | No |
client_id or client_secret missing | 422 | {"detail": [...]} | No |
| Unexpected failure | 500 | Our side failed. Retry after a few seconds; if it persists, write to tech@idto.ai with the request time. | No |
Was this page helpful? Email us at tech@idto.ai with the page link.
Body
application/json
Last modified on October 4, 2026
Mint an SDK token
curl --request POST \
--url https://prod.idto.ai/auth/sdk/token \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "8f14e45f-ceea-467e-bd93-4a2c11e0a1b2",
"client_secret": "YOUR_API_KEY"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '8f14e45f-ceea-467e-bd93-4a2c11e0a1b2',
client_secret: 'YOUR_API_KEY'
})
};
fetch('https://prod.idto.ai/auth/sdk/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '8f14e45f-ceea-467e-bd93-4a2c11e0a1b2',
client_secret: 'YOUR_API_KEY'
})
};
fetch('https://prod.idto.ai/auth/sdk/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod.idto.ai/auth/sdk/token"
payload = {
"client_id": "8f14e45f-ceea-467e-bd93-4a2c11e0a1b2",
"client_secret": "YOUR_API_KEY"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod.idto.ai/auth/sdk/token"
payload := strings.NewReader("{\n \"client_id\": \"8f14e45f-ceea-467e-bd93-4a2c11e0a1b2\",\n \"client_secret\": \"YOUR_API_KEY\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod.idto.ai/auth/sdk/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([
'client_id' => '8f14e45f-ceea-467e-bd93-4a2c11e0a1b2',
'client_secret' => 'YOUR_API_KEY'
]),
CURLOPT_HTTPHEADER => [
"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://prod.idto.ai/auth/sdk/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"8f14e45f-ceea-467e-bd93-4a2c11e0a1b2\",\n \"client_secret\": \"YOUR_API_KEY\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://prod.idto.ai/auth/sdk/token")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"8f14e45f-ceea-467e-bd93-4a2c11e0a1b2\",\n \"client_secret\": \"YOUR_API_KEY\"\n}")
.asString();{
"access_token": "eyJhbGciOiJIUzI1NiJ9.example.sdk-token",
"token_type": "bearer",
"expires_in": 900
}