DID Document Management
The API lets you generate or import DIDs, list them, and serve did:web documents.
Endpoints
POST
/did/generateBody:
{ "methods": ["empe", "empe-testnet", "web"] }Generates DID documents for the selected methods and persists them for the authenticated user.
POST
/did/importBody:
{ "methods": [...], "mnemonics": "<12+ words>" }Restores/creates DID documents for the selected methods from a mnemonic phrase.
GET
/didsReturns all DID documents for the authenticated user (across supported methods).
GET
/dids/:methodReturns the DID document for a specific method.
:methodis one ofempe,empe-testnet,web.
GET
/did/user/:id/did.json(public)Serves the canonical
did.jsonfor did:web. See “did:web & Hosting”.
Examples
Generate DIDs for testnet and web:
curl -X POST http://localhost:3000/did/generate \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"methods":["empe-testnet","web"]}'Import from mnemonics:
curl -X POST http://localhost:3000/did/import \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"methods":["empe"],"mnemonics":"abandon ability ..."}'List all documents:
curl -H 'Authorization: Bearer <token>' http://localhost:3000/didsGet a single document:
curl -H 'Authorization: Bearer <token>' http://localhost:3000/dids/webPublic did:web document (no auth):
curl http://localhost:3000/did/user/<userId>/did.jsonNotes
did:web creation uses
DID_WEB_DOMAIN, optionalDID_WEB_JSON_PATH, and optionalDID_WEB_PORTfrom the environment.userIdis taken from the JWTsuband is used when constructing did:web paths.Methods map:
empe→ mainnetempe-testnet→ testnetweb→ did:web
Last updated