Skip to main content

Credential templates

A credential template defines the fields and the format of a credential. Every credential you issue from a template has the same structure, so you define the fields once and reuse the template as often as you need.

For example, a Digital Visa template may include:

  • Visa holder's name
  • Passport number
  • Visa type (for example tourist, work or study)
  • Issuing country
  • Date of issue
  • Expiry date
  • Issuing authority
  • Visa conditions (for example length of stay or number of entries)

You can then issue many visas from this template, each with different values.

The credential formats you can choose depend on your ecosystem:

For a side-by-side view of formats per ecosystem, see Compatibility.

Before you start​

Make sure you have:

  1. An API key for your ecosystem.
  2. An organization in that ecosystem.

Steps​

This example creates a JSON-LD credential template in the EU Digital Identity ecosystem. The steps are the same for other formats and ecosystems.

  1. Open the API Reference and select the EU Digital Identity Ecosystem API under Hovi Connect API.
  2. Go to the Credential Templates section.
  3. Open POST - Create Template (JSON-LD) and click Test Request.
  4. Enter your API key as a Bearer Token, fill in the body parameters and click Send.

The response includes the new template's credentialTemplateId, which you use when you issue credentials.

note

To be able to revoke credentials later, create an EU Digital Identity SD-JWT template with supportRevocation set to true. See Revoke a credential.

EU Digital Identity options (JSON-LD, SD-JWT and mDoc templates):

  • credentialScope (optional): the scope wallets use to ask for this credential, for ecosystems that define their own scope values, for example eu.europa.ec.eudi.pid.1. If you leave it out, Hovi generates one from the credential type. It can't contain spaces, double quotes or backslashes, and you can't change it after the template is created.
  • authorization: true on an attribute: when you issue with the authorization code flow, this attribute is filled from the holder's sign-in instead of credentialValues. Its name must match the sign-in detail exactly, for example given_name or email. Top-level attributes only.

What happens next​

Issue a credential from your template. The Credential Templates endpoints also let you list, update and delete templates; see the Credential Templates endpoints.