v1

latestOpenAPI 3.0.12026-07-2699111970.1 KB
Verifiable Credentials

Create Credential Type with Name

Create or import a type with a given name. This is how you define a custom credential schema.

API scope required credentials.create

put/v1-alpha1/credentials/types/{typeName}

Path parameters

typeNamestring required

The name of the type.

Request body

OR

Example request

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Course completion",
  "description": "Describes the course completed and the assigned grade",
  "type": "object",
  "properties": {
    "credentialSubject": {
      "type": "object",
      "properties": {
        "course": {
          "type": "string"
        },
        "grade": {
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "course",
        "grade"
      ],
      "additionalProperties": false
    }
  }
}

Response

Success.

idstring

Example response

{
  "id": "crossmint:bfb292e7-2700-4924-9213-478f3d71f2d8:CourseCompletionCertificate",
  "typeSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "Course completion",
    "description": "Describes the course completed and the assigned grade",
    "type": "object",
    "properties": {
      "credentialSubject": {
        "type": "object",
        "properties": {
          "course": {
            "type": "string"
          },
          "grade": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "course",
          "grade"
        ],
        "additionalProperties": false
      }
    },
    "$id": "https://staging.crossmint.com/api/v1-alpha1/credentials/types/crossmint:bfb292e7-2700-4924-9213-478f3d71f2d8:CourseCompletionCertificate"
  }
}