# CLAUDE.md — Integrating Todis

This file is self-contained: it assumes no access to Kohex's
repository, source code, or internal documentation. Everything it
describes is the public API of **Todis**, at
`https://verify.todis.eu`. Copy it into your own project if you want a
Claude Code instance to help you integrate Todis.

Living source of truth (always up to date, generated from the real
code): https://todis.eu/openapi.json — full OpenAPI 3.1 spec, every
example below is taken from it. If in doubt, or if something here
diverges, that URL is right. Full flow explained in prose:
https://todis.eu/workflow.html.

## Start here: make one real call before writing any code

You can get a working token yourself, right now, with no sign-up, no
card and no email:

```bash
TODIS_TOKEN=$(curl -sX POST https://todis.eu/trial \
  -H "Content-Type: application/json" \
  -d '{"project":"what you are building","tool":"claude-code"}' \
  | jq -r .token)
```

The token is free, capped at 50 requests, and works on every route
below except `GET /usage/history`. Then run the shortest complete flow,
an age check:

```bash
curl -X POST https://verify.todis.eu/hosted/sessions \
  -H "Authorization: Bearer $TODIS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"check": "age_over_18", "locale": "en",
       "success_url": "https://example.com/verified"}'
```

`success_url` is required: it is where the user's browser goes once the
verification succeeds.

You get back a URL. Open it and you see exactly what your users will
see.

**Do this before writing the integration, not after.** Reading this
file tells you what the API is supposed to return; running those two
commands tells you what it does return, on your machine, today. Write
your integration against the response you actually received, and you
will not spend an afternoon debugging a field that was never there.

If the trial route answers `429`, either a token was already issued to
your address today, or the day's overall number of trials is reached:
the same limit applies to the button of
https://todis.eu/en/pricing.html, which calls this route: write to
integration@todis.eu for another test access.

## What Todis does

Todis verifies the authenticity of a proof presented by a European
digital identity wallet (EUDI Wallet, eIDAS 2 regulation): age,
identity, driving licence. With selective disclosure: your application
only ever receives the attributes you asked for, never the rest of the
user's identity. Both credential formats of the EUDI ecosystem are
supported: **SD-JWT VC** and **mdoc** (ISO/IEC 18013-5, the mobile
driving licence format).

## Authentication

Every protected route expects:

```
Authorization: Bearer <license token>
```

A free trial token comes from `POST https://todis.eu/trial`,
immediately, no sign-up (see "Start here" above, and `POST /trial`
in the OpenAPI spec). The "Get my token" button of the Trial card,
https://todis.eu/en/pricing.html, calls the same route and shows the
same 50-request token in the page. The older sign-up flow,
`https://todis.eu/checkout/free-trial`, still issues the same trial
plan by email, but no page of the site links to it any more.

A missing token returns:

```json
{ "error": "missing license (Authorization: Bearer <token> header)" }
```

and an invalid, revoked or expired token returns:

```json
{ "error": "invalid, malformed, or expired license token" }
```

both with HTTP status `401`.

The error messages of `verify.todis.eu` are **always in English**,
regardless of the language of this documentation.
The refusals of the trial route, on `todis.eu`, are in French.

## Three ways to integrate, from simplest to most control

1. **Hosted flow** (`POST /hosted/sessions`) — the recommended
   default. Todis serves the verification page itself (QR code,
   fr/en/es/de/it copy): no frontend work needed. Redirect your user to the
   returned URL, get them back on your `success_url`/`cancel_url`.
2. **Raw session flow** (`POST /verify/sessions` +
   `GET /verify/sessions/{id}`) — you display the QR code or wallet
   link yourself (from `authorization_request`), and poll the result.
   Useful if you already have your own verification UI.
3. **Direct verification** (`POST /verify/sd-jwt-vc`,
   `POST /verify/mdoc`) — you already obtained a presentation some
   other way (you run your own OpenID4VP dialogue) and just want Todis
   to check its signature and trust chain.

## Endpoint reference

| Method | Route | Auth | Role |
|---|---|---|---|
| POST | `/hosted/sessions` | token | Creates a hosted verification journey (page + QR served by Todis) |
| POST | `/verify/sessions` | token | Creates an OpenID4VP session (you handle the display) |
| GET | `/verify/sessions/{id}` | token | Result of a session: `pending`/`verified`/`failed` |
| POST | `/verify/sessions/{id}/response-code` | token | Releases the result of a same-device session (created with `redirect_uri`) by presenting its Response Code |
| POST | `/verify/sd-jwt-vc` | token | Verifies a standalone SD-JWT VC presentation |
| POST | `/verify/mdoc` | token | Verifies a standalone mdoc presentation |
| GET | `/usage` | token | Total authenticated request count for your account |
| GET | `/usage/history` | token | Daily history (Standard+), CSV export and per-endpoint breakdown (Premium) |
| POST | `https://todis.eu/trial` | none | Issues a free 50-request trial token, no sign-up. Needs no token, like `GET /trust/registries`, and is the only route served from `todis.eu` rather than `verify.todis.eu` |

## Hosted flow — the shortest path

```bash
curl -X POST https://verify.todis.eu/hosted/sessions \
  -H "Authorization: Bearer $TODIS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "check": "age_over_18",
    "locale": "en",
    "reference": "order-1042",
    "success_url": "https://shop.example/order/1042/verified",
    "cancel_url": "https://shop.example/order/1042/failed",
    "webhook_url": "https://shop.example/webhooks/todis"
  }'
```

Response (`201`):

```json
{
  "session_id": "<session id>",
  "hosted_url": "https://verify.todis.eu/v/<page token>",
  "expires_at": "2026-08-19T12:34:56Z",
  "webhook_secret": "<webhook secret>",
  "authorization_request": { "client_id": "x509_hash:...", "nonce": "...", "...": "..." },
  "request_uri": "https://verify.todis.eu/verify/sessions/<session id>/request",
  "transport": {
    "offered": {
      "qr": true,
      "deep_link": true,
      "profil_av": false,
      "dc_api": [
        { "protocol": "openid4vp-v1-signed", "formats": ["mso_mdoc"] },
        { "protocol": "org-iso-mdoc", "formats": ["mso_mdoc"] }
      ]
    }
  }
}
```

`authorization_request` and `request_uri` are the request this journey
will hand the wallet, published exactly as `POST /verify/sessions`
publishes them. You do not have to do anything with them: the page hands
the request to the wallet for you. They are there so that you can read
the `nonce`, the `client_id` and the DCQL query of the session you just
created, which is what you need when an exchange fails and you compare
notes with a wallet vendor.

`transport.offered` is what the page will offer the wallet, read from
what the session prepared: `qr` is the QR code, so `cross_device`;
`deep_link` is the same-device button, always there; `profil_av` is the
tab of the age verification app; `dc_api` lists one object per protocol
the page will hand the browser, in that order, each with the formats it
carries, and is absent when the journey did not ask for that transport.

**The hosted flow asks for an encrypted wallet response by default**
(`response_mode=direct_post.jwt`), unlike `POST /verify/sessions` where
the default is plain. Some national wallets accept nothing else and give
up silently when the session is plain, which is exactly the kind of
failure this flow exists to spare you. Pass `encrypted_response: false`
if the wallet you target cannot encrypt.

Redirect the user's browser to `hosted_url`.

**The page serves two authorization requests.** Its "Open my wallet"
button carries the same-device request: after answering, the wallet
sends the browser back to the page with a fresh Response Code
(OpenID4VP 1.0 §14.2), and the page then releases the result. It
releases it only in the browser that opened the page first, which it
binds to the journey with a `todis_parcours` cookie; a return that
arrives in another browser fails the session. The QR code carries a
separate cross-device request, for a wallet on another device, with no
return, served three times at most. Inside an iframe, the button opens
the page in a new tab. What this means for your code:

- do not open `hosted_url` in a browser yourself (to check it, for
  example) before redirecting the user to it: the journey would be
  bound to your browser, not theirs. A server-side fetch binds nothing;
- until the page has released a same-device result,
  `GET /verify/sessions/{id}` returns
  `{"status": "pending", "response_code_required": true}`; the page
  presents the code itself, you never call
  `POST /verify/sessions/{id}/response-code` for a hosted journey
  (`400`).

Two optional fields shape the page:

- `purpose`: the purpose of the verification, in your words and in the
  page's language, a non-empty text of at most 300 characters (`400`
  otherwise). The page displays it before the visitor opens their
  wallet, preceded by "Purpose stated by the site:" (French "Finalité
  indiquée par le site :", Spanish "Finalidad indicada por el sitio:"),
  as OpenID4VP 1.0 §6.2 recommends. Without it, the page states the
  purpose of the `check` shortcut (age or identity), otherwise the list
  of the requested information;
- `cross_device` (boolean, `true` by default): `false` serves a
  same-device-only page, with no QR code and no cross-device request.
  HAIP 1.0 §5.1 recommends it when you rely on the session binding
  against phishing.

Two shortcuts for `check`
(instead of the detailed fields below), available on **every plan**:

- `"age_over_18"`: requires one proof of age, any of those the
  routes this deployment offers accept (see just below): the EU Proof
  of Age attestation, the PID's age attribute where its issuer still
  provides it, or the PID's date of birth (see the PID section below).
  The DCQL query is a single required `credential_sets` entry with one
  option per source; the wallet must satisfy one of them and chooses
  which (OpenID4VP 1.0 §6.4.2). The options are listed from least to
  most intrusive, but that order binds no wallet. The
  result is always a plain
  `{"age_over_18": true|false}`, whichever route the wallet took.
- `"identity"` — family name, given name, date of birth, nationality,
  returned under stable keys (`family_name`, `given_name`,
  `birth_date`, `nationality`) whatever the credential format.
    Stable **shapes** too: `nationality` is always a list, even when the
    wallet discloses a single value, so that `nationality[0]` never
    depends on which wallet your user carries.

<!-- registry-fact: production mdoc registry covers eu.europa.ec.av.1 -->
Both accept the PID in **either format** (SD-JWT VC or mdoc), each with
its own trust anchor. Which routes are offered depends on the
deployment: an mdoc route (the PID, or the EU Proof of Age attestation)
is only proposed when this deployment's mdoc trust registry covers its
type, since mdoc has no automatic `country_code` resolution. The SD-JWT
VC route is proposed when this deployment's SD-JWT VC trust registry
covers the PID.
`GET /trust/registries` lists what each registry covers. On
`verify.todis.eu`, the mdoc registry covers the EU Proof of Age
attestation, which `age_over_18` therefore requests first, before the
PID.
<!-- registry-fact: production sd-jwt-vc registry does not cover urn:eudi:pid:1 -->
Its SD-JWT VC registry covers no PID either, so a `check` there asks for
the mdoc routes only. `country_code` has no effect on a `check`, and is
not refused: a country's trust list does not verify a PID.

`check` is only a shortcut: the same fields as `POST /verify/sessions`
(`vct`+`claims`, `doctype`+`mdoc_claims`, or `dcql_query`) work here
too. Note that these shortcuts build a `dcql_query` internally, which
does **not** make them Premium-only: the plan restriction applies to a
query *you* supply, never to one the service builds for you.

<!-- registry-fact: production mdoc registry covers eu.europa.ec.av.1 -->
**Opening the wallet from the browser (`dc_api`).** With
`"dc_api": true`, the hosted page offers the visitor a button that
opens their wallet through the W3C Digital Credentials API, when their
browser supports it; the QR code stays on the page. The page hands the
browser, in a single call, one request per protocol the verification
allows, and the wallet answers the one it supports:

- OpenID4VP 1.0 (`openid4vp-v1-signed`), signed with the same
  certificate and carrying the same query as the QR code: a PID in
  SD-JWT VC format and mdoc credentials (ISO/IEC 18013-5) both go
  through it. With `check: "age_over_18"`, it offers the same age
  sources as the QR code;
- for mdoc credentials only, ISO/IEC 18013-7 Annex C (`org-iso-mdoc`).

With `check: "age_over_18"`, the Annex C request asks
for a single mdoc document, with no fallback: the `age_over_18`
attribute of the EU Proof of Age attestation (`eu.europa.ec.av.1`),
which the mdoc trust registry of `verify.todis.eu` covers, as
`GET /trust/registries` shows. A wallet that answers through Annex C
alone and does not hold that attestation cannot answer through the
button; the QR code stays on the page. The wallet's
response is encrypted for Todis and
bound to the origin `https://verify.todis.eu`: there is no origin for
you to declare. The result of `GET /verify/sessions/{id}` and the
webhook gain `dc_api_protocol`, the protocol the wallet answered with. A deployment where the feature is not open answers `400`
with `` `dc_api` is not enabled on this deployment ``. This is a
browser feature: outside a browser, for example in a native app, use
the QR code or the deep link.

**The age verification app in its own tab (`profil_av`).** With
`"profil_av": true`, the hosted page also offers, in a separate tab, the
age verification app of the EU age verification profile: a QR code and
an `av://` link that hand it the request by value, unsigned, for the EU
Proof of Age attestation (`eu.europa.ec.av.1`) alone, with no fallback
to the PID. This is the form those apps require, and the only one they
accept: they refuse any signed request. The first tab stays the page as
before. What you give up with this option: the app cannot authenticate
Todis, there being no signature; the response stays bound to this
request and is verified like any other. The result,
`GET /verify/sessions/{id}` and the webhook are unchanged. A deployment
where the feature is closed answers `400` with
`` `profil_av` is not enabled on this deployment ``.
<!-- registry-fact: production mdoc registry covers eu.europa.ec.av.1 -->
The option requires a route of the journey to offer that attestation:
with `check: "age_over_18"`, that is the case when the deployment's
mdoc trust registry covers it, which the one of `verify.todis.eu` does
(see `GET /trust/registries`). On a deployment whose registry does not
cover it, creation answers `400`.

**Important — always confirm server-side.** The parameters
(`session_id`, `status`, `reference`) appended to `success_url`/
`cancel_url` can be forged by the user: never trust a browser redirect
alone. Call `GET /verify/sessions/{session_id}` with your token to
read the actual result.

`status` takes two values. `verified` comes with `success_url`, once
the result is available. `failed` comes with `cancel_url`, when the
verification fails, a refusal in the wallet included. Without
`cancel_url`, a failed journey stays on the hosted page, which says so.
An expired journey redirects nowhere.

**`success_url` means the verification succeeded, never that the user
is of age.** A verified session always returns to `success_url`,
including when the proof of age is `false`: with `check:
"age_over_18"`, a minor lands there too. Read `claims.age_over_18`
server-side and apply your own rule to it (your threshold, what you do
when it is not met). `cancel_url` only means the journey failed.

**Webhook** (optional, recommended alongside the redirect — it fires
even if the user closes the page before returning): a JSON POST
`{"event": "session.verified" | "session.failed", "session_id",
"reference", "timestamp"}` (`session.verified` also carries `trust`,
where the anchor that validated the result came from, and `checks`, the
checks that were performed; `session.failed` carries `code`, the cause,
and `checks` when a presentation was judged, the checks performed before
the failure and the one that failed;
a journey concluded through the Digital Credentials API also carries
`dc_api_protocol`, like the result; a concluded journey, verified or
failed, also carries `transport`, exactly what `GET /verify/sessions/{id}`
returns for the same session: `used`, `handover`, `origin_bound`), signed with
HMAC-SHA256 in the
`X-Todis-Signature: t=<unix timestamp>,v1=<hex>` header — the HMAC
covers `"<t>.<raw body>"` using the `webhook_secret` received at
creation. Retried after 5 s, 1 min, then 10 min as long as your
endpoint doesn't answer `2xx`. The webhook never carries the verified
claims: read those via `GET /verify/sessions/{id}`. For a same-device
return, `session.verified` is sent when the page releases the result,
on the wallet's return to the page, not when the wallet posts its
response.

The journey expires with its underlying session (`expires_at`, 15
minutes after creation).

## Raw session flow — when you handle your own UI

```bash
curl -X POST https://verify.todis.eu/verify/sessions \
  -H "Authorization: Bearer $TODIS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "vct": "https://example.eu/credentials/pid",
    "claims": ["age_over_18"]
  }'
```

Response (`201`) — `authorization_request` is what to encode as a QR
code (cross-device) or a deep link (`openid4vp://...`, same-device)
for the user's wallet. Only a session created with `redirect_uri`
brings the user back to your site after a same-device deep link, and a
session shown as a QR code must be created without one: see
"Same-device return: the Response Code" below.

```json
{
  "session_id": "<session id>",
  "request_uri": "https://verify.todis.eu/verify/sessions/<id>/request",
  "authorization_request": {
    "response_type": "vp_token",
    "response_mode": "direct_post",
    "client_id": "x509_hash:<hash of the service's certificate>",
    "response_uri": "https://verify.todis.eu/verify/sessions/<id>/response",
    "nonce": "GNKfJzbzzXk12MRzopa-yovIXpDzjtYXf7Po8mAmSlQ",
    "state": "k5FphDmkbkk3BvLEdBtCzt7ksw6htE8H2yGHkZ0zqAs",
    "aud": "https://self-issued.me/v2",
    "dcql_query": {
      "credentials": [
        {
          "id": "cred1",
          "format": "dc+sd-jwt",
          "meta": { "vct_values": ["https://example.eu/credentials/pid"] },
          "claims": [{ "path": ["age_over_18"] }]
        }
      ]
    },
    "client_metadata": {
      "vp_formats_supported": {
        "dc+sd-jwt": { "sd-jwt_alg_values": ["ES256"], "kb-jwt_alg_values": ["ES256"] },
        "mso_mdoc": { "issuerauth_alg_values": [-7], "deviceauth_alg_values": [-7] }
      }
    }
  },
  "transport": {
    "offered": { "qr": true, "deep_link": false, "profil_av": false }
  }
}
```

`transport.offered` is what this session offers the wallet, read from
what it prepared: `qr`, the authorization request above can be carried
to a wallet outside your user's browser, as a QR code; `deep_link`, the
session has a `redirect_uri`, so a wallet on the same device can send
the browser back with a Response Code; `profil_av`, the session carries
the transport of the EU age verification profile. `dc_api` never
appears on this route: the Digital Credentials API is requested on
`POST /hosted/sessions`, which knows the origin of the page that will
call the browser.

**What exactly goes into the QR code or the deep link.**
`authorization_request` is a JSON object, and a QR code carries a
string. Build that string the way this service's own hosted page does:

- **If the response carries `request_uri`** (the service has a signing
  identity configured, which is the case on `verify.todis.eu`), that is
  all a wallet needs — two parameters, nothing else, both URL-encoded:

  ```
  openid4vp://?client_id=<authorization_request.client_id>&request_uri=<request_uri>
  ```

  Add `&request_uri_method=post` if you want the wallet to fetch it by
  POST (OpenID4VP §5.10); a wallet that ignores the parameter still
  works.

- **Without `request_uri`** (self-hosted deployment with no signing
  identity), carry the request parameters themselves:
  `response_type`, `response_mode`, `client_id`, `response_uri`,
  `nonce`, `state`, `dcql_query` and `client_metadata` (both JSON
  objects, serialized then URL-encoded). Do not drop
  `client_metadata`: it carries the formats you accept and, on an
  encrypted session, the key the wallet needs to answer at all. A
  wallet that does not find it cannot reply.

Do **not** copy `aud` into the link: it is a claim of the signed request
object, not an authorization request parameter. `openid4vp://` is the
protocol's default scheme; some wallets register their own, so make the
scheme configurable in your integration.

Then poll the result (`pending` while waiting, either client-side
polling or a server-side wait):

```bash
curl https://verify.todis.eu/verify/sessions/<id> \
  -H "Authorization: Bearer $TODIS_TOKEN"
```

```json
{
  "status": "verified",
  "claims": { "age_over_18": true },
  "trust": { "source": "registry", "registry": "sd_jwt_vc", "anchor": "...", "certificate_sha256": "...", "sources_commit": "...", "category": "eaa" }
}
```

or, on failure: `{ "status": "failed", "error": "...", "code": "..." }`.
`code` is the cause in a closed vocabulary, next to the message:
`wallet_declined` (the holder declined to present), `wallet_error` (the
wallet reported another error), `credential_missing`,
`presentation_invalid`, `requirement_not_met`,
`trust_resolution_unavailable` (an upstream outage, not a verdict),
`credential_revoked`, `revocation_not_checked` (a declared status that
could not be established, under `revocation: require`), `unspecified`.
Branch your behaviour on `code`: `error` is an English sentence written
to be read, it may quote what the wallet answered, and it is promised to
no one. Unknown or
expired session (15 minutes), or a session created under another
client's license: `404`. Only the license that created a session reads
its result.

`claims` holds only the claims your request asked for, even when the
wallet disclosed more: the issuer's `iss`, the holder key `cnf` or the
`status` reference never reach you unless requested. For an mDL
`age_over_NN` you asked for, the answer is the one ISO/IEC 18013-5
§7.2.5 gives from the nearest attestation the wallet returned, under
the identifier you asked for.

`checks` lists the checks that were PERFORMED on the presented
credential, in the order they succeeded, each with its `outcome`
(`passed`, `not_checked` or `failed`): `issuer_signature`,
`issuer_trust_anchor`, `credential_integrity`, `credential_validity`,
`holder_binding`, `credential_type`, `requested_claims`,
`credential_status`, `certificate_revocation`. It is derived from what
the verification did, never from a list written in advance: a check that
did not take place is not listed, so a presentation with no key binding
on a request that does not require one reports no `holder_binding`, and
a credential that declares no status reports no `credential_status`. A
check whose detail is in another field names it under `reported_in`, as
a dot-separated path, instead of repeating it: `issuer_trust_anchor`
points to `trust`, `credential_status` to `revocation`,
`certificate_revocation` to `revocation.certificates`. Segments after
the first are read inside the entry you have reached: under
`credentials`, go down to your credential's identifier first, as you do
for `trust` and `revocation`. An array next to `claims`; under
`credentials`, one entry per credential identifier, an array of arrays
under `multiple`.

**A failed session carries `checks` too**, and that is where it helps
most: the checks that succeeded before the one that failed, in order,
then that last one with `"outcome": "failed"`. At most one check is
marked `failed`, and it is always one the published `code` admits:
`presentation_invalid` admits the seven checks of the presentation,
`credential_revoked` and `revocation_not_checked` the two revocation
checks, the other causes none. A failure that had no presentation judged
carries no `checks` at all, for instance a holder refusal
(`wallet_declined`) or a response without the requested credential
(`credential_missing`): nothing was checked, and nothing is invented.

`trust` says where the anchor that validated the result came from:
`{"source": "lotl", "country_code", "certificate_sha256", "category"}`
for a country's trust list, where `category` is always `qeaa`, `{"source": "registry", "registry", "anchor",
"certificate_sha256", "sources_commit", "category"}` for an anchor of
this deployment's registries, and never anything else: trust anchors
are held by Todis, never supplied by the request. `category` is the
category of the validated credential type in the registry: `pid`,
`qeaa`, `pub_eaa` (attestation from a public sector body) or `eaa`
(non-qualified attestation); it is absent when the registry base does
not classify its types. It is one object next to
`claims`, and one entry per credential identifier next to
`credentials`.

A session concluded through the browser's Digital Credentials API
(`dc_api`), verified or failed, also carries `dc_api_protocol`: the
protocol the wallet answered with, `openid4vp-v1-signed` or
`org-iso-mdoc`. It is absent from a session concluded through the QR
code or the deep link.

A concluded session also carries `transport`, where its presentation
came from and what that path guarantees:

```json
{
  "transport": {
    "used": "dc_api",
    "handover": "OpenID4VPDCAPIHandover",
    "origin_bound": true
  }
}
```

`used` names the path: `qr`, a request read outside the verifier's
browser, with no browser return, the cross-device flow of OpenID4VP 1.0
section 3.2; `deep_link`, the redirect request of a session with a
`redirect_uri`, whose wallet sends the browser back with its Response
Code, the same-device flow of section 3.1; `dc_api`; `profil_av`.
`handover` names the handover variant that path imposes on the
`SessionTranscript` of an mdoc presentation: `OpenID4VPHandover` (Annex
B.2.6.1), `OpenID4VPDCAPIHandover` (Annex B.2.6.2) or `dcapi` (ISO/IEC
18013-7 Annex C); it is absent from a session concluded by a wallet
refusal, which had no presentation judged. An SD-JWT VC has no
`SessionTranscript`: the same path then fixes the `nonce` and the `aud`
of its KB-JWT. `origin_bound` says whether the wallet checked the
origin of the page that called it, which only the Digital Credentials
API does.

What `used` does not say: the service does not see the wallet's device,
it observes the request the response is bound to and the presence of a
browser return. A request with a `redirect_uri` shown as a QR code
therefore reads `deep_link`. Encryption does not call for one: see
`encrypted_response` below.

No field says whether the Digital Credentials API resolved on the same
device or across two devices: that information is not available to the
Verifier. The W3C `DigitalCredential` object carries only `protocol`
and `data`, and the specification requires the user agent to expose
nothing about the hardware, software or wallets present; the Annex
B.2.6.2 handover carries the origin, the `nonce` and the encryption key
thumbprint, the Annex C one carries the `EncryptionInfo` and the
origin: neither depends on the device. The origin is that of a page,
not of a device, and proves no proximity.

For a session created with `doctype`/`mdoc_claims`, `claims` nests the
elements under their namespace, the same way `credentials` does for an
mdoc credential below:

```json
{
  "status": "verified",
  "claims": {
    "eu.europa.ec.eudi.pid.1": { "given_name": "Erika", "family_name": "Mustermann", "birth_date": "1964-08-12" }
  }
}
```

For a session created with `dcql_query`, `verified` carries
`credentials` instead of `claims` — one claims object **per credential
identifier of your query**, with an mdoc credential nesting its
elements under their namespace:

```json
{
  "status": "verified",
  "credentials": {
    "pid": { "given_name": "Erika", "family_name": "Mustermann" },
    "licence": { "org.iso.18013.5.1": { "given_name": "Erika" } }
  }
}
```

A credential your query marked optional and that the wallet did not
present is simply absent from the object.

With `"multiple": true` on a credential query, every presentation the
wallet sends under that identifier is verified, and
`credentials.<id>` as well as `trust.<id>` become arrays, one entry per
presentation kept. Without `multiple`, a second presentation under the
identifier, or an empty array, fails the session.

A presentation bound to another request (a Key Binding JWT for another
`nonce` or another audience, an mdoc whose device signature does not
verify against this request) **rejects the whole response**, even next
to a valid credential: the session fails and its error starts with
`the response is rejected`, citing OpenID4VP 1.0 §14.1.2. Other
failures of a presentation keep their own message.

**Same-device return: the Response Code.** `redirect_uri` (optional,
an absolute URI, `400` otherwise) makes the session a same-device flow.
After answering, the wallet sends the user's browser to `redirect_uri`
with an added `response_code` query parameter, a fresh secret. The
verified result is **held back** until you present that code:

```json
{ "status": "pending", "response_code_required": true }
```

is what `GET /verify/sessions/{id}` returns meanwhile. Present it from
your server:

```bash
curl -X POST https://verify.todis.eu/verify/sessions/<id>/response-code \
  -H "Authorization: Bearer $TODIS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"response_code": "<value received on redirect_uri>"}'
```

- `200`: the same body as `GET /verify/sessions/{id}`, with the
  released result; `GET /verify/sessions/{id}` then returns it without
  a code;
- `403`: the code is not this session's; nothing is released;
- `400`: the session has no same-device return (created without
  `redirect_uri`), or it belongs to a hosted journey, whose page
  presents the code itself;
- `404`: unknown or expired session, or another client's.

Present the code for **the session your own user started**, whose
`session_id` you kept on your side (in their server-side session, for
example), never for a session inferred from the return address. That
binding is the point: without it, a request relayed to a victim would
hand you the victim's identity (OpenID4VP 1.0 §14.2, HAIP 1.0 §5.1). A
wallet that does not follow the redirect never releases the result.

Without `redirect_uri`, the session is cross-device (QR code): the
response carries no redirect and the result is readable directly. Do
not pass `redirect_uri` for a session shown as a QR code: its result
would stay held back.

**Polling costs requests.** Every authenticated call is billed,
`GET /verify/sessions/{id}` included; only `GET /usage` and
`GET /usage/history` are not, nor calls refused with `401` or `429`. A session lives 15 minutes, so
polling once a second would cost up to 900 requests for a single
verification. Poll every 2 to 5 seconds from **your server** (not from
each visitor's browser), or use the hosted flow's webhook and stop
polling altogether. The hosted page follows its journey on its own,
without your token: those checks are not billed. A hosted journey
costs you its creation and the `GET /verify/sessions/{id}` you make to
read the result.

**Fields of `POST /verify/sessions`**, three mutually exclusive ways
to describe what's being requested:

| Field(s) | Target format | Notes |
|---|---|---|
| `vct` + `claims` | SD-JWT VC (default) | `claims`: simple paths, e.g. `"age_over_18"`, each requested once |
| `doctype` + `mdoc_claims` | mdoc (ISO/IEC 18013-5) | `mdoc_claims`: `[{"namespace": "...", "element_identifier": "..."}]`, each requested once ; verified against this deployment's mdoc trust registry (no `country_code` for mdoc) |
| `dcql_query` | either format, multiple credentials per request | Full DCQL grammar (OpenID4VP §6): `credential_sets`, `claim_sets`, constrained `values`, **Premium plan only** (`403` otherwise). At most 10 credentials. Claim paths follow the full Claims Path Pointer (OpenID4VP 1.0 §7): a string selects a key, `null` every element of an array, an integer the element at that index. See "DCQL rules" below. Result appears under `credentials` rather than `claims` in `GET /verify/sessions/{id}` |

**DCQL rules.** A `dcql_query` is checked at creation, and refused with
`400` when: an array that is present is empty (`credentials`,
`credential_sets`, `claims`, `claim_sets`, `options`, `values`); a
credential or claim identifier uses anything other than letters,
digits, `_` and `-`; a claim is requested twice; a `values` entry is not
a string, an integer or a boolean; an mdoc path is not exactly
`[namespace, element]`; `claim_sets` comes without `claims`. A `values`
constraint is met as soon as one of the values the path selects is in
the list. A credential query may set `"multiple": true` (see the result
shapes above).

**`trusted_authorities`, added for you.** For each credential that a
registry of this deployment will judge, Todis adds to the request a
`trusted_authorities` entry of type `aki`, carrying the key identifier
of each authority (IACA) the registry accepts for that type, so that a
wallet applying the filter only offers credentials that fall under it.
Nothing is added for a credential judged through the EU list of trusted
lists (`country_code`), nor when a candidate anchor cannot be named
that way (an anchor with the `signer` role). A `trusted_authorities`
you supply in a `dcql_query` credential query is passed to the wallet
as is; an `aki` value that is not base64url is refused (`400`). This is
a hint for the wallet: verification judges trust exactly as before.

**`transaction_data` is refused** (`400`, the error names the field),
on this route as on `POST /hosted/sessions`: Todis sends no transaction
data to the wallet and does not verify `transaction_data_hashes`.

**`intent_to_retain`, per mdoc element.** On a claim of an `mso_mdoc`
credential of `dcql_query`, `"intent_to_retain": true` declares that you
intend to retain that element beyond the transaction (OpenID4VP 1.0
§B.2.4). Todis passes it on to the wallet on every transport: as is in
the OpenID4VP request (redirect, QR code, Digital Credentials API, the
`av://` link of the age verification profile), and as `IntentToRetain`
in the ISO/IEC 18013-7 Annex C request. When absent it is false, and
Todis tells the wallet the element will not be retained: that commits
you not to store it longer than needed to conduct the transaction
(ISO/IEC 18013-5 §8.3.2.1.2.1). The simplified fields and the `check`
shortcuts always announce false. The field is never ignored: in
`mdoc_claims` or on an SD-JWT VC claim it is refused with a `400` that
names it, and a non-boolean value is refused when the body is read.

**Issuer trust resolution.** For an SD-JWT VC, `country_code` resolves
the issuer through that country's national trust list, via the
European Union's official list of trusted lists, among its qualified
attestation providers (service type EAA/Q, status `granted`), and only
for a `vct` that this deployment's SD-JWT VC registry classifies `qeaa`
in `type_categories`: never a PID. Up to version 4.5.0 a PID could be
verified with `country_code`; since 5.0.0 it always fails that way,
whatever the country, and is verified without `country_code`, against
this deployment's registries.
<!-- registry-fact: production sd-jwt-vc registry classifies no vct qeaa -->
On `verify.todis.eu` no `vct` is classified `qeaa` today, so
`country_code` verifies nothing there; classifying a qualified type is
registry data, not a service version. Any other type fails at
verification, with an error that names it and its category (`422` on
`POST /verify/sd-jwt-vc`, `presentation_invalid` in a session), before
any list is read; so does any credential when the deployment
classifies no type `qeaa`, with an error that says so. Session
creation is not refused. With no
SD-JWT VC registry base loaded, that route fails as the registry does
(`503` on `POST /verify/sd-jwt-vc`). Without
`country_code`, the credential is verified against this deployment's
SD-JWT VC trust registry, which carries the authorities and the signing
certificates of the accepted issuers: against an authority, the signing
certificate in the credential's `x5c` header is verified up to it,
signature and validity window included, through any intermediate
authorities `x5c` carries after the signing certificate (each must be a
certification authority whose path length constraint is respected, and
`x5c` holds five certificates at most; an `x5c` that carries the
authority's own certificate is refused, as HAIP 1.0 §6.1.1 forbids),
and against a signing
certificate, its key must verify the credential's signature.
An mdoc credential is verified against this
deployment's mdoc trust registry, which carries the IACAs of the
accepted issuers: the signer chain embedded in the credential is
verified up to one of them, signature and validity window included,
over a single level as ISO/IEC 18013-5 intends. An anchor only ever
applies to the credential types its source declares.

List the accepted anchors and countries before you create a session.
The call is public (no token) and cacheable (`Cache-Control: public,
max-age=300`, `ETag`, `304` on `If-None-Match`):

```bash
curl https://verify.todis.eu/trust/registries
```

It returns, per registry (`mdoc`, `sd_jwt_vc`), its state, the sources
commit and assembly date of the loaded base, its sources, and each
anchor with its role (`authority` or `signer`), its `usage`, the types
it covers, its subject, its certificate's fingerprint and validity
dates, and whether it is valid now. Each entry is one role of a
certificate as one source declares it: the same certificate appears
once per source that gives it a role, for instance a PID authority that
another source also declares for proof of age. `usage` is `issuance`
for an anchor that validates credentials, or `status` for one that
signs their status lists, which never validates a credential.
`type_categories` gives the category of each covered type (`pid`,
`qeaa`, `pub_eaa`, `eaa`). A source read from a VICAL, the signed list of
mdoc issuing authorities, carries `vical` (provider, issue number, date,
next update, file fingerprint). A source read from a list of trusted
entities (LoTE, ETSI TS 119 602) carries `list` (type, sequence number,
issue date, next update, file fingerprint); once that next update has
passed, its anchors are no longer accepted. `discarded` lists the
entries of those lists that did not become anchors, with their `reason`
and `detail`: that is where a missing expected anchor is explained.
`official_sources` lists the official sources this deployment is to
query (the European list of trusted lists, the Commission's lists), each
with its address or, when it is not published, what is missing to read
it, and with the date and result of its last read: `read` with its entry
count (a count of zero is a read, not a missing read), `not_queryable`,
`unreachable` or `unrecognized`. Those reads observe only: an anchor
enters a base through the registry sources, never through a read.
`lotl.countries` lists the countries a
`country_code` can reach. `trust_list_cache` shows the trust lists the
deployment keeps for `country_code` once verified, the LOTL (`lotl`)
and each country already resolved (`territories`), with its
`sequence_number`, the `sha256` of the file read, its last successful
read (`last_success_at`), the date until which the copy is served
(`valid_until`), its age limit (`max_age_until`, 24 h after its last
successful read), whether it is served now (`served`) and if not why
(`withheld_reason`: `max_age`, `expired`, or `lotl_withheld` for a
country whose LOTL is no longer served), and the error of its last
reread (`last_error`); the lists are reread every hour by default, so
two instances publishing different numbers or fingerprints do not
verify under the same lists. A list that could not be reread
successfully for 24 h is no longer served: `country_code` requests for
that country, or for every country when it is the LOTL, answer `502`
until a reread succeeds.
To report a missing anchor:
`report_missing_anchor`.

Session creation answers `400` when no valid anchor covers the
requested type, and `503` when the registry it depends on has no base
loaded. A verified session says where its anchor came from, in `trust`
(see the result shapes above).

**Proof of possession** (SD-JWT VC): the credential must declare its
holder's key in `cnf.jwk`, and the presentation must carry a Key
Binding JWT signed with that key and bound to the session's `nonce` and
`client_id`. A presentation without a Key Binding JWT fails the session
with `key binding JWT missing: ...`, and a credential without a usable
`cnf.jwk` fails it with `the credential declares no usable holder key
(cnf.jwk), ...`. This is the default of OpenID4VP 1.0
(`require_cryptographic_holder_binding`, §6.1), and HAIP 1.0 (§6.1.1.1)
makes the Key Binding JWT mandatory for a holder-bound credential. The
`vct` + `claims` fields always require it. In a `dcql_query`, a
credential query may set `"require_cryptographic_holder_binding":
false`: the wallet is told so in the authorization request, and a
presentation without that proof is then accepted, with one exception.
In a HAIP session, a signed request with an encrypted response
(`encrypted_response: true`), a credential that declares a holder key
(`cnf`) still needs its Key Binding JWT, as HAIP 1.0 §6.1.1.1 requires;
only a credential without `cnf` is accepted without it. In a session, an
mdoc is always authenticated by its device signature, whatever this
field says.
`POST /verify/sd-jwt-vc` has no session to bind a proof to and does not
require one; a Key Binding JWT it receives is still verified. Without
a session, Todis is the recipient of no credential: a credential that
carries `aud`, whatever its value, is refused with a 422. On every
route, an issuer-signed JWT whose `typ` is neither `dc+sd-jwt` nor
`vc+sd-jwt` is refused.

**Per-credential trust** (`dcql_query` sessions only):
`credential_trust` gives an SD-JWT VC credential of the query its own
`country_code`, e.g. `{"diploma": {"country_code": "FR"}, "por":
{"country_code": "DE"}}`, for a type classified `qeaa` only (see
"Issuer trust resolution"), and still no `country_code` for an mdoc
credential. A credential without an entry uses the session's
`country_code`, otherwise its format's registry. Each entry only ever
applies to its own credential (one credential's entry never validates
another). SD-JWT VC and mdoc credentials can be mixed in a single
query.

**Trust anchors are held by Todis.** No request supplies a key or a
certificate. A request that still carries `issuer_public_key_pem`, or a
`credential_trust` entry that carries one, is refused at creation with a
`400` whose error names the field, whatever its value (`null` included)
and whatever transport the session asks for:

```json
{"error": "`issuer_public_key_pem` is no longer accepted: trust anchors are held by the service, in its trust registries (GET /trust/registries). Report a missing anchor to integration@todis.eu"}
```

The same rule holds on `POST /hosted/sessions` and on the two direct
verification routes below. An issuer missing from the registries is
reported to integration@todis.eu, not worked around in the request.

**Advanced options**: `encrypted_response` (boolean, false by default)
requires an encrypted wallet response
(`response_mode=direct_post.jwt`). The default is `false` here, unlike
the hosted flow, so this is the endpoint where you have to act. **Some
national wallets accept nothing else** and, without encryption, return
no error at all: they read the request then give up, and the session
stays `pending` forever. If you target a production wallet, turn it on.

`profil_av` (boolean, false by default) also asks for the OpenID4VP
transport of the EU age verification profile: the response then carries
`profil_av`, with `wallet_uri`, an `av://` link that opens the age
verification app and hands it the request by value, and
`authorization_request`, that request, unsigned, under `redirect_uri:`,
in plain `direct_post`, for the EU Proof of Age attestation
(`eu.europa.ec.av.1`) alone. This is the only form those apps accept; in
exchange, the app cannot authenticate Todis. The redirect request is
unchanged. The session must request that attestation as an mdoc (`400`
otherwise), and request only `age_over_NN` elements of its namespace:
any other path is refused at creation, by a `400` that names it. The
wallet posts its response to `POST /verify/sessions/{id}/av/response`,
the `response_uri` of that request. That endpoint carries that
attestation and nothing else: a response that carries another credential
is rejected, while the redirect request and the DC API keep accepting
the other age sources of the session.

`encrypted_response: true` does not require `redirect_uri`: without
it, an encrypted session is cross-device like any other.

**`redirect_uri` must be reachable from the device running the
wallet**, not from your server: the wallet opens it on the phone after
posting its response, and a loopback address (`http://localhost:...`)
points at the phone itself there. This API only checks that it is an
absolute URI. An unreachable address shows up as an error on the
phone, not from this API, and the result then stays held back, since
the Response Code never reaches you.

**What this API does not have**, so you do not go looking:

- no webhook on `POST /verify/sessions` — `webhook_url` exists only on
  the hosted flow (`POST /hosted/sessions`); with the raw flow, poll;
- no way to cancel a session — an abandoned one simply expires after
  15 minutes;
- no `expires_at` on `POST /verify/sessions` (the hosted flow returns
  one): compute it as creation time plus 15 minutes;
- no `country_code` resolution for mdoc credentials: they are verified
  against this deployment's mdoc trust registry, and a `country_code`
  in the `credential_trust` entry of an mdoc credential is refused at
  creation with a `400`.

If the response carries a `request_uri` field, a strict (HAIP-profile)
wallet will fetch it by `GET` (or `POST` if you add
`request_uri_method=post` to the deep link) rather than reading
`authorization_request` directly — still provided in every case for
inspection/debugging.

## Revocation: what Todis checks, and what you decide

A credential can be revoked or suspended after it was issued. Todis
checks that on every verification, on both session routes, and tells you
what it found. One field decides what happens when the check cannot be
carried out.

**`revocation` at creation**, on `POST /verify/sessions` and on
`POST /hosted/sessions`, a string, `"report"` by default:

- `"report"`: the session is verified, and the result says the status
  could not be established, with the reason. This is the default because
  an unreachable status list is not the user's fault;
- `"require"`: a status that was announced but could not be checked
  fails the session. Ask for it when a stale answer would cost you more
  than a failed journey.

A minimal creation in `require`:

```bash
curl -X POST https://verify.todis.eu/verify/sessions \
  -H "Authorization: Bearer $TODIS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "vct": "https://example.eu/credentials/pid",
    "claims": ["age_over_18"],
    "revocation": "require"
  }'
```

**What neither value changes.** A credential the issuer reports revoked
or suspended fails the session under both, and so does a status index
outside its list. A credential that announces no status at all passes
under both: there is nothing to check, and nothing missing. That is the
common case today, and it is why `require` is safe to ask for.

**`revocation` in the result**, next to `trust`, in
`GET /verify/sessions/{id}` and in the `session.verified` webhook. It
carries the policy that applied and what was established, in the same
shape as `trust`: one object next to `claims`, one entry per credential
identifier next to `credentials`.

```json
{
  "status": "verified",
  "claims": { "age_over_18": true },
  "revocation": {
    "policy": "require",
    "status": "valid",
    "mechanism": "status_list",
    "list_issued_at": 1758326400,
    "certificates": { "status": "not_provided" }
  }
}
```

`status` takes one of three values:

- `"not_provided"`: the credential announces no status. Nothing was
  checked because there was nothing to check;
- `"valid"`: the status was checked and the credential is not revoked.
  `mechanism` names what was read, `status_list`, `identifier_list`, or
  `status_list and identifier_list` when an mdoc announced both; and
  `list_issued_at` is when the list was issued, in Unix seconds, which
  is how fresh the answer is;
- `"not_checked"`: a status was announced and could not be established.
  `reason` says why, in English: the list could not be fetched, it
  expired, its signer is admitted by none of the anchors this credential
  allows. You only ever see this under `report`; under `require` the
  session failed instead, with the same reason in `error`.

`certificates` is the same question asked of the issuer's certificate
chain (its CRLs): `{"status": "not_provided"}` when no certificate names
a CRL, `{"status": "checked", "crl_this_update": <unix seconds>}`
otherwise. A revoked certificate fails the session under both policies.

**`signer_exception`, and why you can ignore it.** A `valid` result may
carry `"signer_exception": "self_signed_status_role"`. It says the
status list was signed by a self-signed certificate that Todis admits
because one of its own registry sources declares that certificate for
status use. This is a transitional measure, for the period where issuers
have no dedicated list signer: the check was carried out in full, and
the answer is as good as any other. The field is absent everywhere else,
and it will disappear when the measure is withdrawn. Nothing to handle;
it is there so that the exception can be measured rather than assumed.

## What to ask for: the European PID, and proof of age

The examples above use a placeholder `vct`. Here are the real
identifiers, taken from the ARF PID Rulebook and cross-checked against
the published metadata of the Commission's reference issuer
(`issuer.eudiw.dev`). National profiles may extend the base type, so
keep these configurable rather than hard-coded.

The type a credential carries is compared with the one you request as
an exact, case-sensitive string, and type inheritance is not resolved:
to accept a national PID, list its `vct` in `vct_values` next to
`urn:eudi:pid:1`. A credential of a type you did not request, or an
SD-JWT VC without a `vct`, fails the session, and the error names the
type received and the types requested. For SD-JWT VC, the `check`
shortcuts request `urn:eudi:pid:1`, `urn:eudi:pid:de:1` and
`urn:eudi:pid:fr:1`.

| | SD-JWT VC | mdoc (ISO/IEC 18013-5) |
|---|---|---|
| Identifier | `vct` = `urn:eudi:pid:1` | `doctype` = `eu.europa.ec.eudi.pid.1` (also the namespace) |
| Family name | `family_name` | `family_name` |
| Given name | `given_name` | `given_name` |
| Date of birth | `birthdate` | `birth_date` |
| Nationality | `nationalities` (list) | `nationality` |
| Age over 18 | `age_equal_or_over` → `18` | `age_over_18` |

**The two encodings do not spell attributes the same way.** That is the
single most common mistake: asking an SD-JWT VC PID for `birth_date`
(the mdoc spelling) returns nothing, because the claim simply does not
exist under that name. We made that exact mistake ourselves.

**Age needs care.** The date of birth is *mandatory* in every
conformant PID. The age attributes are no longer in the PID Rulebook:
version 1.1 of 4 September 2025 removed them, following Implementing
Regulation (EU) 2024/2977, and the version in force, 1.7 of 17 July
2026, defines none, neither mandatory nor optional. The age row in the
table above uses the names of the earlier versions, which listed them
as optional. Some PID providers still include them, others do not: the
Commission's reference issuer does not. There are three ways to
establish majority, from least to most intrusive:

1. the EU **Proof of Age attestation**, `doctype` and namespace
   `eu.europa.ec.av.1` (mdoc), which by specification carries no other
   attribute — no name, no document number, no date of birth;
2. the PID's age attribute, when its issuer still includes it: the
   boolean alone, the date stays hidden;
3. the PID's date of birth, always available: you receive the full date
   and compute the answer yourself.

A verifier can never derive majority without receiving one of these.
`check: "age_over_18"` requires one of the three, each offered only when
this deployment can verify it, and hands you a plain
`{"age_over_18": true}` whichever route the wallet took.

**A query accepting the PID in either format** (Premium plan, since it
uses `dcql_query`): the SD-JWT VC PID resolves through this
deployment's SD-JWT VC trust registry, the mdoc PID through its mdoc
trust registry:

```json
{
  "dcql_query": {
    "credentials": [
      {
        "id": "pid_sdjwt",
        "format": "dc+sd-jwt",
        "meta": { "vct_values": ["urn:eudi:pid:1"] },
        "claims": [{ "path": ["given_name"] }, { "path": ["birthdate"] }]
      },
      {
        "id": "pid_mdoc",
        "format": "mso_mdoc",
        "meta": { "doctype_value": "eu.europa.ec.eudi.pid.1" },
        "claims": [
          { "path": ["eu.europa.ec.eudi.pid.1", "given_name"] },
          { "path": ["eu.europa.ec.eudi.pid.1", "birth_date"] }
        ]
      }
    ],
    "credential_sets": [{ "options": [["pid_sdjwt"], ["pid_mdoc"]] }]
  }
}
```

Note the shapes: an mdoc claim path is `[namespace, element]` (two
names, not an array index), an mdoc credential names its type in
`meta.doctype_value` while an SD-JWT VC one names it in `meta.vct_values`
(required: a credential query without its type is refused with `400`),
and `options` lists alternatives: with `required` omitted or `true`, its
default, the wallet must satisfy one of them and chooses which
(OpenID4VP 1.0 §6.4.2). Their order expresses **no preference** the
wallet has to follow; the specification attaches one only to a
credential's `claim_sets` (§6.4.1). `credential_sets`
also accepts an optional `purpose`, passed to the wallet untouched so it
can explain to the user why the data is requested.

## National wallets, verified end to end

What a given national wallet actually issues decides three things at
once: the request mode, the trust resolution, and the result shape.
The table above cannot tell you that, so here is what we have verified
against real wallets.

| Wallet | PID format | Ask with | Trust anchor | Also required |
|---|---|---|---|---|
| France Identité (the citizen app, production) | mdoc only | `doctype` + `mdoc_claims`, doctype and namespace both `eu.europa.ec.eudi.pid.1` (or a `dcql_query`) | this deployment's mdoc trust registry: `GET /trust/registries` must list a valid anchor covering `eu.europa.ec.eudi.pid.1` (the ANTS publishes the production PID IACA on the wallet's page of the France Identité playground, https://playground.france-identite.gouv.fr/marketplace/wallets/fin/ ; the pre-production chain is for the "Partenaires" build only) | `encrypted_response: true` |

Verified on 2026-08-29 with a production France Identité wallet,
using this service's `client_id` exactly as it is issued
(`x509_hash:...`, HAIP profile). France Identité accepts that scheme
even though its own integration profile documents `x509_san_dns`:
nothing on your side can or needs to change it.

Since mdoc has no automatic `country_code` resolution, an SD-JWT VC
style session (`vct` + `claims` + `country_code`) aimed at France
Identité is accepted with a `201` and then stays `pending` forever:
the wallet simply holds no credential matching the request. That
silent outcome is the reason this table exists.

## Direct verification (no session)

If you already have a presentation in hand (obtained some other way):

**SD-JWT VC:**
```bash
curl -X POST https://verify.todis.eu/verify/sd-jwt-vc \
  -H "Authorization: Bearer $TODIS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "presentation": "<jwt>~<disclosure>~...~"
  }'
```
→ `{"verified": true, "claims": {"age_over_18": true}, "trust": {"source": "registry", "registry": "sd_jwt_vc", "anchor": "...", "certificate_sha256": "...", "sources_commit": "...", "category": "eaa"}}`

The issuer is looked up in this deployment's SD-JWT VC registry, whose
anchor must cover the credential's `vct`; a credential without `vct` is
refused. No registry base loaded: `503`. With `country_code`, the
issuer is resolved through that country's trust list instead, for a
`vct` classified `qeaa` only (see "Issuer trust resolution" above), and
`trust` is `{"source": "lotl", "country_code", "certificate_sha256",
"category": "qeaa"}`.

**mdoc:**
```bash
curl -X POST https://verify.todis.eu/verify/mdoc \
  -H "Authorization: Bearer $TODIS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "device_response": "<DeviceResponse CBOR, base64url-encoded>"
  }'
```
→ `{"verified": true, "doc_type": "org.iso.18013.5.1.mDL", "namespaces": {"org.iso.18013.5.1": {"age_over_18": true}}, "trust": {"source": "registry", "registry": "mdoc", "anchor": "...", "certificate_sha256": "...", "sources_commit": "..."}}`

The mdoc is verified against this deployment's mdoc registry, whose
anchor must cover the signed doctype. `issuer_trust_anchor_pem` is no
longer a field of this route: a request that carries it is refused with
a `400` that names it. No registry base loaded: `503`.

Failed verification (invalid signature, expired JWT, an issuer no
anchor accepts...): status `422`, `{"verified": false, "error": "..."}`.

**A refused issuer is named.** When no trust anchor validates it,
`error` carries the presented certificate's subject, SHA-256
fingerprint, issuing authority and that authority's key identifier, so
you can have it declared without a round trip with your issuer. And when
that certificate chains to an anchor the registry already holds but
which is not declared for the presented credential type, `error` says so
and names that anchor and the types it is declared for: what is missing
is then a type on an anchor we already have, not a certificate. This is
certificate information, which is public by construction; no claim of
the holder ever appears in an error message.

## Error codes, to handle everywhere

| Status | Meaning |
|---|---|
| `400` | Malformed request (invalid JSON, inconsistent fields, a `redirect_uri` that is not an absolute URI, a malformed `dcql_query`, `transaction_data`, `intent_to_retain` outside an mdoc claim of `dcql_query`), or a trust anchor supplied in the request (the error names the field) |
| `401` | Missing, invalid, revoked or expired token |
| `403` | Feature not included in your plan (`dcql_query` = Premium, detailed `/usage/history` = Standard+), or a Response Code that is not the session's (`POST /verify/sessions/{id}/response-code`) |
| `404` | Unknown or expired session (15 minutes), or a session created under another client's license |
| `422` | A required field missing or of the wrong type (plain-text message), malformed presentation, or signature/trust not verified (`verified: false`), including, with `country_code`, a `vct` not classified `qeaa`, or any presentation when the deployment classifies none, without any list being read |
| `429` | Plan quota exceeded (the message gives the exact limit, e.g. `1800 requests/minute`) |
| `502` | European trust registry resolution failed (`country_code`, for a type classified `qeaa`): network, or the European or national list is closed, past its next update, or older than a list already accepted, or the kept copy is past its next update, its signer's validity, or 24 h after its last successful reread, with no newer copy verified since; the error names the list |
| `501` | Feature unavailable on this deployment (hosted flow without a signing identity, history without a database — does not concern `verify.todis.eu`) |

## Usage tracking

`GET /usage` — total authenticated requests for the account (across
all client IDs tied to your email). **Not instantaneous**: usage is
aggregated and flushed in one-minute cycles, so a request made just now
may not be counted yet. Wait a minute before concluding the figure is
wrong. `plan` is the plan of the license token you presented.
```json
{ "plan": "standard", "client_ids": ["cus_ABC123"], "total_authenticated_requests": 42 }
```

`GET /usage/history?days=30&format=csv` — daily history (Standard+;
per-endpoint breakdown and latencies, up to 400 days, CSV export:
Premium only).

## Further reading

- Full OpenAPI spec, always up to date: https://todis.eu/openapi.json
- The flow explained in prose, with a diagram: https://todis.eu/en/workflow.html
- Pricing and free trial: https://todis.eu/en/pricing.html
- Detailed use cases: https://todis.eu/en/use-cases.html
