API HTTP
Gli endpoint che gli SDK chiamano, per i linguaggi senza SDK o per capire un problema. Indirizzo di base: https://id.novren.net.
Ogni errore risponde con un corpo JSON { "error": "CODICE" } e lo stato elencato in Errori.
OAuth
POST /oauth/token
Scambia un codice o un refresh token. Corpo application/x-www-form-urlencoded (si accetta anche JSON). Niente cookie; CORS aperto, senza credenziali, alle origini delle tue callback URL registrate.
Codice d’autorizzazione
| Campo | Valore |
|---|---|
grant_type | authorization_code |
client_id | l’id del tuo client |
code | il codice dalla callback (43 caratteri) |
code_verifier | il verificatore PKCE |
redirect_uri | la callback URL della richiesta, esattamente |
Rinnovo
| Campo | Valore |
|---|---|
grant_type | refresh_token |
client_id | l’id del tuo client |
refresh_token | l’ultimo refresh token (43 caratteri) |
Risposta 200
{ "access_token": "eyJ…", "token_type": "Bearer", "expires_in": 300, "refresh_token": "…" }Errori: 400 OAUTH_INVALID_REQUEST (corpo malformato), 400 OAUTH_INVALID_CLIENT (client sconosciuto o disabilitato), 400 OAUTH_INVALID_GRANT (codice o refresh token sconosciuto, scaduto, già usato, PKCE che non torna, account cancellato o in cancellazione, app che l’utente sta togliendo: i casi di proposito non si distinguono), 429 RATE_LIMITED. Il motivo preciso è nel tuo log degli accessi.
Limite: 120 richieste ogni 10 minuti per indirizzo IP su /oauth/*.
POST /oauth/revoke
Chiude la catena di un refresh token (RFC 7009). Corpo: client_id, token. Risponde sempre 200 {}, anche per token sconosciuti.
GET /oauth/revocations?after=<cursore>
Il registro delle revoche, per il tuo server. Authorization: Bearer <service token>.
{
"events": [
{ "id": 812, "kind": "family", "subject": "<sid>", "at": 1764331200 },
{ "id": 813, "kind": "account", "subject": "<id account>", "at": 1764331260 }
],
"cursor": 813
}family: la catenasubject(il claimsid) è chiusa;account: ogni token di quell’account emesso fino adat(secondi Unix) è revocato;- si tengono solo gli eventi degli ultimi 10 minuti: gli access token durano 5;
- la volta dopo passa il
cursorricevuto comeafter.
GET /.well-known/jwks.json
Le chiavi pubbliche degli access token (Ed25519, alg: EdDSA, use: sig, con kid). Tienile in cache; riscaricale quando un token porta un kid sconosciuto.
La pagina di login
GET https://account.novren.net/autorizza
Non è un’API: è la pagina dove l’SDK manda l’utente. Parametri: client_id, redirect_uri, code_challenge (S256, 43 caratteri), handoff_key (chiave pubblica X-Wing, base64url), state e, facoltativo, ui_locales. La risposta torna su redirect_uri come descritto in Come funziona il login.
API di servizio
Per il tuo server, con Authorization: Bearer <service token> (64 caratteri esadecimali). Risponde solo sui tuoi utenti; ogni altro account riceve 404, esattamente come un account che non esiste. Un token sbagliato riceve 401 AUTH_FAILED.
const ID_SERVER = 'https://id.novren.net'
const auth = { authorization: `Bearer ${process.env.NOVREN_ID_SERVICE_TOKEN}` }
interface ServiceAccount {
id: string
email: string
mfa: boolean // two-factor authentication turned on
status: 'active' | 'locked'
createdAt: string
deletionDueAt: string | null // deletion requested: no tokens until then
}
/** One of YOUR users. `null` also for accounts that never used your app. */
export async function findUser(accountId: string): Promise<ServiceAccount | null> {
const response = await fetch(`${ID_SERVER}/service/accounts/${accountId}`, { headers: auth })
if (response.status === 404) return null
if (!response.ok) throw new Error(`Novren ID: HTTP ${response.status}`)
return (await response.json()) as ServiceAccount
}
/** All your users whose email starts with `prefix`, page by page. */
export async function* listUsers(prefix = '') {
let cursor: string | null = null
do {
const query = new URLSearchParams({ prefix, limit: '200', ...(cursor ? { cursor } : {}) })
const response = await fetch(`${ID_SERVER}/service/accounts?${query}`, { headers: auth })
if (!response.ok) throw new Error(`Novren ID: HTTP ${response.status}`)
const page = (await response.json()) as { items: Omit<ServiceAccount, 'deletionDueAt'>[]; cursor: string | null }
yield* page.items
cursor = page.cursor
} while (cursor)
}GET /service/accounts/:id
{
"id": "6f1c…",
"email": "ada@example.com",
"mfa": true,
"status": "active",
"createdAt": "2026-11-02T10:15:00.000Z",
"deletionDueAt": null
}status è active o locked. deletionDueAt c’è mentre una cancellazione è in corso: fino ad allora l’account non riceve token.
GET /service/accounts?email=<email>
L’id di un tuo utente dalla sua email: { "id": "…" }, oppure 404.
GET /service/accounts?prefix=<testo>&limit=<n>&cursor=<c>
I tuoi utenti la cui email inizia con prefix (vuoto: tutti), in ordine di email, limit da 1 a 200 (predefinito 50). Risposta { "items": [ … ], "cursor": "…" | null }; passa cursor per la pagina successiva.
GET /service/stats
{ "accounts": 1234 }: quanti utenti ha la tua app.
GET /service/events?after=<id>
Account cancellati e utenti che hanno tolto la tua app, ultimi 90 giorni, fino a 1000 per pagina.
{ "events": [{ "id": 41, "kind": "account-deleted", "accountId": "…", "at": 1764331200 }], "cursor": 41 }kind è account-deleted o service-left. Vedi Gli account cancellati.
Rubrica
GET /api/directory/lookup?email=<email>&product=<id app>
L’identità pubblica di una persona per la tua app, con Authorization: Bearer <access token della tua app> (il token dell’utente che cerca). 120 ricerche all’ora per account.
{
"accountId": "…",
"product": "app-…",
"version": 1,
"encryptionKey": "…",
"signingKey": "…",
"signature": "…",
"accountSigningKey": "…"
}404 se quella persona non ha un’identità per la tua app (non l’ha mai autorizzata). Controlla la risposta con verifyDirectoryEntry prima di usarla. Questo endpoint non è aperto alle origini dei browser: chiamalo dal tuo server.