Skip to main content

Overview

A credential template defines the schema for a verifiable credential: what attributes it carries, their types, and which are always disclosed. Create it once and reuse it to issue many credentials with different data. Presets create templates. The first time you issue against a preset, the platform creates a credential template in your tenant from it and reuses that one for every issuance after. That template belongs to the platform. A presetId: or credentialType: reference resolves to it, and it cannot be deleted. The templates on this page are yours. You create them and issue from them with reference: "templateId:ID". Reasons to create one:
  • The same credential, shown differently. Create a template from a preset and give it its own name, description and branding. Only the display changes. The credential type and attributes stay the preset’s, and presentation requests match on the credential type, so a credential issued from your template is still offered to the holder as one they can present.
  • A credential shape no preset covers. Create a custom template and define the attributes yourself.

Create a template from a preset

Each template is its own credential configuration in your issuer metadata, so several templates built from one preset give the holder distinct cards that share one credential type. A staff login and a contractor login can carry the same type and verify identically, while the wallet shows two different titles and two different colours. Pass the preset id, plus whatever you want to differ from it. The preset already fixes the format, so the generic endpoint is the simplest choice:
Every call creates a new template and answers 201 Created. Create as many as you need from one preset. The credential type and attributes always come from the preset, and those four fields are all you may send. The API reference also lists credentialFormat, which you can set to preset, but the platform infers it from presetId. Adding a template field such as attributes, code, type, validUntil or issuerConfig returns a 400, Only name, description and branding may accompany presetId.
branding replaces the preset’s block rather than merging into it. Send a branding carrying only a backgroundColor and the template has only a background colour. The preset’s textColor and backgroundImageUrl are not inherited. Repeat the values you want to keep.

Issue from the template

Issue with the template id, not the preset id:
A presetId: or credentialType: reference resolves to the platform’s own template for the preset, which keeps the preset’s name and branding. It never resolves to one of yours. See Issue a credential. Templates you create from a preset can be deleted like any other template you own. The platform’s template for the preset cannot.

Create a custom template

The rest of this page covers this path, where you define the credential shape yourself instead of taking it from a preset. Use a custom template only when you need to issue a credential whose type a preset already claims. Preset creation rejects a duplicate credential type with a 409; template creation does not check, so this is the one path open to you. For everything else, create your own preset instead. A credential no published preset covers is a preset you author; one that shouldn’t be visible to other tenants is a private preset. See Create an SD-JWT credential preset and Public and private presets.
Two credentials sharing a credential type is the thing preset uniqueness exists to prevent. Verifiers match on that type and expect one schema behind it. If you take this path, make sure your attributes match what verifiers of that type already expect.
The type field you set in a credential template is what verifiers later match against in the credential presentation flow.

Pick the right endpoint for your format

The API exposes a separate POST endpoint per credential format. Use the one that matches the credential you want to define:
  • SD-JWT: POST /v1/templates/credentials/sd-jwt
  • mDoc: POST /v1/templates/credentials/mdoc
A generic POST /v1/templates/credentials exists too (it dispatches by credentialFormat in the body), but the format-specific endpoints have a single, format-shaped request body and are simpler to work with.

Request (SD-JWT)

The example uses code rather than type, so it runs as-is against your own tenant.

type: naming the credential type

type carries the template’s credential type verbatim. It is what verifiers match against at presentation time, and it goes onto every credential issued from the template. The accepted shape depends on the format:
  • SD-JWT: the VCT, as a urn: URI such as urn:eu.europa.ec.eudi:pid:1, or a platform VCT URL in your own namespace ($BASE_URL/vct/YOUR_ALIAS/...). Every other http(s) URL is rejected, including a platform URL belonging to another tenant or environment.
  • mDoc: the DocType, a dot-separated reverse-DNS string such as org.iso.18013.5.1.mDL.
SD-JWT templates additionally accept code instead of type, as a shortcut that projects to the platform VCT URL above (code: "basic-identity" becomes $BASE_URL/vct/YOUR_ALIAS/basic-identity). Sending both returns a 400, and mDoc templates do not accept code at all. Platform VCT URLs are rooted at the environment’s host, so a projected VCT differs between environments. Supply an external urn: when you need one type to hold everywhere.

Attribute fields

Each attribute is a field on the credential. The following properties configure each one: type is the only required property. An object attribute also takes properties, and an array attribute takes items.

Optional request fields

A validUntil duration must be positive and cannot exceed 365 days in total.

Request (mDoc)

The mDoc body is not the SD-JWT body with a different type. Four things differ:

Response

HTTP 201 Created for a template created from a preset, and for every template created through POST /v1/templates/credentials/sd-jwt. Creating from explicit fields through POST /v1/templates/credentials/mdoc or the generic POST /v1/templates/credentials answers 200 OK.

Key response fields

Save the id from the response. You’ll need it as the reference in Issue a credential, in the form templateId:ID.