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
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.
SampleTrinsic CLI TypeScript C# Dart Python Go Java Request Response
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
Fields which compose the template
Show child attributes
fields[key ]. title
string
Human-readable name of the field
fields[key ]. description
string
Human-readable description of the field
fields[key ]. optional
bool
Whether this field may be omitted when a credential is issued against the template
fields[key ]. type
The type of the field
Show enum values
fields[key ]. annotations
map(string -> string)
Do not use. Annotations for the field that may be used to add additional information.
fields[key ]. uri_data
How to deal with this URI field when rendering credential. Only use if type is URI.
Show child attributes
fields[key ].uri_data. mime_type
string
Expected MIME Type of content pointed to by URI. Can be generic (eg, "image/") or specific ("image/png"). Defaults to "application/octet-stream".
fields[key ].uri_data. render_method
How to display the URI value when rendering a credential.
Show enum values
UriRenderMethod. TEXT
= 0
Display URI as text
UriRenderMethod. LINK
= 1
Display URI as a clickable link
UriRenderMethod. INLINE_IMAGE
= 2
Display URI as an inline image. Only takes effect if the template field's MIME Type is an image type.
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
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
field_ordering[key ]. order
int32
The order of the field; must be unique within the Template. Fields are sorted by order ascending when displaying a credential. Field orders must be contiguous from 0 to the number of fields minus 1.
field_ordering[key ]. section
string
The human-readable name of the section this field appears in; used to group together fields when displaying a credential. Sections must be contiguous with respect to order.
apple_wallet_options
Options for rendering the template in Apple Wallet
Show child attributes
apple_wallet_options. background_color
string
Background color, in hex format, of credential when stored in an Apple Wallet.
apple_wallet_options. foreground_color
string
Foreground color, in hex format, of credential when stored in an Apple Wallet.
apple_wallet_options. label_color
string
Label color, in hex format, of credential when stored in an Apple Wallet.
apple_wallet_options. primary_field
string
The ID of the template field which should be used as the primary field of a credential.
apple_wallet_options. secondary_fields
map(int32 -> string)
The secondary fields of the credential. This is a mapping between the order of a secondary field (0 or 1) and the field name.
apple_wallet_options. auxiliary_fields
map(int32 -> string)
The auxiliary fields of the credential. This is a mapping between the order of an auxiliary field (0 or 1) and the field name.
Response to CreateCredentialTemplateRequest
data
Created template
Show child attributes
data. id
string
Template ID
data. name
string
Template name
data. version
int32
Template version number
data. fields
Fields defined for the template
Show child attributes
data.fields[key ]. title
string
Human-readable name of the field
data.fields[key ]. description
string
Human-readable description of the field
data.fields[key ]. optional
bool
Whether this field may be omitted when a credential is issued against the template
data.fields[key ]. type
The type of the field
Show enum values
data.fields[key ]. annotations
map(string -> string)
Do not use. Annotations for the field that may be used to add additional information.
data.fields[key ]. uri_data
How to deal with this URI field when rendering credential. Only use if type is URI.
Show child attributes
data.fields[key ].uri_data. mime_type
string
Expected MIME Type of content pointed to by URI. Can be generic (eg, "image/") or specific ("image/png"). Defaults to "application/octet-stream".
data.fields[key ].uri_data. render_method
How to display the URI value when rendering a credential.
Show enum values
UriRenderMethod. TEXT
= 0
Display URI as text
UriRenderMethod. LINK
= 1
Display URI as a clickable link
UriRenderMethod. INLINE_IMAGE
= 2
Display URI as an inline image. Only takes effect if the template field's MIME Type is an image type.
data. allow_additional_fields
bool
Whether credentials issued against this template may contain fields not defined by template
data. schema_uri
string
URI pointing to template JSON schema document
data. context_uri
string
URI pointing to template JSON-LD context document
data. ecosystem_id
string
ID of ecosystem in which template resides
data. type
string
Template type (VerifiableCredential)
data. created_by
string
ID of template creator
data. date_created
string
Date when template was created as ISO 8601 utc string
data. title
string
Human-readable template title
data. description
string
Human-readable template description
data. field_ordering
Map describing how to order and categorize the fields within the template. The key of this map is the field name.
Show child attributes
data.field_ordering[key ]. order
int32
The order of the field; must be unique within the Template. Fields are sorted by order ascending when displaying a credential. Field orders must be contiguous from 0 to the number of fields minus 1.
data.field_ordering[key ]. section
string
The human-readable name of the section this field appears in; used to group together fields when displaying a credential. Sections must be contiguous with respect to order.
data. apple_wallet_options
Options for rendering the template in Apple Wallet
Show child attributes
data.apple_wallet_options. background_color
string
Background color, in hex format, of credential when stored in an Apple Wallet.
data.apple_wallet_options. foreground_color
string
Foreground color, in hex format, of credential when stored in an Apple Wallet.
data.apple_wallet_options. label_color
string
Label color, in hex format, of credential when stored in an Apple Wallet.
data.apple_wallet_options. primary_field
string
The ID of the template field which should be used as the primary field of a credential.
data.apple_wallet_options. secondary_fields
map(int32 -> string)
The secondary fields of the credential. This is a mapping between the order of a secondary field (0 or 1) and the field name.
data.apple_wallet_options. auxiliary_fields
map(int32 -> string)
The auxiliary fields of the credential. This is a mapping between the order of an auxiliary field (0 or 1) and the field name.
Get Template
Fetches a template definition by id.
SampleTrinsic CLI TypeScript C# Dart Python Go Java Request Response
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
template. id
string
Template ID
template. name
string
Template name
template. version
int32
Template version number
template. fields
Fields defined for the template
Show child attributes
template.fields[key ]. title
string
Human-readable name of the field
template.fields[key ]. description
string
Human-readable description of the field
template.fields[key ]. optional
bool
Whether this field may be omitted when a credential is issued against the template
template.fields[key ]. type
The type of the field
Show enum values
template.fields[key ]. annotations
map(string -> string)
Do not use. Annotations for the field that may be used to add additional information.
template.fields[key ]. uri_data
How to deal with this URI field when rendering credential. Only use if type is URI.
Show child attributes
template.fields[key ].uri_data. mime_type
string
Expected MIME Type of content pointed to by URI. Can be generic (eg, "image/") or specific ("image/png"). Defaults to "application/octet-stream".
template.fields[key ].uri_data. render_method
How to display the URI value when rendering a credential.
Show enum values
UriRenderMethod. TEXT
= 0
Display URI as text
UriRenderMethod. LINK
= 1
Display URI as a clickable link
UriRenderMethod. INLINE_IMAGE
= 2
Display URI as an inline image. Only takes effect if the template field's MIME Type is an image type.
template. allow_additional_fields
bool
Whether credentials issued against this template may contain fields not defined by template
template. schema_uri
string
URI pointing to template JSON schema document
template. context_uri
string
URI pointing to template JSON-LD context document
template. ecosystem_id
string
ID of ecosystem in which template resides
template. type
string
Template type (VerifiableCredential)
template. created_by
string
ID of template creator
template. date_created
string
Date when template was created as ISO 8601 utc string
template. title
string
Human-readable template title
template. description
string
Human-readable template description
template. field_ordering
Map describing how to order and categorize the fields within the template. The key of this map is the field name.
Show child attributes
template.field_ordering[key ]. order
int32
The order of the field; must be unique within the Template. Fields are sorted by order ascending when displaying a credential. Field orders must be contiguous from 0 to the number of fields minus 1.
template.field_ordering[key ]. section
string
The human-readable name of the section this field appears in; used to group together fields when displaying a credential. Sections must be contiguous with respect to order.
template. apple_wallet_options
Options for rendering the template in Apple Wallet
Show child attributes
template.apple_wallet_options. background_color
string
Background color, in hex format, of credential when stored in an Apple Wallet.
template.apple_wallet_options. foreground_color
string
Foreground color, in hex format, of credential when stored in an Apple Wallet.
template.apple_wallet_options. label_color
string
Label color, in hex format, of credential when stored in an Apple Wallet.
template.apple_wallet_options. primary_field
string
The ID of the template field which should be used as the primary field of a credential.
template.apple_wallet_options. secondary_fields
map(int32 -> string)
The secondary fields of the credential. This is a mapping between the order of a secondary field (0 or 1) and the field name.
template.apple_wallet_options. auxiliary_fields
map(int32 -> string)
The auxiliary fields of the credential. This is a mapping between the order of an auxiliary field (0 or 1) and the field name.
Update
Update metadata of a template
SampleTrinsic CLI TypeScript C# Dart Python Go Java Request Response
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
Fields to update within the Template
Show child attributes
fields[key ]. title
string
Human-readable name of the field
fields[key ]. description
string
Human-readable description of the field
fields[key ]. uri_data
How to deal with this URI field when rendering credential. Only use if type is URI.
Show child attributes
fields[key ].uri_data. mime_type
string
Expected MIME Type of content pointed to by URI. Can be generic (eg, "image/") or specific ("image/png"). Defaults to "application/octet-stream".
fields[key ].uri_data. render_method
How to display the URI value when rendering a credential.
Show enum values
UriRenderMethod. TEXT
= 0
Display URI as text
UriRenderMethod. LINK
= 1
Display URI as a clickable link
UriRenderMethod. INLINE_IMAGE
= 2
Display URI as an inline image. Only takes effect if the template field's MIME Type is an image type.
field_ordering
New field ordering options. See documentation for template creation for usage information.
Show child attributes
field_ordering[key ]. order
int32
The order of the field; must be unique within the Template. Fields are sorted by order ascending when displaying a credential. Field orders must be contiguous from 0 to the number of fields minus 1.
field_ordering[key ]. section
string
The human-readable name of the section this field appears in; used to group together fields when displaying a credential. Sections must be contiguous with respect to order.
apple_wallet_options
New Apple Wallet configuration
Show child attributes
apple_wallet_options. background_color
string
Background color, in hex format, of credential when stored in an Apple Wallet.
apple_wallet_options. foreground_color
string
Foreground color, in hex format, of credential when stored in an Apple Wallet.
apple_wallet_options. label_color
string
Label color, in hex format, of credential when stored in an Apple Wallet.
apple_wallet_options. primary_field
string
The ID of the template field which should be used as the primary field of a credential.
apple_wallet_options. secondary_fields
map(int32 -> string)
The secondary fields of the credential. This is a mapping between the order of a secondary field (0 or 1) and the field name.
apple_wallet_options. auxiliary_fields
map(int32 -> string)
The auxiliary fields of the credential. This is a mapping between the order of an auxiliary field (0 or 1) and the field name.
Response to UpdateCredentialTemplateRequest
updated_template
The Template after the update has been applied
Show child attributes
updated_template. id
string
Template ID
updated_template. name
string
Template name
updated_template. version
int32
Template version number
updated_template. fields
Fields defined for the template
Show child attributes
updated_template.fields[key ]. title
string
Human-readable name of the field
updated_template.fields[key ]. description
string
Human-readable description of the field
updated_template.fields[key ]. optional
bool
Whether this field may be omitted when a credential is issued against the template
updated_template.fields[key ]. type
The type of the field
Show enum values
updated_template.fields[key ]. annotations
map(string -> string)
Do not use. Annotations for the field that may be used to add additional information.
updated_template.fields[key ]. uri_data
How to deal with this URI field when rendering credential. Only use if type is URI.
Show child attributes
updated_template.fields[key ].uri_data. mime_type
string
Expected MIME Type of content pointed to by URI. Can be generic (eg, "image/") or specific ("image/png"). Defaults to "application/octet-stream".
updated_template.fields[key ].uri_data. render_method
How to display the URI value when rendering a credential.
Show enum values
UriRenderMethod. TEXT
= 0
Display URI as text
UriRenderMethod. LINK
= 1
Display URI as a clickable link
UriRenderMethod. INLINE_IMAGE
= 2
Display URI as an inline image. Only takes effect if the template field's MIME Type is an image type.
updated_template. allow_additional_fields
bool
Whether credentials issued against this template may contain fields not defined by template
updated_template. schema_uri
string
URI pointing to template JSON schema document
updated_template. context_uri
string
URI pointing to template JSON-LD context document
updated_template. ecosystem_id
string
ID of ecosystem in which template resides
updated_template. type
string
Template type (VerifiableCredential)
updated_template. created_by
string
ID of template creator
updated_template. date_created
string
Date when template was created as ISO 8601 utc string
updated_template. title
string
Human-readable template title
updated_template. description
string
Human-readable template description
updated_template. field_ordering
Map describing how to order and categorize the fields within the template. The key of this map is the field name.
Show child attributes
updated_template.field_ordering[key ]. order
int32
The order of the field; must be unique within the Template. Fields are sorted by order ascending when displaying a credential. Field orders must be contiguous from 0 to the number of fields minus 1.
updated_template.field_ordering[key ]. section
string
The human-readable name of the section this field appears in; used to group together fields when displaying a credential. Sections must be contiguous with respect to order.
updated_template. apple_wallet_options
Options for rendering the template in Apple Wallet
Show child attributes
updated_template.apple_wallet_options. background_color
string
Background color, in hex format, of credential when stored in an Apple Wallet.
updated_template.apple_wallet_options. foreground_color
string
Foreground color, in hex format, of credential when stored in an Apple Wallet.
updated_template.apple_wallet_options. label_color
string
Label color, in hex format, of credential when stored in an Apple Wallet.
updated_template.apple_wallet_options. primary_field
string
The ID of the template field which should be used as the primary field of a credential.
updated_template.apple_wallet_options. secondary_fields
map(int32 -> string)
The secondary fields of the credential. This is a mapping between the order of a secondary field (0 or 1) and the field name.
updated_template.apple_wallet_options. auxiliary_fields
map(int32 -> string)
The auxiliary fields of the credential. This is a mapping between the order of an auxiliary field (0 or 1) and the field name.
List
Search credential templates using SQL, returning strongly-typed template data
SampleTrinsic CLI TypeScript C# Dart Python Go Java Request Response
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
templates[i ]. id
string
Template ID
templates[i ]. name
string
Template name
templates[i ]. version
int32
Template version number
templates[i ]. fields
Fields defined for the template
Show child attributes
templates[i ].fields[key ]. title
string
Human-readable name of the field
templates[i ].fields[key ]. description
string
Human-readable description of the field
templates[i ].fields[key ]. optional
bool
Whether this field may be omitted when a credential is issued against the template
templates[i ].fields[key ]. type
The type of the field
Show enum values
templates[i ].fields[key ]. annotations
map(string -> string)
Do not use. Annotations for the field that may be used to add additional information.
templates[i ].fields[key ]. uri_data
How to deal with this URI field when rendering credential. Only use if type is URI.
Show child attributes
templates[i ].fields[key ].uri_data. mime_type
string
Expected MIME Type of content pointed to by URI. Can be generic (eg, "image/") or specific ("image/png"). Defaults to "application/octet-stream".
templates[i ].fields[key ].uri_data. render_method
How to display the URI value when rendering a credential.
Show enum values
UriRenderMethod. TEXT
= 0
Display URI as text
UriRenderMethod. LINK
= 1
Display URI as a clickable link
UriRenderMethod. INLINE_IMAGE
= 2
Display URI as an inline image. Only takes effect if the template field's MIME Type is an image type.
templates[i ]. allow_additional_fields
bool
Whether credentials issued against this template may contain fields not defined by template
templates[i ]. schema_uri
string
URI pointing to template JSON schema document
templates[i ]. context_uri
string
URI pointing to template JSON-LD context document
templates[i ]. ecosystem_id
string
ID of ecosystem in which template resides
templates[i ]. type
string
Template type (VerifiableCredential)
templates[i ]. created_by
string
ID of template creator
templates[i ]. date_created
string
Date when template was created as ISO 8601 utc string
templates[i ]. title
string
Human-readable template title
templates[i ]. description
string
Human-readable template description
templates[i ]. field_ordering
Map describing how to order and categorize the fields within the template. The key of this map is the field name.
Show child attributes
templates[i ].field_ordering[key ]. order
int32
The order of the field; must be unique within the Template. Fields are sorted by order ascending when displaying a credential. Field orders must be contiguous from 0 to the number of fields minus 1.
templates[i ].field_ordering[key ]. section
string
The human-readable name of the section this field appears in; used to group together fields when displaying a credential. Sections must be contiguous with respect to order.
templates[i ]. apple_wallet_options
Options for rendering the template in Apple Wallet
Show child attributes
templates[i ].apple_wallet_options. background_color
string
Background color, in hex format, of credential when stored in an Apple Wallet.
templates[i ].apple_wallet_options. foreground_color
string
Foreground color, in hex format, of credential when stored in an Apple Wallet.
templates[i ].apple_wallet_options. label_color
string
Label color, in hex format, of credential when stored in an Apple Wallet.
templates[i ].apple_wallet_options. primary_field
string
The ID of the template field which should be used as the primary field of a credential.
templates[i ].apple_wallet_options. secondary_fields
map(int32 -> string)
The secondary fields of the credential. This is a mapping between the order of a secondary field (0 or 1) and the field name.
templates[i ].apple_wallet_options. auxiliary_fields
map(int32 -> string)
The auxiliary fields of the credential. This is a mapping between the order of an auxiliary field (0 or 1) and the field name.
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.
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.
Advanced Search
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.