Skip to content

Latest commit

 

History

History
52 lines (28 loc) · 3.41 KB

File metadata and controls

52 lines (28 loc) · 3.41 KB

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

NameInTypeRequiredDescription
bodybodyobjecttrueJSON-schema.

{% openapi src="https://swagger-api.truvera.io/openapi.yaml" path="/schemas" method="post" %} https://swagger-api.truvera.io/openapi.yaml {% endopenapi %}

List schemas

Return a list of all schemas created by the authenticated user.

Parameters

NameInTypeRequiredDescription
offsetqueryintegerfalseHow many items to offset by for pagination
limitqueryintegerfalseHow many items to return at one time (max 64)

{% openapi src="https://swagger-api.truvera.io/openapi.yaml" path="/schemas" method="get" %} https://swagger-api.truvera.io/openapi.yaml {% endopenapi %}

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 schemaIdneeds to be URL encoded (e.g. /schemas/https%3A%2F%2Fschema.dock.io%2FTestSchema-V1-1695817897561.json)

Parameters

NameInTypeRequiredDescription
schemaIdpathStringtrueA URL encoded schema id.

{% openapi src="https://swagger-api.truvera.io/openapi.yaml" path="/schemas/{schemaId}" method="get" %} https://swagger-api.truvera.io/openapi.yaml {% endopenapi %}

Delete schema

{% openapi src="https://swagger-api.truvera.io/openapi.yaml" path="/schemas/{schemaId}" method="delete" %} https://swagger-api.truvera.io/openapi.yaml {% endopenapi %}