Skip to main content

POST /dids

Create a new Decentralized Identifier (DID).

{{baseUrl}}/dids

Headers

HeaderTypeDescription
x-api-keystringThe API key required for authentication.

Request Body

ParameterTypeDescription
methodstringThe DID method to use (e.g., earthid, key).
publicKeystringThe public key associated with the new DID.

Sample Request Body:

{
"method": "earthid",
"publicKey": "04acff8a2a20e9ed2443a45a84319b7f39948b5ca058b1b783f1afef518eb9a1d23db646cef5019a4a36b77ab3d1e524b295cb49c4f5d7db3ea936d76dcb65855d"
}

Click Send and wait for the response.

Response (Success - 201)

ParameterTypeDescription
didstringThe generated DID, formatted as did:method:id.

Sample Response Body:

{
"did": "did:earthid:testnet:CqfgWPDd67TBe3wieHhhD9y9M6AderRRJnozU12DdP2t:0.0.5021687"
}

Response (Validation Error - 400)

ParameterTypeDescription
errorstringDescribes the validation error.

Sample Response Body:

{ "error": "Invalid public key or DID method." }