curl --request POST \
--url https://{issuer}/monitoring-token/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://{issuer}/monitoring-token/"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{issuer}/monitoring-token/', 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://{issuer}/monitoring-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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{issuer}/monitoring-token/"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{issuer}/monitoring-token/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{issuer}/monitoring-token/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"monitoring_token": "mt_2f8c1d9e7b6a5f4e3d2c1b0a",
"expires_at": "2026-10-17T10:56:14Z",
"allowed_event_categories": [
"session",
"gameplay",
"bonus",
"affiliate",
"payment",
"dispute",
"responsible_gambling",
"custom"
],
"max_uses": 1000,
"bind_to_origin": "https://app.example.com",
"vendor_data": "user-42"
}Create Monitoring Token | Didit Authentication API
POST /monitoring-token/ swaps an access token for a 15-minute device credential bound to the person’s vendor_data and browser origin.
curl --request POST \
--url https://{issuer}/monitoring-token/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://{issuer}/monitoring-token/"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{issuer}/monitoring-token/', 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://{issuer}/monitoring-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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{issuer}/monitoring-token/"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{issuer}/monitoring-token/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{issuer}/monitoring-token/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"monitoring_token": "mt_2f8c1d9e7b6a5f4e3d2c1b0a",
"expires_at": "2026-10-17T10:56:14Z",
"allowed_event_categories": [
"session",
"gameplay",
"bonus",
"affiliate",
"payment",
"dispute",
"responsible_gambling",
"custom"
],
"max_uses": 1000,
"bind_to_origin": "https://app.example.com",
"vendor_data": "user-42"
}503 monitoring_unavailable.vendor_data, whatever the device claims.Authorizations
The person's access token from POST /token/: an ES256 JWT with header typ: at+jwt, valid for at most 5 minutes. Not your Didit API key.
Body
Empty: the access token names the person.
Response
A device credential for the person.
A short-lived device credential for sending the person's activity events to transaction monitoring from their device. It is not tied to the session: it stays usable until expires_at, even after sign-out.
The device credential. Treat it as a secret.
"mt_2f8c1d9e7b6a5f4e3d2c1b0a"
At most 15 minutes after it was issued.
"2026-10-17T10:56:14Z"
The event categories it may send. Authentication and security events always come from Didit, never from the device.
[
"session",
"gameplay",
"bonus",
"affiliate",
"payment",
"dispute",
"responsible_gambling",
"custom"
]
1000
The browser origin the credential works from: the request's Origin, or null when there was none.
"https://app.example.com"
The person every event is recorded for, whatever the device sends.
"user-42"