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
- Get Organization Verification Templates
- Create Verification Template (JSON-LD)
- Create Verification Template (SD-JWT)
- Create Verification Template (mDoc)
- Create Verification Template (AnonCreds)
- Update Verification Template
- Delete Verification Template
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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to query. |
| verificationTemplateId | string (Optional) | The ID of a specific verification template to retrieve (if omitted, returns all templates for the tenant). |
- Use the
verificationTemplateIdfilter to retrieve a single template or omit it for a full list. - Responses may include metadata; check
GetVerificationTemplatesResponsefor 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to query. |
| verificationTemplateId | string (Optional) | The ID of a specific verification template to retrieve (if omitted, returns all templates for the tenant). |
- 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to associate the template with. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template (e.g., `1.0.0`). |
| description | string (Required) | A description of the template. |
| categoryId | string (Optional) | The ID of a category to associate with the template. |
| image | string (Optional) | A URL for the template’s image. |
| requestedAttributes | VerificationTemplateAttribute[] (Required) | Array of requested attribute definitions. |
| restrictions | JsonLdRestriction (Optional) | Restrictions on the credential (e.g., issuer DID). |
| conditions | Record<string, any>[] (Optional) | Additional verification conditions. |
requestedAttributesmust include at least one entry withrequired: true.- Use
restrictionsto 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to associate the template with. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template (e.g., `1.0.0`). |
| description | string (Required) | A description of the template. |
| categoryId | string (Optional) | The ID of a category to associate with the template. |
| image | string (Optional) | A URL for the template’s image. |
| requestedAttributes | VerificationTemplateAttribute[] (Optional) | Array of requested attribute definitions. |
| requestedPredicates | VerificationTemplateAnoncredsPredicate[] (Optional) | Array of predicate definitions. |
| restrictions | VerificationTemplateAnoncredsRestriction[] (Optional) | Restrictions on the credential. |
| nonRevokeInterval | { from: number; to: number; } (Optional) | Non-revocation interval for the credential. |
requestedAttributesandrequestedPredicatesare optional but recommended for specific verification criteria.- Use
restrictionsto 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to associate the template with. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template (e.g., `1.0.0`). |
| description | string (Required) | A description of the template. |
| categoryId | string (Optional) | The ID of a category to associate with the template. |
| image | string (Optional) | A URL for the template’s image. |
| requestedAttributes | VerificationTemplateAttribute[] (Optional) | Array of requested attribute definitions. |
| requestedPredicates | VerificationTemplateAnoncredsPredicate[] (Optional) | Array of predicate definitions. |
| restrictions | VerificationTemplateAnoncredsRestriction[] (Optional) | Restrictions on the credential. |
| nonRevokeInterval | { from: number; to: number; } (Optional) | Non-revocation interval for the credential. |
requestedAttributesandrequestedPredicatesare optional but recommended for specific verification criteria.- Use
restrictionsto 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to associate the template with. |
| name | string (Required) | The name of the template. |
| version | string (Required) | The version of the template (e.g., `1.0.0`). |
| description | string (Required) | A description of the template. |
| categoryId | string (Optional) | The ID of a category to associate with the template. |
| image | string (Optional) | A URL for the template’s image. |
| requestedAttributes | VerificationTemplateAttribute[] (Optional) | Array of requested attribute definitions. |
| requestedPredicates | VerificationTemplateAnoncredsPredicate[] (Optional) | Array of predicate definitions. |
| restrictions | VerificationTemplateAnoncredsRestriction[] (Optional) | Restrictions on the credential. |
| nonRevokeInterval | { from: number; to: number; } (Optional) | Non-revocation interval for the credential. |
requestedAttributesandrequestedPredicatesare optional but recommended for specific verification criteria.- Use
restrictionsto 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant owning the template. |
| verificationTemplateId | string (Required) | The ID of the verification template to update. |
| categoryId | string (Optional) | The ID of a category to associate with the template. |
| image | string (Optional) | A new URL for the template’s image. |
| name | string (Optional) | A new name for the template. |
| description | string (Optional) | A new description for the template. |
- 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant owning the template. |
| verificationTemplateId | string (Required) | The ID of the verification template to delete. |
- This action is irreversible and removes the template and its associated data.
- Ensure no active proof requests rely on the template before deletion.