Server-Side VP Queries
This page explains how the Verifier expresses what it wants a holder to present. Every authorization request carries its credential query inline: you build a DCQL query or a Presentation Exchange v2 definition in your application code and send it in the request body when you create the authorization request. Queries live in your codebase, so there are no server-side query records to create, fetch, or delete.
Overview
A verifier asks for credentials by creating an authorization request (an OpenID4VP request). The query that describes the acceptable credentials and fields lives inside that request body.
You supply the query in one of two ways:
dcqlQuery— a Digital Credentials Query Language (DCQL) query, orpresentationDefinition— a DIF Presentation Exchange v2 definition.
Supply exactly one of the two. If neither is supplied, the request fails with
400 Bad Requestand the messageEither dcqlQuery or presentationDefinition must be provided.Sending both passes the service's own input validation but fails downstream for everyversionvalue, surfacing as a500(see Query Language).Because queries are inline, you standardize them in your own application code and pass the built object on each request, rather than registering reusable query records on the server.
Authorization Request Endpoints
These endpoints live under the /verifiers/{verifierId}/authorization-requests path. The verifierId is the identifier of a registered verifier; it may be a DID. Every endpoint requires a valid OIDC JWT Bearer token (Authorization: Bearer <token>; see Authentication).
Create an Authorization Request
POST /verifiers/{verifierId}/authorization-requests
Creates an OpenID4VP authorization request and a verification session.
Request Body
dcqlQuery(object, optional) A DCQL query describing the requested credential configurations. Required ifpresentationDefinitionis not provided.presentationDefinition(object, optional) A DIF Presentation Exchange v2 definition. Required ifdcqlQueryis not provided. Can only be used withversionv1.draft21orv1.draft24.responseMode(string, optional) How the holder returns the presentation. One ofdirect_post,direct_post.jwt,dc_api,dc_api.jwt. Defaults todirect_post.jwt.version(string, optional) The OpenID4VP draft to use. One ofv1,v1.draft21,v1.draft24. Defaults tov1, which supports onlydcqlQuery— usev1.draft21orv1.draft24withpresentationDefinition. Note thatdcqlQuerycannot be combined withv1.draft21.signingDid(string, optional) The DID that signs the authorization request. If omitted, theverifierIdpath parameter must itself be a DID; otherwise the request fails with400 Bad Request.authorizationResponseRedirectUri(string, optional) Redirect URI to include in the authorization response.expectedOrigins(array of strings, optional) Expected origins for Digital Credentials API flows (used with thedc_apiresponse modes).transactionData(array of objects, optional) Transaction data entries to bind into the request.verifierInfo(array of objects, optional) Verifier attestations to include in the request.
Response Body
A success response returns the request details:
authorizationRequestUri— anopenid4vp://...URI the wallet opens to fulfill the request.verificationSessionId— the session identifier used to track and observe the verification.authorizationRequestId— present for hosted requests.expiresAt— ISO timestamp when the request expires.
Example request body (DCQL)
Example request body (Presentation Exchange v2)
The version field is required here: presentationDefinition works only with v1.draft21 or v1.draft24.
Example response
Create an Authorization Request as a QR Code
POST /verifiers/{verifierId}/authorization-requests/qr-code
Takes the same request body as above, but returns a PNG image of a QR code encoding the authorizationRequestUri. This is convenient for cross-device flows where a holder scans the code with a wallet.
The request URI and session identifiers are returned in response headers:
X-Authorization-Request-Uri— theopenid4vp://...URI.X-Verification-Session-Id— the verification session identifier.X-Authorization-Request-Id— present for hosted requests.
Observing the Result
After a request is created, track its progress through the verification session endpoints:
GET /verification-sessions/{sessionId}— read the current session state (for exampleRequestCreated, and later states as the holder responds).GET /verification-sessions/{sessionId}/events— a Server-Sent Events (SSE) stream that emits asessionevent whenever the session updates, plus apingheartbeat every 15 seconds.
Both endpoints require a valid Bearer token.
DCQL vs Presentation Exchange
Both query languages let you target specific credential types and constrain individual claims; pick whichever fits your stack.
DCQL is the newer, compact query model. It describes requested credentials by format and metadata (such as the SD-JWT
vct) and lists the claim paths you need.Presentation Exchange v2 uses input descriptors with JSONPath
pathexpressions and JSON Schema (Draft 7)filterrules to validate the value at each path. See the Query Language page for more on paths and filters.
The Verifier accepts either form and uses it to match credentials the holder presents. In a DCQL query, request an SD-JWT VC with the dc+sd-jwt format value (the DIF Claim Format Registry identifier the Verifier uses for SD-JWT credentials).
Notes
Authentication is an OIDC JWT Bearer token; these endpoints require a valid token but no specific role (see Authentication).
Queries are not persisted as reusable, ID-addressable configurations. Keep your query objects in your own codebase and pass them inline on each request so you can standardize them across flows.
Last updated