Credential Schemas
Schemas are useful when enforcing a specific structure on a collection of data like a Verifiable Credential. Data Verification schemas, for example, are used to verify that the structure and contents of a Verifiable Credential conform to a published schema. On the other hand, Data Encoding schemas are used to map the contents of a Verifiable Credential to an alternative representation format, such as a binary format used in a zero-knowledge proof.
Truvera credential schemas are using json schema format and should follow this structure https://json-schema.org/understanding-json-schema/reference
Create Schema
Schemas are used to describe the structure of credentials, specifically the credential subject. It helps the issuer, holder, and verifier to unambiguously determine the claims contained within the credential. To create a schema, you need to define the object body using JSON schema.
Parameters
body
body
object
true
JSON-schema.
Creates a JSON schema on the blockchain. More info about Schema Creation
Verifiable Credential Schema
The schema version, generally following the JSON-schema specification.
http://json-schema.org/draft-07/schema#
Name of the schema.
My Schema
A brief description of the schema.
Truvera Schema Example
Defines the type of schema. Usually 'object'.
object
The properties that define the schema.
{"id":{"type":"string"},"emailAddress":{"type":"string","format":"email"},"alumniOf":{"type":"string"}}
Required fields within the schema.
["emailAddress","alumniOf"]
Specifies whether additional properties outside the defined schema are allowed.
true
POST /schemas HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 311
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "My Schema",
"description": "Truvera Schema Example",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"emailAddress": {
"type": "string",
"format": "email"
},
"alumniOf": {
"type": "string"
}
},
"required": [
"emailAddress",
"alumniOf"
],
"additionalProperties": true
}
{
"id": "2549",
"data": {
"id": "1a678fe6973f34d2a5c016cbff347161b9a595f5cc44a3e15f1eca2a404f294a",
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Truvera Schema Example",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"emailAddress": {
"type": "string",
"format": "email"
},
"alumniOf": {
"type": "string"
}
},
"required": [
"emailAddress",
"alumniOf"
],
"additionalProperties": false
}
}
}
List Schemas
Return a list of all schemas created by the authenticated user.
Parameters
offset
query
integer
false
How many items to offset by for pagination
limit
query
integer
false
How many items to return at one time (max 64)
Get all schemas created by user. More info about List Schemas
How many items to offset by for pagination
0
How many items to return at one time (max 64)
64
Whether to include ecosystems or not
true
GET /schemas HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
[
{
"id": "db0c559035226419b4061d7c725a6d7d8aeebd3acf784fd0d69c9a033f29a8d1",
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Truvera Schema Example",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"emailAddress": {
"type": "string",
"format": "email"
},
"alumniOf": {
"type": "string"
},
"birthDate": {
"type": "string",
"format": "date"
}
},
"required": [
"emailAddress",
"alumniOf"
],
"additionalProperties": false
},
"author": "did:cheqd:testnet:ac2b9027-ec1a-4ee2-aad1-1e316e7d6f59",
"uri": "https://schema.truvera.io/myschema.json"
},
{
"id": "f408d91da3ebab27f2d50150f7cf54ab14099b3ab5f53e2cbf208a90d6adbfd7",
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Truvera Schema Example",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"emailAddress": {
"type": "string",
"format": "email"
},
"alumniOf": {
"type": "string"
},
"birthDate": {
"type": "string",
"format": "date"
}
},
"required": [
"emailAddress",
"alumniOf"
],
"additionalProperties": false
},
"author": "did:cheqd:testnet:ac2b9027-ec1a-4ee2-aad1-1e316e7d6f59",
"uri": "https://schema.truvera.io/myschema.json"
},
{
"id": "37ad6cf1c51a33ba25f50a8f106e2b06f9e1963296c5bfd914c0d71b7bad42e6",
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Truvera Schema Example",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"emailAddress": {
"type": "string",
"format": "email"
},
"alumniOf": {
"type": "string"
},
"birthDate": {
"type": "string",
"format": "date"
}
},
"required": [
"emailAddress",
"alumniOf"
],
"additionalProperties": false
},
"author": "did:cheqd:testnet:ac2b9027-ec1a-4ee2-aad1-1e316e7d6f59",
"uri": "https://schema.truvera.io/myschema.json"
}
]
Get Schema
Reading a Schema from the blockchain can easily be achieved by using the get
method which will return the JSON schema to a specific schema ID. The schemaId
needs to be URL encoded (e.g. /schemas/https%3A%2F%2Fschema.dock.io%2FTestSchema-V1-1695817897561.json
)
Parameters
schemaId
path
String
true
A URL encoded schema id.
Returns the JSON schema for a specific ID. More info about Get Schema By ID
32 byte hex string. Ignoring higher base (base64) for simplicity.
GET /schemas/{schemaId} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
{
"id": "https://schema.truvera.io/ExampleSchema-V5-1722512884923.json",
"schema": null,
"uri": "https://schema.truvera.io/ExampleSchema-V5-1722512884923.json",
"created": "2025-06-30T22:23:22.789Z",
"isOwner": true,
"ownerName": "Truvera",
"ownerLogo": "https://logo.truvera.io/owner"
}
Delete Schema
Deletes a schema from the database
32 byte hex string. Ignoring higher base (base64) for simplicity.
DELETE /schemas/{schemaId} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
{
"id": "2434",
"data": {
"status": "pending"
}
}
Last updated
Was this helpful?