Schema Management

Credential schemas define the structure and required fields for credentials, ensuring consistency and interoperability.

Endpoints:

  • Create Schema:

    POST /api/v1/schemas
    x-client-secret: [Client Secret]
    Content-Type: application/json
  • Get All Schemas:

    GET /api/v1/schemas
  • Get Schema by ID:

    GET /api/v1/schemas/{id}
  • Delete Schema:

    DELETE /api/v1/schemas/{id}
    x-client-secret: [Client Secret]

Create Schema Example Request:

{
  "name": "ProofOfPurchase",
  "type": "ProofOfPurchase",
  "credentialSubject": {
    "type": "object",
    "properties": {
      "ticket": {"type": "string", "title": "Ticket"},
      "seat": {"type": "string", "title": "Seat"},
      "description": {"type": "string", "title": "Description"}
    },
    "required": ["ticket", "seat", "description"]
  }
}

Example Response:

Get All Schemas Example Response:

Versioning: If a schema with the same type is created more than once, the version increments automatically, allowing evolution without invalidating previously issued credentials.

Security: Only authorized clients (with x-client-secret) can create or delete schemas, ensuring integrity and trustworthiness of credential definitions.

Last updated