Credential Schemas (V2)
This page covers credential schemas using the /api/credential-schema/v2
endpoints. The v2 schema API is available now but support for using v2
schemas in issuance and verification flows is still in development.
V1 schemas remain the current standard until that work is complete, at which point v1 will be disabled. See Credential Schemas (V1) for the current implementation.
A credential schema defines the structure of a credential type: the claims it contains, the formats it will be issued in, and how it should appear in a wallet. You create a schema once and reuse it every time you issue a credential of that type. If you are issuing membership cards, you create a membership card schema; every membership card you subsequently issue is an instance of that schema.
Example
The following schema issues a credential in two formats simultaneously: SD-JWT VC and ISO mdoc. It contains three claims: a flat string claim with format-specific technical keys, a nested address object, and a flat boolean claim with no mapping.
POST /api/credential-schema/v2
{
"name": "Membership Card",
"organisationId": "{{YOUR-ORG-UUID}}",
"formats": [
{
"format": "MDOC",
"ecosystemSchemaId": "org.example.membership"
},
{
"format": "SD_JWT_VC"
}
],
"claims": [
{
"key": "Last Name",
"datatype": "STRING",
"required": true,
"mappings": [
{
"format": "MDOC",
"namespace": "org.example.membership",
"technicalKey": "family_name"
},
{
"format": "SD_JWT_VC",
"technicalKey": "surname"
}
]
},
{
"key": "Address",
"datatype": "OBJECT",
"required": true,
"mappings": [
{
"format": "MDOC",
"namespace": "org.example.membership",
"technicalKey": "address"
},
{
"format": "SD_JWT_VC",
"technicalKey": "address"
}
],
"claims": [
{
"key": "Street",
"datatype": "STRING",
"required": true,
"mappings": [
{
"format": "MDOC",
"technicalKey": "street_address"
},
{
"format": "SD_JWT_VC",
"technicalKey": "street_address"
}
]
},
{
"key": "Postal code",
"datatype": "STRING",
"required": true,
"mappings": [
{
"format": "MDOC",
"technicalKey": "postal_code"
},
{
"format": "SD_JWT_VC",
"technicalKey": "post_code"
}
]
}
]
},
{
"key": "member_status",
"datatype": "BOOLEAN",
"required": true
}
],
"allowRevocation": true,
"allowSuspension": true,
"batchSize": 10
}
Formats
The formats array declares which credential formats this schema can be
issued in. If you build a schema with multiple formats, you can later
choose a subset of formats in which to issue any given credential when
you create the credential.
Each entry references the name of a configured format instance
— not a format type or media type identifier. In the example above,
formats references two instances named MDOC and SD_JWT_VC; your
deployment configuration defines what each of those names actually means.
Referencing instances, not types
When referencing credential formats, use the instance name, not type:
{
"format": {
// Reference this
"SD_JWT_VC": {
"type": "SD_JWT_VC",
"params": { ... }
},
// Reference this
"MDOC_1": {
// Not this
"type": "MDOC",
"params": { ... }
}
}
}
This separation of instance naming and type allows for having multiple
configurations of the same type. The value you provide in formats
therefore must reference (and match exactly) the name of one of your
configured format instances.
The system applies the corresponding configuration, including any
format-specific identifiers like dc+sd-jwt, automatically. You do not set
those values in the schema.
When you create a schema in multiple credential formats, consider whether you wish to map individual claims to a namespace (for mdoc) or to a technical key (any format), per credential format. See Claim mappings for more. For system behavior when issuing with multiple formats, see Multi-format issuance.
Schema ID
Optionally, provide an ecosystemSchemaId alongside the format name. Its
effect depends on the format:
- For mdoc, it sets the DocType.
- For SD-JWT VC, it sets the
vctclaim. - For all other formats, you cannot pass an
ecosystemSchemaId.
If omitted, the system generates one. For guidance on reading your configuration and identifying available format instances and their capabilities, see Reading the Configuration.
Claims
Claims define the attributes a credential contains. Each claim needs a
key, a datatype for validation, and a required flag. If required
is false, the issuer can leave that claim empty at issuance time.
Claim datatypes
For available claim datatypes, see the datatype object of your
configuration. For configuring, see
Data Type Validationyarn.
If a claim's datatype is OBJECT, it nests other claims inside it via
its own claims array.
Claim mappings
By default, a claim's key is used directly as its technical
representation in every format. Add a mappings array to a claim when
you need one of the following:
-
A separate technical key per format: the
keyserves as a single, user-friendly display value for the claim across all formats, whiletechnicalKeyis the value actually written into the credential. This lets one schema definition support different technical naming per format. For example, a claim with the keySurnamemight map tolast_namein one format andsurnamein another. -
A namespace for mdoc root-level claims: the mdoc standard expects every root-level claim to belong to a namespace. If you don't provide a
namespacein a claim's mdoc mapping, the system falls back to using the credential schema ID as the namespace. For nested claims inside anOBJECT, the namespace is inherited from the parent and doesn't need to be repeated.
A mappings entry is never required on its own — you can omit mappings
from a claim entirely. If you do include one, format and technicalKey
are both required within that entry.
Revocation and suspension
Set allowRevocation: true to enable credential revocation. Suspension
requires revocation to be enabled; set both allowRevocation and
allowSuspension to true to allow issued credentials to be suspended.
See Suspending and Revoking for details.
For multi-format schemas, revocation and suspension logic may differ between credentials issued, according to the formats used. See Suspending and Revoking — Multi-format credentials.
Translations
Schema names and individual claim names can be translated for display in wallets that support localization. See Translating Credential Schemas.
Other schema options
Credential expiration
The expiration parameter sets the administrative lifetime of credentials
issued using this schema. After a credential has expired, it is no longer
valid and cannot be refreshed. For an explanation of expiration behavior,
see Credential Expiration for Issuers.
Batch issuance
Set batchSize to 2 or higher to issue credentials from this schema as
batches. The value sets the maximum number of credentials the wallet can
request in one batch, each with its own holder-binding key. Leave it out
to issue single credentials. The value cannot exceed
globalSettings.credentialSchema.maxBatchSize in your configuration.
You cannot add batch issuance to an existing schema, so decide when you create it. See Single, Batch, and Multi-Format Issuance.
Transaction codes
transactionCode requires the holder to enter a code to accept the
credential. See Transaction Codes for
configuration options and use cases.
Wallet Unit Attestations (WUAs)
You can:
- Require the wallet to present valid Wallet Instance Attestations (WIA) and/or Key Attestations (KA) during issuance.
- Set credentials to automatically be revoked if their WIA or KA are revoked (EUDI-ecosystem only).
See Wallet Unit Attestations for Issuers.
Embedded disclosure policy
An embedded disclosure policy lets issuers specify which relying parties a holder is permitted to disclose a credential to. The policy is attached to a credential schema and transmitted to the wallet as part of credential metadata. The wallet reads it at presentation time and warns the user if an incoming verifier request falls outside the policy.
This feature is defined in ETSI TS 119 472-3. See Embedded Disclosure Policy.
Ecosystems
Providers of managed wallet and verifier units can specify an ecosystem
for credential schemas. This is used for
syncing schemas
to managed units, and has no function for issuers not managing units.
Editing credential schemas
You can edit a schema after you create it, as long as the change does not affect credentials you have already issued. Create new schemas with the v2 endpoint. Edit them with the v1 endpoint:
PATCH /api/credential-schema/v1/{id}
Every successful edit moves all of the schema's credentials in PENDING
state to INTERACTION_EXPIRED, even if you only change a translation.
Holders can no longer accept those offers. Check for pending offers
before you edit.
| Field | What you can change |
|---|---|
translations | Add new translations or replace existing ones |
claims | Add or replace claim translations. See Updating claims. |
layoutProperties | Change the design, or remove it |
formats | Add a format. See Adding formats. |
batchSize | Change the value, for schemas created with batchSize ≥ 2. The new value must be at least 2 and cannot exceed globalSettings.credentialSchema.maxBatchSize. |
transactionCode | Enable, change, or disable it |
embeddedDisclosurePolicy | Enable, change, or disable it |
expiration | Change the administrative lifetime. The new value applies only to credentials you issue after the edit. |
You cannot change anything else, including the schema name, claims,
datatypes, required flags, and revocation or suspension settings.
How changes are applied
- Include only the fields you are changing. Fields you leave out stay unchanged.
- To remove the design, transaction code, or embedded disclosure policy,
set
layoutProperties,transactionCode, orembeddedDisclosurePolicytonull. The same applies to the nestedbackground,logo, andcodeobjects inlayoutProperties. layoutPropertiesandtransactionCodeare merged with the existing values, including nested objects: the properties you send are updated, and the rest stay unchanged. To clear a single property, such asbackground.imageortransactionCode.description, set it tonull.code.attribute,code.type,transactionCode.type, andtransactionCode.lengthcannot be cleared on their own.- When you add a
codeor atransactionCodeto a schema that does not have one, include all of its required properties:attributeandtypeforcode, andtypeandlengthfortransactionCode. embeddedDisclosurePolicyreplaces the existing policy as a whole.- Translations are merged with the existing ones: the translations you send are added or replace existing values for the same language, and translations you leave out stay unchanged.
The following request increases the batch size and disables the transaction code:
{
"batchSize": 20,
"transactionCode": null
}
Updating claims
To update a claim's translations, include the claim in the claims
array with its id. Include only the claims you are changing. You
cannot add or remove claims, and the request fails if an id does not
match a claim in the schema.
Adding formats
When you add a format, you cannot set claim mappings for it:
- The new format uses each claim's
keyas its technical key. - For mdoc, all claims share one namespace. This is the DocType you set
in
ecosystemSchemaId, or the generated schema ID if you leave it out.
The ecosystemSchemaId must not already be in use by another schema in
your organization, or the request fails.
Existing proof schemas do not accept the new format until you add it to them. See Editing proof schemas.
To use custom technical keys, or to place mdoc claims in different namespaces, include the format when you create the schema.