DID Document Management

The API lets you generate or import DIDs, list them, and serve did:web documents.

Endpoints

  • POST /did/generate

    • Body: { "methods": ["empe", "empe-testnet", "web"] }

    • Generates DID documents for the selected methods and persists them for the authenticated user.

  • POST /did/import

    • Body: { "methods": [...], "mnemonics": "<12+ words>" }

    • Restores/creates DID documents for the selected methods from a mnemonic phrase.

  • GET /dids

    • Returns all DID documents for the authenticated user (across supported methods).

  • GET /dids/:method

    • Returns the DID document for a specific method. :method is one of empe, empe-testnet, web.

  • GET /did/user/:id/did.json (public)

    • Serves the canonical did.json for did:web. See “did:web & Hosting”.

Examples

Generate DIDs for testnet and web:

Import from mnemonics:

List all documents:

Get a single document:

Public did:web document (no auth):

Notes

  • did:web creation uses DID_WEB_DOMAIN, optional DID_WEB_JSON_PATH, and optional DID_WEB_PORT from the environment.

  • userId is taken from the JWT sub and is used when constructing did:web paths.

  • Methods map:

    • empe → mainnet

    • empe-testnet → testnet

    • web → did:web

Last updated