Sessions
Short-lived tokens for end-user apps.
The Session object
Attributes
idrequired Type:stringtokenrequired Type:stringShown once.
expires_atrequired Type:stringmax_checksrequired Type:integersubject_referencerequired Type:string
{
"id": "ses_01j9x3m8v7k2q4r5s6t7u8v9w0",
"token": "unf_ses_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"expires_at": "2026-09-25T10:20:30Z",
"max_checks": 1,
"subject_reference": "cust-88"
} Create a client session token
POST /nib/sessions
Needs nib:checks:create: Submit checks, sessions, live
For end-user apps: one subject, one streamed check. The token is shown once.
Request body
subject_referencerequired Type:Idscoperequired Type:"check"[]ttl_secondsoptional Type:integermax_checksoptional Type:1
Returns
201Type:SessionCreated400Type:Probleminvalid_request,invalid_version,idempotency_key_requiredorinvalid_signature401Type:Problemunauthorized402Type:Problembilling_required403Type:Problempermission_denied,org_suspended, oraddress_not_allowed(your organisation only accepts requests from the addresses it has listed)404Type:Problemnot_found421Type:Problemwrong_region429Type:Problemrate_limitedorquota_exceededdefaultType:Probleminternal
curl -X POST "https://api.unforged.sh/nib/sessions" \
-H "Authorization: Bearer $UNFORGED_KEY" \
-H "Unforged-Version: 2026-10-14" \
-H "Content-Type: application/json" \
-d '{
"subject_reference": "cust-88",
"scope": [
"check"
],
"ttl_seconds": 300
}' import requests
r = requests.post(
"https://api.unforged.sh/nib/sessions",
headers={"Authorization": f"Bearer {UNFORGED_KEY}", "Unforged-Version": "2026-10-14"},
json={
"subject_reference": "cust-88",
"scope": [
"check"
],
"ttl_seconds": 300
},
)
print(r.json()) const res = await fetch('https://api.unforged.sh/nib/sessions', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.UNFORGED_KEY}`, 'Unforged-Version': '2026-10-14', 'Content-Type': 'application/json' },
body: JSON.stringify({
"subject_reference": "cust-88",
"scope": [
"check"
],
"ttl_seconds": 300
}),
});
console.log(await res.json()); {
"id": "ses_01j9x3m8v7k2q4r5s6t7u8v9w0",
"token": "unf_ses_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"expires_at": "2026-09-25T10:20:30Z",
"max_checks": 1,
"subject_reference": "cust-88"
} Revoke a session
DELETE /nib/sessions/{session_id}
Needs nib:checks:create: Submit checks, sessions, live
204 even if already revoked; its live connections close.
Parameters
session_idpathrequired Type:string
Returns
204Done401Type:Problemunauthorized403Type:Problempermission_denied,org_suspended, oraddress_not_allowed(your organisation only accepts requests from the addresses it has listed)404Type:Problemnot_found421Type:Problemwrong_region429Type:Problemrate_limitedorquota_exceededdefaultType:Probleminternal
curl -X DELETE "https://api.unforged.sh/nib/sessions/{session_id}" \
-H "Authorization: Bearer $UNFORGED_KEY" \
-H "Unforged-Version: 2026-10-14" import requests
r = requests.delete(
"https://api.unforged.sh/nib/sessions/{session_id}",
headers={"Authorization": f"Bearer {UNFORGED_KEY}", "Unforged-Version": "2026-10-14"},
)
print(r.json()) const res = await fetch('https://api.unforged.sh/nib/sessions/{session_id}', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.UNFORGED_KEY}`, 'Unforged-Version': '2026-10-14' },
});
console.log(await res.json());