Use this file to discover all available pages before exploring further.
In the realm of Verifiable Credentials, each credential must be associated with a schema. The credential’s schema is referred to as “type”.Credential types outline the attributes and their respective data types that the credential contains. The purpose of types is to ensure the credential’s authenticity. Types allow you to specify the attributes you are interested in certifying and act as a protective measure, preventing the addition of unauthorized attributes and, as a result, the tampering of the Verifiable Credential.It’s important to note that all credentials within a single template will share the same type. Trying to issue or verify a credential with different field names or types will result in an error.By adhering to this structure, we maintain the integrity and verifiability of the credentials, ensuring they serve their purpose effectively.
Credentials play a crucial role in verifying and validating various aspects of identity, achievement, and authorization. Below are some examples of credential types you can create and manage through Crossmint:
Purpose: Issued to students upon the successful completion of a course. The certificate may indicate that the student has mastered a specific skill or knowledge.
If you want to use this example type in your credential template definition, you can reference it as crossmint:bfb292e7-2700-4924-9213-478f3d71f2d8:CourseCompletionCertificate.
Purpose: Provided to individuals who are members of a specific organization or club. The certificate may grant access to exclusive resources and events.
If you want to use this example type in your credential template definition, you can reference it as crossmint:bfb292e7-2700-4924-9213-478f3d71f2d8:Membership.
If you want to use this example type in your credential template definition, you can reference it as crossmint:bfb292e7-2700-4924-9213-478f3d71f2d8:EventParticipation.
This example creates a custom type, CourseCompletionCertificate, for a credential that represents a course completion. The credential will contain two fields: course and passed.
The type id defined will be used when you create your credential template.You can also utilize the POST /credentials/types/ endpoint to generate a random uuid for the new credential type.
For internal use within Crossmint, reference the type using id. The $id will be included as the credentials
schema by Crossmint but should not be used to reference the type in Crossmint APIs.
Example of a credentials using the type "crossmint:bfb292e7-2700-4924-9213-478f3d71f2d8:CourseCompletionCertificate" just created.
In the realm of Verifiable Credentials, types are defined using the JSON schema. For more details, refer to the W3C VC JSON Schema.
When calling the create type API an invalid JSON schema will result in an error.
The credential subject is the section that needs to be defined. Any field or nested field can be added, as long as it is valid JSON schema.
The credentialSubject.properties.id will be automatically added with the type “string”, this is used to specify the wallet and therefore the identity of the subject.
additionalProperties should always be set to false to prevent unauthorized fields from being added.
All specified fields should be marked as required unless they are optional. This ensures that missing fields will trigger an error during schema validation.
additionalProperties and required apply only at the level they are specified. For nested objects, these need to be repeated.
credentialSubject.properties.id will not be added for imported schemas. If the original schema does not include this specification, the resulting credentials will not include the user wallet in the subject.id. To know the subject of a credential, checking the NFT owner will be necessary.
To follow along and test the API calls use a tool like Postman or our API
playground.