Skip to main content

Verification templates

A verification template describes what you ask a holder to prove: which attributes, from which kind of credential. The formats you can use depend on the ecosystem (see Compatibility):

FormatEcosystemsMethod
JSON-LDEU Digital IdentitycreateVerificationTemplateJsonld
JSON-LDcheqd, Indicio, PolygoncreateVerificationTemplateJsonldRequest
SD-JWTEU Digital IdentitycreateVerificationTemplateSdJwt
mDocEU Digital IdentitycreateVerificationTemplateMdoc
JWT-VCMicrosoft EntracreateVerificationTemplateJwtVc
AnonCredscheqd, IndiciocreateVerificationTemplateAnoncreds

Get all verification templates​

Lists the verification templates in your ecosystem. To list only one organization's templates, use Get organization verification templates.

import { OpenIdEcosystem } from '@hovi/core-sdk';

const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const templates = await openid.getAllVerificationTemplates({
organizationId: '<ORGANIZATION_ID>',
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
verificationTemplateIdstring (Optional)Return only this template.

Get organization verification templates​

Lists the verification templates of one organization.

import { OpenIdEcosystem } from '@hovi/core-sdk';

const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const templates = await openid.getOrganizationVerificationTemplates({
organizationId: '<ORGANIZATION_ID>',
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
verificationTemplateIdstring (Optional)Return only this template.

Create verification template (JSON-LD)​

Creates a verification template for JSON-LD (W3C) credentials. The method is createVerificationTemplateJsonld in EU Digital Identity and createVerificationTemplateJsonldRequest in cheqd, Indicio and Polygon.

import { OpenIdEcosystem } from '@hovi/core-sdk';

const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const template = await openid.createVerificationTemplateJsonld({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee check',
version: '1.0.0',
description: 'Checks an employee ID',
requestedAttributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
restrictions: {
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
},
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
namestring (Required)The name of the template.
versionstring (Required)The version of the template, for example 1.0.0.
descriptionstring (Required)A description of the template.
requestedAttributesVerificationTemplateAttribute[] (Required)The attributes to ask for. Each has a name, label, type, description and required flag.
categoryIdstring (Optional)The ID of a category for the template.
imagestring (Optional)A URL of the template's image.
restrictions{ issuerDid?, schemaType?, schemaUrl?, credentialTemplateId? } (Optional)Accept only credentials that match these values, for example from one issuer or template.
conditionsRecord<string, any>[] (Optional)Polygon only: extra conditions on the attribute values.

Create verification template (SD-JWT)​

Creates a verification template for SD-JWT credentials.

import { OpenIdEcosystem } from '@hovi/core-sdk';

const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const template = await openid.createVerificationTemplateSdJwt({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee check',
version: '1.0.0',
description: 'Checks an employee ID',
requestedAttributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
restrictions: {
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
},
limit_disclosure: true,
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
namestring (Required)The name of the template.
versionstring (Required)The version of the template, for example 1.0.0.
descriptionstring (Required)A description of the template.
requestedAttributesVerificationTemplateAttribute[] (Required)The attributes to ask for. Each has a name, label, type, description and required flag.
categoryIdstring (Optional)The ID of a category for the template.
imagestring (Optional)A URL of the template's image.
restrictions{ credentialTemplateId?, schemaType?, issuerDid? } (Optional)Accept only credentials that match these values.
limit_disclosureboolean (Optional)Ask the wallet to share only the requested attributes.

Create verification template (mDoc)​

Creates a verification template for mDoc credentials.

import { OpenIdEcosystem } from '@hovi/core-sdk';

const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const template = await openid.createVerificationTemplateMdoc({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee check',
version: '1.0.0',
description: 'Checks an employee ID',
requestedAttributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
restrictions: {
docType: 'com.example.employee.1',
},
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
namestring (Required)The name of the template.
versionstring (Required)The version of the template, for example 1.0.0.
descriptionstring (Required)A description of the template.
requestedAttributesVerificationTemplateAttribute[] (Optional)The attributes to ask for. Each has a name, label, type, description and required flag.
categoryIdstring (Optional)The ID of a category for the template.
imagestring (Optional)A URL of the template's image.
restrictions{ credentialTemplateId?, docType?, namespace? } (Optional)Accept only credentials that match these values.
limit_disclosureboolean (Optional)Ask the wallet to share only the requested attributes.

Create verification template (JWT-VC)​

Creates a verification template for Microsoft Entra Verified ID credentials.

import { EntraEcosystem } from '@hovi/core-sdk';

const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const template = await entra.createVerificationTemplateJwtVc({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee check',
version: '1.0.0',
description: 'Checks an employee ID',
requestedAttributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
restrictions: {
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
},
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
namestring (Required)The name of the template.
versionstring (Required)The version of the template, for example 1.0.0.
descriptionstring (Required)A description of the template.
requestedAttributesVerificationTemplateAttribute[] (Required)The attributes to ask for. Each has a name, label, type, description and required flag.
categoryIdstring (Optional)The ID of a category for the template.
imagestring (Optional)A URL of the template's image.
restrictions{ credentialTemplateId?, issuerDid? } (Optional)Accept only credentials that match these values.

Create verification template (AnonCreds)​

Creates a verification template for AnonCreds credentials. Besides attributes, AnonCreds can check a predicate, for example "age is at least 18", without revealing the value.

import { CheqdEcosystem } from '@hovi/core-sdk';

const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const template = await cheqd.createVerificationTemplateAnoncreds({
organizationId: '<ORGANIZATION_ID>',
name: 'Employee check',
version: '1.0.0',
description: 'Checks an employee ID',
requestedAttributes: [
{ name: 'firstName', label: 'First name', type: 'string', description: 'Given name', required: true },
{ name: 'lastName', label: 'Last name', type: 'string', description: 'Family name', required: true },
],
requestedPredicates: [
{ name: 'age', p_type: '>=', p_value: 18 },
],
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
namestring (Required)The name of the template.
versionstring (Required)The version of the template, for example 1.0.0.
descriptionstring (Required)A description of the template.
requestedAttributesVerificationTemplateAttribute[] (Optional)The attributes to ask for. Each has a name, label, type, description and required flag.
requestedPredicates{ name, p_type, p_value }[] (Optional)Conditions to prove without revealing the value, for example age >= 18.
restrictions{ issuer_id? }[] (Optional)Accept only credentials from these issuers.
nonRevokeInterval{ from: number; to: number } (Optional)The time range in which the credential must not be revoked.
categoryIdstring (Optional)The ID of a category for the template.
imagestring (Optional)A URL of the template's image.

Update verification template​

Changes a template's name, description, image or category. Only the fields you pass are changed.

import { OpenIdEcosystem } from '@hovi/core-sdk';

const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const result = await openid.updateVerificationTemplate({
organizationId: '<ORGANIZATION_ID>',
verificationTemplateId: '<VERIFICATION_TEMPLATE_ID>',
name: 'Employee check (v2)',
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
verificationTemplateIdstring (Required)The ID of the template to update.
namestring (Optional)A new name for the template.
descriptionstring (Optional)A new description for the template.
categoryIdstring (Optional)The ID of a category for the template.
imagestring (Optional)A new URL of the template's image.

Delete verification template​

Deletes a verification template.

import { OpenIdEcosystem } from '@hovi/core-sdk';

const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const result = await openid.deleteVerificationTemplate({
organizationId: '<ORGANIZATION_ID>',
verificationTemplateId: '<VERIFICATION_TEMPLATE_ID>',
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
verificationTemplateIdstring (Required)The ID of the template to delete.
note
  • This can't be undone.