Skip to main content

POST /issuer/createSchema

Create a Schema for Verifiable Credentials.

{{baseUrl}}/issuer/createSchema

Headers:

X-API-Key: {{apiKey}}

Sample Request Body:

{
"schemaName": "NewMemberType",
"description": "Membership Document for GBA Credential",
"attributes": {
"attributes": [
{
"attributeName": "userName",
"type": "alphanumeric",
"description": "Username of the user",
"required": true,
"maxLength": "12"
},
{
"attributeName": "firstName",
"type": "alphabet",
"description": "First name of the user",
"required": true,
"maxLength": "12"
},
{
"attributeName": "lastName",
"type": "alphabet",
"description": "Last name of the user",
"required": true,
"maxLength": "12"
},
{
"attributeName": "email",
"type": "email",
"description": "Email of the user",
"required": true
},
{
"attributeName": "membershipType",
"type": "alphabet",
"description": "Membership Type of the user",
"required": true
},
{
"attributeName": "salary",
"type": "number",
"description": "Salary of the user",
"required": true
},
{
"attributeName": "dateOfBirth",
"type": "date",
"description": "Date of Birth of the user",
"required": true
}
]
},
"expiration": {
"value": 1,
"unit": "years"
},
"dependantSchemas": [
"MembershipType"
]
}

Click Send and wait for the response.

Sample Response Body:

{
"success": true,
"data": {
"name": "NewMemberType",
"message": {
"operation": "create",
"versionContol": "NewMemberType:1",
"schemaDocumentBase64": "eyIkc2NoZW1hIjoiaHR0cDovL2pzb24tc2NoZW1hLm9yZy9kcmFmdC0wNC9zY2hlbWEjIiwidGl0bGUiOiJOZXdNZW1iZXJUeXBlIiwiZGVzY3JpcHRpb24iOiJNZW1iZXJzaGlwIERvY3VtZW50IGZvciBHQkEgQ3JlZGVudGlhbCIsInR5cGUiOiJvYmplY3QiLCJwcm9wZXJ0aWVzIjp7InVzZXJOYW1lIjp7InR5cGUiOiJzdHJpbmciLCJkZXNjcmlwdGlvbiI6IlVzZXJuYW1lIG9mIHRoZSB1c2VyIiwibWF4TGVuZ3RoIjoiMTIifSwiZmlyc3ROYW1lIjp7InR5cGUiOiJzdHJpbmciLCJwYXR0ZXJuIjoiW2EtekEtWl0rJCIsImRlc2NyaXB0aW9uIjoiRmlyc3QgbmFtZSBvZi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