Credential Management
Wallet Server stores Verifiable Credentials (VCs) per user. You can import, list, fetch, and delete credentials.
Endpoints
POST
/credentialsImports a credential JSON. Validates schema, proof, and (by default) that the subject matches the holder DID.
Body:
credential: VC JSONallowForeignSubject(boolean, defaultfalse): iftrue, skip subject‑equals‑holder check
GET
/credentialsReturns
{ count, credentials }with optional filters:network:mainnet|testnet(derived from VC id DID)type: VC typestatus: W3C StatusPurposeissuedAt: ISO dateversion: 1 | 2
GET
/credentials/:idReturns a specific credential by id.
DELETE
/credentialsDeletes all credentials for the authenticated user.
DELETE
/credentials/:idDeletes a specific credential by id.
Examples
Import a credential:
curl -X POST http://localhost:3000/credentials \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"credential": { ... }, "allowForeignSubject": false}'List testnet credentials of a given type:
curl -H 'Authorization: Bearer <token>' \
'http://localhost:3000/credentials?network=testnet&type=UniversityDegreeCredential'Fetch by id:
curl -H 'Authorization: Bearer <token>' http://localhost:3000/credentials/<vc-id>Delete all:
curl -X DELETE -H 'Authorization: Bearer <token>' http://localhost:3000/credentialsDelete by id:
curl -X DELETE -H 'Authorization: Bearer <token>' http://localhost:3000/credentials/<vc-id>Validation Rules (high level)
Credential must have a recipient (holder)
Unless
allowForeignSubject=true,credentialSubject.idmust equal holder DIDCredential must have a
credentialSchemaProof verification and schema validation must pass
Last updated