PUT /vc-templates/:templateId
Update an existing Verifiable Credential Template.
{{baseUrl}}/vc-templates/:templateId
Headers
Header | Type | Description |
---|---|---|
x-api-key | string | The API key required for authentication. |
Path Parameters
Parameter | Type | Description |
---|---|---|
templateId | string | The name of the Verifiable Credential template. |
templateId: a56542f5-31df-41f9-bf24-c4fffc3eff7b
Request Body
Parameter | Type | Description |
---|---|---|
templateName | string | The name of the Verifiable Credential Template. |
description | string | A description of the template. |
issuer | string | The DID of the issuer authorized to issue credentials. |
attributes | array | An array of attributes for the credential subject. |
expiration | object | Expiration details, including value and unit. |
attributeName | string | The name of the attribute (e.g., "degree"). |
type | string | The data type of the attribute (e.g., "string"). |
description | string | A description of the attribute (e.g., "Degree Name"). |
value | integer | Expiration period (e.g., 5 years). |
unit | string | Unit 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)
Parameter | Type | Description |
---|---|---|
_id | string | The unique identifier of the Verifiable Credential. |
templateId | string | The unique ID of the Verifiable Credential template. |
name | string | The name of the template. |
description | string | A brief description of the template. |
context | array | The context URLs defining the credential's structure. |
type | array | The type of Verifiable Credential. |
issuer | string | The DID of the issuer. |
issuanceDate | string | The issuance date of the credential. |
expirationDate | string | The expiration date of the credential. |
credentialSubject | array | The subject details for the credential. |
__v | number | Version 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)
Parameter | Type | Description |
---|---|---|
error | string | Describes the error that occurred. |
Sample Response Body:
{
"error": "Server error"
}