POST /dids
Create a new Decentralized Identifier (DID).
{{baseUrl}}/dids
Headers
Header | Type | Description |
---|---|---|
x-api-key | string | The API key required for authentication. |
Request Body
Parameter | Type | Description |
---|---|---|
method | string | The DID method to use (e.g., earthid , key ). |
publicKey | string | The public key associated with the new DID. |
Sample Request Body:
{
"method": "earthid",
"publicKey": "04acff8a2a20e9ed2443a45a84319b7f39948b5ca058b1b783f1afef518eb9a1d23db646cef5019a4a36b77ab3d1e524b295cb49c4f5d7db3ea936d76dcb65855d"
}
Click Send
and wait for the response.
Response (Success - 201)
Parameter | Type | Description |
---|---|---|
did | string | The generated DID, formatted as did:method:id . |
Sample Response Body:
{
"did": "did:earthid:testnet:CqfgWPDd67TBe3wieHhhD9y9M6AderRRJnozU12DdP2t:0.0.5021687"
}
Response (Validation Error - 400)
Parameter | Type | Description |
---|---|---|
error | string | Describes the validation error. |
Sample Response Body:
{ "error": "Invalid public key or DID method." }