Credential templates
A credential template describes a credential you issue: its name, format and attributes. The formats you can use depend on the ecosystem (see Compatibility):
| Format | Ecosystems | Method |
|---|---|---|
| JSON-LD | EU Digital Identity, cheqd, Indicio, Polygon | createCredentialTemplateJsonld |
| SD-JWT | EU Digital Identity | createCredentialTemplateSdJwt |
| mDoc | EU Digital Identity | createCredentialTemplateMdoc |
| JWT-VC | Microsoft Entra | createCredentialTemplateJwtVc |
| AnonCreds | cheqd, Indicio | createCredentialTemplateAnoncreds |
- Get all credential templates
- Get organization credential templates
- Create credential template (JSON-LD)
- Create credential template (SD-JWT)
- Create credential template (mDoc)
- Create credential template (JWT-VC)
- Create credential template (AnonCreds)
- Update credential template
- Delete credential template
- Import credential template (JSON-LD)
- Import credential template (AnonCreds)
Get all credential templates
Lists the credential templates in your ecosystem. To list only one organization's templates, use Get organization credential templates.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await openid.getAllCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await entra.getAllCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await cheqd.getAllCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await indicio.getAllCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await privado.getAllCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Optional) | Return only this template. |
Get organization credential templates
Lists the credential templates of one organization.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await openid.getOrganizationCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await entra.getOrganizationCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await cheqd.getOrganizationCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await indicio.getOrganizationCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const templates = await privado.getOrganizationCredentialTemplates({
organizationId: '<ORGANIZATION_ID>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Optional) | Return only this template. |
Create credential template (JSON-LD)
Creates a JSON-LD (W3C) credential template.
EU Digital Identity
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await openid.createCredentialTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
schemaType: 'EmployeeID',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await cheqd.createCredentialTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
schemaType: 'EmployeeID',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await indicio.createCredentialTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
schemaType: 'EmployeeID',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await privado.createCredentialTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
schemaType: 'EmployeeID',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template, for example 1.0.0. |
| description | string (Required) | A description of the template. |
| schemaType | string (Required) | The credential type, for example EmployeeID. |
| attributes | CredentialTemplateAttribute[] (Required) | The attributes the credential holds. Each has a name, label, type, description and required flag. |
| image | string (Optional) | A URL of the template's image. |
| categoryId | string (Optional) | The ID of a category for the template. |
| credentialTheme | CredentialTheme (Optional) | How the credential card looks: title, description, colours, background image and logo. |
| privadoCredentialType | string (Optional) | Polygon only: the Polygon credential type. |
Create credential template (SD-JWT)
Creates an SD-JWT credential template. With SD-JWT, the holder can share only some of the credential's attributes.
EU Digital Identity
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await openid.createCredentialTemplateSdJwt({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
schemaType: 'EmployeeID',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template, for example 1.0.0. |
| description | string (Required) | A description of the template. |
| schemaType | string (Required) | The credential type, for example EmployeeID. |
| attributes | CredentialTemplateAttribute[] (Required) | The attributes the credential holds. Each has a name, label, type, description and required flag. |
| image | string (Optional) | A URL of the template's image. |
| categoryId | string (Optional) | The ID of a category for the template. |
| credentialTheme | CredentialTheme (Optional) | How the credential card looks: title, description, colours, background image and logo. |
| supportRevocation | boolean (Optional) | Lets you revoke credentials issued from this template. You revoke them through the API. |
| sdJwtHeader | string (Optional) | A custom SD-JWT header value. |
Create credential template (mDoc)
Creates an mDoc (ISO 18013-5) credential template.
EU Digital Identity
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await openid.createCredentialTemplateMdoc({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
docType: 'com.example.employee.1',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template, for example 1.0.0. |
| description | string (Required) | A description of the template. |
| docType | string (Required) | The mDoc document type. |
| attributes | CredentialTemplateAttribute[] (Required) | The attributes the credential holds. Each has a name, label, type, description and required flag. |
| image | string (Optional) | A URL of the template's image. |
| categoryId | string (Optional) | The ID of a category for the template. |
| credentialTheme | CredentialTheme (Optional) | How the credential card looks: title, description, colours, background image and logo. |
| namespace | string (Optional) | The mDoc namespace for the attributes. |
Create credential template (JWT-VC)
Creates a Microsoft Entra Verified ID credential template. Use credentialTheme to set how the card looks in Microsoft Authenticator.
Microsoft Entra
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await entra.createCredentialTemplateJwtVc({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
schemaType: 'EmployeeID',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
credentialTheme: {
backgroundColor: '#1F3A93',
textColor: '#FFFFFF',
logoUrl: 'https://example.com/logo.png',
logoAlt: 'Acme University logo',
},
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template, for example 1.0.0. |
| description | string (Required) | A description of the template. |
| schemaType | string (Required) | The credential type, for example EmployeeID. |
| attributes | CredentialTemplateAttribute[] (Required) | The attributes the credential holds. Each has a name, label, type, description and required flag. |
| image | string (Optional) | A URL of the template's image. |
| categoryId | string (Optional) | The ID of a category for the template. |
| credentialTheme | CredentialTheme (Optional) | How the credential card looks: title, description, colours, background image and logo. |
Create credential template (AnonCreds)
Creates an AnonCreds credential template.
cheqd
Indicio
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await cheqd.createCredentialTemplateAnoncreds({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
tag: 'employee-id-v1',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await indicio.createCredentialTemplateAnoncreds({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee ID',
version: '1.0.0',
description: 'Employee ID card',
tag: 'employee-id-v1',
attributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template, for example 1.0.0. |
| description | string (Required) | A description of the template. |
| tag | string (Required) | A tag for the template. |
| attributes | CredentialTemplateAttribute[] (Required) | The attributes the credential holds. Each has a name, label, type, description and required flag. |
| image | string (Optional) | A URL of the template's image. |
| categoryId | string (Optional) | The ID of a category for the template. |
Update credential template
Changes a template's image or category. Only the fields you pass are changed.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await openid.updateCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
image: 'https://example.com/new-image.png',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await entra.updateCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
image: 'https://example.com/new-image.png',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await cheqd.updateCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
image: 'https://example.com/new-image.png',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await indicio.updateCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
image: 'https://example.com/new-image.png',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await privado.updateCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
image: 'https://example.com/new-image.png',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Required) | The ID of the template to update. |
| categoryId | string (Optional) | The ID of a category for the template. |
| image | string (Optional) | A new URL of the template's image. |
Delete credential template
Deletes a credential template.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await openid.deleteCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await entra.deleteCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await cheqd.deleteCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await indicio.deleteCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await privado.deleteCredentialTemplate({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Required) | The ID of the template to delete. |
- This can't be undone. Make sure you no longer issue credentials from this template.
Import credential template (JSON-LD)
Creates a JSON-LD credential template from an existing schema URL.
EU Digital Identity
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await openid.importCredentialTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
schemaUrl: 'https://example.com/schemas/employee-id.json',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await cheqd.importCredentialTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
schemaUrl: 'https://example.com/schemas/employee-id.json',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await indicio.importCredentialTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
schemaUrl: 'https://example.com/schemas/employee-id.json',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await privado.importCredentialTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
schemaUrl: 'https://example.com/schemas/employee-id.json',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| schemaUrl | string (Required) | The URL of the existing JSON-LD schema. |
| categoryId | string (Optional) | The ID of a category for the template. |
| image | string (Optional) | A URL of the template's image. |
Import credential template (AnonCreds)
Creates an AnonCreds credential template from a schema that already exists on the ledger.
cheqd
Indicio
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await cheqd.importCredentialTemplateAnoncreds({
organizationId: '<ORGANIZATION_ID>',
schemaId: '<SCHEMA_ID>',
tag: 'employee-id-v1',
description: 'Employee ID card',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const template = await indicio.importCredentialTemplateAnoncreds({
organizationId: '<ORGANIZATION_ID>',
schemaId: '<SCHEMA_ID>',
tag: 'employee-id-v1',
description: 'Employee ID card',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| schemaId | string (Required) | The ID of the existing AnonCreds schema. |
| tag | string (Required) | A tag for the imported template. |
| description | string (Required) | A description of the template. |
| image | string (Optional) | A URL of the template's image. |
| categoryId | string (Optional) | The ID of a category for the template. |