Skip to main content

PUT /vc-templates/:templateId

Update an existing Verifiable Credential Template.

{{baseUrl}}/vc-templates/:templateId

Headers

HeaderTypeDescription
x-api-keystringThe API key required for authentication.

Path Parameters

ParameterTypeDescription
templateIdstringThe name of the Verifiable Credential template.
templateId: a56542f5-31df-41f9-bf24-c4fffc3eff7b

Request Body

ParameterTypeDescription
templateNamestringThe name of the Verifiable Credential Template.
descriptionstringA description of the template.
issuerstringThe DID of the issuer authorized to issue credentials.
attributesarrayAn array of attributes for the credential subject.
expirationobjectExpiration details, including value and unit.
attributeNamestringThe name of the attribute (e.g., "degree").
typestringThe data type of the attribute (e.g., "string").
descriptionstringA description of the attribute (e.g., "Degree Name").
valueintegerExpiration period (e.g., 5 years).
unitstringUnit of time for expiration (e.g., "years").

Sample Request Body:

{
"templateName": "DegreeSample",
"description": "Schema for marriage certificate template",
"issuer": "did:earthid:testnet:7QFmnthxqyJVmdBC8WbMtVrfEfenMbVAw3JWYC4kmkYu",
"attributes": [
{
"attributeName": "degreeName",
"type": "string",
"description": "Degree Name"
},
{
"attributeName": "dateOfBirth",
"type": "string",
"description": "Date of Birth"
},
{
"attributeName": "city",
"type": "string",
"description": "City of University"
}
],
"expiration": {
"value": 5,
"unit": "years"
}
}

Click Send and wait for the response.

Response (Success - 200)

ParameterTypeDescription
_idstringThe unique identifier of the Verifiable Credential.
templateIdstringThe unique ID of the Verifiable Credential template.
namestringThe name of the template.
descriptionstringA brief description of the template.
contextarrayThe context URLs defining the credential's structure.
typearrayThe type of Verifiable Credential.
issuerstringThe DID of the issuer.
issuanceDatestringThe issuance date of the credential.
expirationDatestringThe expiration date of the credential.
credentialSubjectarrayThe subject details for the credential.
__vnumberVersion key for internal tracking.

Sample Response Body:

{
"_id": "67135af410ac412819206661",
"templateId": "a56542f5-31df-41f9-bf24-c4fffc3eff7b",
"name": "DegreeSample",
"description": "Schema for marriage certificate template",
"context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiableCredential",
"DegreeSample"
],
"issuer": "did:earthid:testnet:7QFmnthxqyJVmdBC8WbMtVrfEfenMbVAw3JWYC4kmkYu",
"issuanceDate": "2024-10-19T07:19:17.503Z",
"expirationDate": "2029-10-19T07:19:17.503Z",
"credentialSubject": [
{
"attributeName": "degreeName",
"type": "string",
"description": "Degree Name"
},
{
"attributeName": "dateOfBirth",
"type": "string",
"description": "Date of Birth"
},
{
"attributeName": "city",
"type": "string",
"description": "City of University"
}
],
"__v": 0
}

Response (Server Error - 500)

ParameterTypeDescription
errorstringDescribes the error that occurred.

Sample Response Body:

{
"error": "Server error"
}