Skip to main content

Verification Templates

Verification templates define reusable structures for verifying credentials across multiple ecosystems (OpenID, Privado ID, Indicio, Cheqd). These templates support formats such as AnonCreds and JSON-LD, enabling customization of requested attributes, restrictions, and conditions. This section covers methods to retrieve, create, update, and delete verification templates.

Get All Verification Templates

Retrieves a list of verification templates associated with the authenticated API key, with an optional filter by template ID.

import { OpenIDEcosystem } from '@openid/core-sdk';

const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});

const templates = await openid.getAllVerificationTemplates({
tenantId: 'your-tenant-id',
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant to query.
verificationTemplateIdstring (Optional)The ID of a specific verification template to retrieve (if omitted, returns all templates for the tenant).
note
  • Use the verificationTemplateId filter to retrieve a single template or omit it for a full list.
  • Responses may include metadata; check GetVerificationTemplatesResponse for full structure.

Get Organization Verification Templates

Retrieves verification templates specific to a tenant, with an optional filter by template ID.

import { OpenIDEcosystem } from '@openid/core-sdk';

const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});

const tenantTemplates = await openid.getTenantVerificationTemplates({
tenantId: 'your-tenant-id',
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant to query.
verificationTemplateIdstring (Optional)The ID of a specific verification template to retrieve (if omitted, returns all templates for the tenant).
note
  • Similar to getAllVerificationTemplates, but scoped to tenant-specific templates.
    • Use this for tenant-specific auditing or management.

Create Verification Template (JSON-LD)

Creates a new JSON-LD verification template.

import { OpenIDEcosystem } from '@openid/core-sdk';

const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});

const template = await openid.createVerificationTemplateJsonldRequest({
tenantId: 'your-tenant-id',
name: 'Employee Verification',
version: '1.0.0',
description: 'JSON-LD template for employee verification',
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 },
],
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant to associate the template with.
namestring (Required)The name of the template.
versionstring (Required)The version of the template (e.g., `1.0.0`).
descriptionstring (Required)A description of the template.
categoryIdstring (Optional)The ID of a category to associate with the template.
imagestring (Optional)A URL for the template’s image.
requestedAttributesVerificationTemplateAttribute[] (Required)Array of requested attribute definitions.
restrictionsJsonLdRestriction (Optional)Restrictions on the credential (e.g., issuer DID).
conditionsRecord<string, any>[] (Optional)Additional verification conditions.
note
  • requestedAttributes must include at least one entry with required: true.
  • Use restrictions to enforce specific credential issuers or schemas.

Create Verification Template (mDoc)

Creates a new mDoc verification template.

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

const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});

const template = await openid.createVerificationTemplateAnoncreds({
tenantId: 'your-tenant-id',
name: 'Employee Verification',
version: '1.0.0',
description: 'AnonCreds template for employee verification',
categoryId: 'cat-789',
image: 'https://example.com/logo.png',
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 },
],
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant to associate the template with.
namestring (Required)The name of the template.
versionstring (Required)The version of the template (e.g., `1.0.0`).
descriptionstring (Required)A description of the template.
categoryIdstring (Optional)The ID of a category to associate with the template.
imagestring (Optional)A URL for the template’s image.
requestedAttributesVerificationTemplateAttribute[] (Optional)Array of requested attribute definitions.
requestedPredicatesVerificationTemplateAnoncredsPredicate[] (Optional)Array of predicate definitions.
restrictionsVerificationTemplateAnoncredsRestriction[] (Optional)Restrictions on the credential.
nonRevokeInterval{ from: number; to: number; } (Optional)Non-revocation interval for the credential.
note
  • requestedAttributes and requestedPredicates are optional but recommended for specific verification criteria.
  • Use restrictions to enforce issuer-constraints.

Create Verification Template (SD-JWT)

Creates a new SD-JWT verification template.

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

const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});

const template = await openid.createVerificationTemplateAnoncreds({
tenantId: 'your-tenant-id',
name: 'Employee Verification',
version: '1.0.0',
description: 'AnonCreds template for employee verification',
categoryId: 'cat-789',
image: 'https://example.com/logo.png',
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 },
],
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant to associate the template with.
namestring (Required)The name of the template.
versionstring (Required)The version of the template (e.g., `1.0.0`).
descriptionstring (Required)A description of the template.
categoryIdstring (Optional)The ID of a category to associate with the template.
imagestring (Optional)A URL for the template’s image.
requestedAttributesVerificationTemplateAttribute[] (Optional)Array of requested attribute definitions.
requestedPredicatesVerificationTemplateAnoncredsPredicate[] (Optional)Array of predicate definitions.
restrictionsVerificationTemplateAnoncredsRestriction[] (Optional)Restrictions on the credential.
nonRevokeInterval{ from: number; to: number; } (Optional)Non-revocation interval for the credential.
note
  • requestedAttributes and requestedPredicates are optional but recommended for specific verification criteria.
  • Use restrictions to enforce issuer-constraints.

Create Verification Template (AnonCreds)

Creates a new AnonCreds verification template.

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

const indicio = new IndicioEcosystem({
apiKey: 'your-ecosystem-api-key',
});

const template = await indicio.createVerificationTemplateAnoncreds({
tenantId: 'your-tenant-id',
name: 'Employee Verification',
version: '1.0.0',
description: 'AnonCreds template for employee verification',
categoryId: 'cat-789',
image: 'https://example.com/logo.png',
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 },
],
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant to associate the template with.
namestring (Required)The name of the template.
versionstring (Required)The version of the template (e.g., `1.0.0`).
descriptionstring (Required)A description of the template.
categoryIdstring (Optional)The ID of a category to associate with the template.
imagestring (Optional)A URL for the template’s image.
requestedAttributesVerificationTemplateAttribute[] (Optional)Array of requested attribute definitions.
requestedPredicatesVerificationTemplateAnoncredsPredicate[] (Optional)Array of predicate definitions.
restrictionsVerificationTemplateAnoncredsRestriction[] (Optional)Restrictions on the credential.
nonRevokeInterval{ from: number; to: number; } (Optional)Non-revocation interval for the credential.
note
  • requestedAttributes and requestedPredicates are optional but recommended for specific verification criteria.
  • Use restrictions to enforce issuer-constraints.

Update Verification Template

Updates an existing verification template with new details.

import { OpenIDEcosystem } from '@openid/core-sdk';

const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});

const result = await openid.updateVerificationTemplate({
tenantId: 'your-tenant-id',
verificationTemplateId: 'your-verification-template-id',
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant owning the template.
verificationTemplateIdstring (Required)The ID of the verification template to update.
categoryIdstring (Optional)The ID of a category to associate with the template.
imagestring (Optional)A new URL for the template’s image.
namestring (Optional)A new name for the template.
descriptionstring (Optional)A new description for the template.
note
  • Only provided fields are updated; others remain unchanged.
  • Use this to refresh metadata like images, names, or categories.

Delete Verification Template

Deletes a verification template from a tenant.

import { OpenIDEcosystem } from '@openid/core-sdk';

const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});

const result = await openid.deleteVerificationTemplate({
tenantId: 'your-tenant-id',
verificationTemplateId: 'your-verification-template-id',
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant owning the template.
verificationTemplateIdstring (Required)The ID of the verification template to delete.
note
  • This action is irreversible and removes the template and its associated data.
  • Ensure no active proof requests rely on the template before deletion.