Skip to content

Template Service

The Template Service allows you to manage and search Credential Templates.

Templates are optional

Templates are designed to be a helpful abstraction over the complexities of producing valid JSON-LD Verifiable Credentials.

You aren't required to use templates; if you produce valid JSON-LD VCs yourself, they can be issued through Trinsic.


Service Creation

trinsic vc issue --document <JSONLD_FILE> --out <OUTPUT_FILE>







Create Template

Field Annotations

When defining the Fields of a Template, the annotations object can be used to set arbitrary key-value metadata on a Field.

Trinsic defines certain annotations that dictate how a credential field containing a URI will render during the verification flow.

Click here for more information on this use case.

Creates a new credential template.

trinsic vc issue --document <JSONLD_FILE> --out <OUTPUT_FILE>






Request to create a new template
name
string
Name of new template. Must be a unique identifier within its ecosystem.
fields
map(string -> TemplateField)
Fields which compose the template
Show child attributes
allow_additional_fields
bool
Whether credentials may be issued against this template which have fields not specified in fields
title
string
Human-readable name of template
description
string
Human-readable description of template
field_ordering
map(string -> FieldOrdering)
Optional map describing how to order and categorize the fields within the template. The key of this map is the field name. If not provided, this will be auto-generated.
Show child attributes
apple_wallet_options
Options for rendering the template in Apple Wallet
Show child attributes

Response to CreateCredentialTemplateRequest
data
Created template
Show child attributes


Get Template

Fetches a template definition by id.

trinsic vc issue --document <JSONLD_FILE> --out <OUTPUT_FILE>






Request to fetch a template by ID
id
string
ID of template to fetch

Response to GetCredentialTemplateRequest
template
Template fetched by ID
Show child attributes


Update

Update metadata of a template

trinsic vc issue --document <JSONLD_FILE> --out <OUTPUT_FILE>






Request to update display information for a template
id
string
ID of Template to update
title
string
New human-readable title of Template
description
string
New human-readable description of Template
fields
map(string -> TemplateFieldPatch)
Fields to update within the Template
Show child attributes
field_ordering
map(string -> FieldOrdering)
New field ordering options. See documentation for template creation for usage information.
Show child attributes
apple_wallet_options
New Apple Wallet configuration
Show child attributes

Response to UpdateCredentialTemplateRequest
updated_template
The Template after the update has been applied
Show child attributes


List

Search credential templates using SQL, returning strongly-typed template data

trinsic vc issue --document <JSONLD_FILE> --out <OUTPUT_FILE>






Request to list templates using a SQL query
query
string
SQL query to execute. Example: SELECT * FROM c WHERE c.name = 'Diploma'
continuation_token
optional string
Token provided by previous ListCredentialTemplatesResponse if more data is available for query

Response to ListCredentialTemplatesRequest
templates
Templates found by query
Show child attributes
has_more_results
bool
Whether more results are available for this query via continuation_token
continuation_token
string
Token to fetch next set of resuts via ListCredentialTemplatesRequest


Delete Template

Deletes a credential template by id.

trinsic vc issue --document <JSONLD_FILE> --out <OUTPUT_FILE>






Request to delete a template by ID
id
string
ID of template to delete

Response to DeleteCredentialTemplateRequest
This message has no fields


Search Templates

Searches all templates defined in the current ecosystem, and a continuation_token to paginate large result sets.

If no query is specified, this call by default returns the first 100 templates.

trinsic vc issue --document <JSONLD_FILE> --out <OUTPUT_FILE>






Request to search templates using a SQL query
query
string
SQL query to execute. Example: SELECT * FROM c WHERE c.name = 'Diploma'
continuation_token
optional string
Token provided by previous SearchCredentialTemplatesResponse if more data is available for query

Response to SearchCredentialTemplatesRequest
items_json
string
Raw JSON data returned from query
has_more
bool
Whether more results are available for this query via continuation_token
continuation_token
string
Token to fetch next set of results via SearchCredentialTemplatesRequest

The Search endpoint supports SQL queries through the query parameter.

This allows for arbitrary query predicates, as well as more advanced functionality -- such as modifying the output format.

Schema

Any table name may be used in your query (we use c here) -- it doesn't matter what it is.

Name Type Description
id string Corresponds to the id returned when template was created
type string Always VerifiableCredential
ecosystemId string ID of ecosystem in which template resides
createdBy string ID of account which defined the template
name string Name provided during template creation
schemaUri string HTTPS URL pointing to JSON Schema generated by Trinsic for this template
contextUri string HTTPS URL pointing to JSON-LD Context generated by Trinsic for this template
version int Version of template; increments whenever template is modified.
fields object JSON Object representing the template's fields

Note that fields is an object, not a string; thus, any of its sub-fields may be queried against.

More Info

This endpoint works very similarly to querying Wallet items; please see Wallet Service > Search for more information.