Credential Schemas
Last updated
Was this helpful?
Last updated
Was this helpful?
Credential schemas are used to define the structure of the claims of a verifiable credential (VC) and are associated with the property of a credential. Schemas use the specification, published by the W3C Credentials Working Group.
Using schemas in the credential workflow allows Tenants, Organisations and users to:
Agree on the structure of data and facilitate data exchange
Extract information from the schema
It is possible to create a credential without specifying a schema via the API, however, when using Meeco's Enterprise Portal to create credentials, this step is mandatory. In the Enterprise Portal, a user is required to upload a schema file which is then visually displayed as a form.
A credential schema, once published, is versioned and made available via a public URL. This allows anyone to validate it at any point in time.
Verifiable Credential JSON Schema
Each VC JSON Schema consists of the following mandatory attributes:
Name - A locally unique identifier to address the VC schema.
JSON Schema – Object that describes the schema the credential is validated against.
are plain JSON objects that cosist of following mandatory attributes (at the top level):
$schema
- The schema specification used (e.g. https://json-schema.org/draft/2019-09/schema
)
required
– Array of required properties. Array MUST include id
.
additionalProperties
– MUST be false
type
– MUST be object
Below is an example JSON schema. Note that all the attributes contained within a JSON schema will be used to form a credential. Attributes can be customised, and those that appear in the example below are indicative of possible options.
Note that the $id
property of the JSON Schema is set by the platform. When one is present in the schema, it will be overridden.
Also note that https://json-schema.org/draft/2020-12/schema
is not supported at this point in time.
Credential schemas are created and managed by Tenant Administrators who can assign them to Organisations.
An Organisation can list the credential schemas that are assigned to them.
Anyone can read the JSON schema (via a separate endpoint) that is part of the credential schema object.
Creation of a credential schema.
Endpoint
Request
Name – Name of the credential schema
JSON Schema - JSON schema file
List of organisations - Organisations where this credential schema can be used (optional)
Response
The response received is a credential schema object. Upon creation, version 1.0
is assigned.
Retrieve a list of credential schemas.
Endpoint
Request
Organisation (header)
Response
A list of credential schema objects available to the user.
In the context of an Organisation, the organization_ids
attribute contains only one item: caller organisation ID.
Update an existing credential schema by ID.
Note that in this version, the schema cannot be updated.
Endpoint:
Request
The ID of the credential schema
Name – Name of the credential schema
List of organisations - Organisations where this credential schema can be used (optional)
Response
The updated credential schema object.
A public endpoint that returns the JSON schema file. No authentication necessary.
Endpoint
Request
Id – ID of the Credential Schema
Version – Version of the credential schema
Response
Returns JSON schema for a credential schema.