Skip to main content

Overview

A credential template defines the schema for a verifiable credential — it specifies what attributes the credential will contain. Templates are reusable, so you create them once and use them to issue many credentials with different data.
The type field you set in a credential template is later used by verifiers in the credential presentation flow.

Endpoint

POST https://test.didxtech.com/me-creds/api/templates/credentials

Request

curl -X POST "https://test.didxtech.com/me-creds/api/templates/credentials" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "University Student Card",
    "description": "Digital student identification card for university students",
    "type": "UniversityCard",
    "attributes": {
      "studentId": {
        "type": "string",
        "name": "Student ID",
        "description": "Unique student identification number",
        "required": true,
        "alwaysDisclosed": false
      },
      "fullName": {
        "type": "string",
        "name": "Full Name",
        "description": "Student'\''s full legal name",
        "required": true,
        "alwaysDisclosed": true
      },
      "enrollmentDate": {
        "type": "string",
        "name": "Enrollment Date",
        "description": "Date when student enrolled",
        "required": true,
        "alwaysDisclosed": false
      },
      "degreeProgram": {
        "type": "string",
        "name": "Degree Program",
        "description": "Academic program of study",
        "required": true,
        "alwaysDisclosed": false
      }
    }
  }'

Attribute Fields

Each attribute in the template acts like a form field. The following properties configure each one:
FieldTypeDescription
typestringData type (string, date, etc.)
namestringHuman-readable label for the attribute
descriptionstringDescription of the attribute
requiredbooleanWhether this attribute must be present
alwaysDisclosedbooleanIf true, this attribute is always shared when the credential is presented

Response

HTTP 201 Created
{
  "data": {
    "id": "tpl_6421a8905c17830c188e2e2f",
    "name": "University Student Card",
    "description": "Digital student identification card for university students",
    "type": "https://metadata.paradym.id/types/university-card-v1",
    "format": "sd-jwt-vc",
    "attributes": {
      "studentId": {
        "type": "string",
        "name": "Student ID",
        "description": "Unique student identification number",
        "required": true,
        "alwaysDisclosed": false
      },
      "fullName": {
        "type": "string",
        "name": "Full Name",
        "description": "Student's full legal name",
        "required": true,
        "alwaysDisclosed": true
      },
      "enrollmentDate": {
        "type": "date",
        "name": "Enrollment Date",
        "description": "Date when student enrolled",
        "required": true,
        "alwaysDisclosed": false
      },
      "degreeProgram": {
        "type": "string",
        "name": "Degree Program",
        "description": "Academic program of study",
        "required": true,
        "alwaysDisclosed": false
      }
    },
    "createdAt": "2025-01-20T11:27:37.051Z",
    "updatedAt": "2025-01-20T11:27:37.051Z",
    "archivedAt": null,
    "status": "active"
  },
  "links": {
    "self": "https://test.didxtech.com/me-creds/api/templates/credentials/tpl_6421a8905c17830c188e2e2f",
    "issuances": "https://test.didxtech.com/me-creds/api/templates/credentials/tpl_6421a8905c17830c188e2e2f/issuances"
  },
  "meta": {
    "version": "1.0",
    "totalAttributes": 4
  }
}

Key Response Fields

FieldDescription
idUnique template identifier — save this for use in Step 3
typeA URI identifying the credential category, used by verifiers during presentation
formatsd-jwt-vc — enables selective disclosure of attributes
statusactive once the template is ready for use
Save the id from the response — you’ll need it as the credentialTemplateId in Step 3: Issue a Credential.