Update or Deactivate DID

Update or deactivate a DID

Users are able to update DID Documents for various reasons, such as to include a new section or to rotate the Verification Method keys within the DID Document.

With the /did/update API, users are able to input either:

  1. The section of the DID Document they would like to update; or

  2. The full updated DID Document body.

Update a DID Document.

This endpoint updates a DID Document. As an input, it can take JUST the sections/parameters that need to be updated in the DID Document (in this scenario, it fetches the current DID Document and applies the updated section). Alternatively, it take the fully-assembled DID Document with updated sections as well as unchanged sections.

post

/did/update

Authorizations
Body
didstring

DID identifier to be updated.

Example: did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0
didDocumentobject

This input field contains either a complete DID document, or an incremental change (diff) to a DID document. See <a href="https://identity.foundation/did-registration/#diddocument">Universal DID Registrar specification</a>.

Example: {"id":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0","@context":["https://www.w3.org/ns/did/v1"],"controller":["did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0"],"authentication":["did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1"],"verificationMethod":[{"id":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1","type":"Ed25519VerificationKey2018","controller":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0","publicKeyBase58":"z6MkkVbyHJLLjdjU5B62DaJ4mkdMdUkttf9UqySSkA9bVTeZ"}],"service":[{"id":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1","type":"LinkedDomains","serviceEndpoint":["https://example.com"]}]}
serviceobject[]

Service section of the DID Document.

verificationMethodobject[]

Verification Method section of the DID Document.

authenticationstring[]

Authentication section of the DID Document.

publicKeyHexsstring[]

List of key references (publicKeys) which will be used for signing the message. The should be in hexadecimal format and placed in the wallet of current user.

Responses
curl -L \
  --request POST \
  --url '/did/update' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data '{"did":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0","didDocument":{"id":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0","@context":["https://www.w3.org/ns/did/v1"],"controller":["did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0"],"authentication":["did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1"],"verificationMethod":[{"id":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1","type":"Ed25519VerificationKey2018","controller":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0","publicKeyBase58":"z6MkkVbyHJLLjdjU5B62DaJ4mkdMdUkttf9UqySSkA9bVTeZ"}],"service":[{"id":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1","type":"LinkedDomains","serviceEndpoint":["https://example.com"]}]},"service":[{"id":"did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1","type":"LinkedDomains","serviceEndpoint":["https://example.com"]}],"verificationMethod":[{"controller":"did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0","id":"did:cheqd:testnet :7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1","publicKeyBase58":"BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt","type":"Ed25519VerificationKey2018"}],"authentication":[null],"publicKeyHexs":[null]}'
{
  "did": "text",
  "controllerKeyId": "text",
  "keys": [
    {}
  ],
  "services": [
    {
      "id": "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1",
      "type": "LinkedDomains",
      "serviceEndpoint": [
        "https://example.com"
      ]
    }
  ],
  "controllerKeyRefs": [
    "text"
  ],
  "controllerKeys": [
    "text"
  ]
}

Users are also able to deactivate DID Documents to prevent further updates and to provide client applications the relevant information that the DID Document is no longer actively used.

A /did/deactivate request must be signed by all of the Verification Method keys listed in the DID Document.

Deactivate a DID Document.

This endpoint deactivates a DID Document by taking the DID identifier as input. Must be called and signed by the DID owner.

post

/did/deactivate/{did}

Authorizations
Path parameters
didstringrequired

DID identifier to deactivate.

Body
publicKeyHexsstring[]

List of key references (publicKeys) which will be used for signing the message. The should be in hexadecimal format and placed in the wallet of current user.

Responses
curl -L \
  --request POST \
  --url '/did/deactivate/{did}' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data '{"publicKeyHexs":[null]}'
{
  "@context": "https://w3id.org/did-resolution/v1",
  "didDidResolutionMetadata": {
    "retrieved": "2021-09-01T12:00:00Z",
    "did": {
      "didString": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47",
      "method": "cheqd",
      "methodSpecificId": "55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"
    },
    "contentType": "application/did+ld+json"
  },
  "didDocument": {
    "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0",
    "@context": [
      "https://www.w3.org/ns/did/v1"
    ],
    "controller": [
      "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0"
    ],
    "authentication": [
      "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1"
    ],
    "verificationMethod": [
      {
        "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1",
        "type": "Ed25519VerificationKey2018",
        "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0",
        "publicKeyBase58": "z6MkkVbyHJLLjdjU5B62DaJ4mkdMdUkttf9UqySSkA9bVTeZ"
      }
    ],
    "service": [
      {
        "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1",
        "type": "LinkedDomains",
        "serviceEndpoint": [
          "https://example.com"
        ]
      }
    ]
  },
  "didDocumentMetadata": {
    "created": "2021-09-01T12:00:00Z",
    "deactivated": true,
    "updated": "2021-09-10T12:00:00Z",
    "versionId": "3ccde6ba-6ba5-56f2-9f4f-8825561a9860",
    "linkedResourceMetadata": [
      {
        "resourceURI": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b",
        "resourceCollectionId": "55dbc8bf-fba3-4117-855c-1e0dc1d3bb47",
        "resourceId": "398cee0a-efac-4643-9f4c-74c48c72a14b",
        "resourceName": "cheqd-issuer-logo",
        "resourceType": "CredentialArtwork",
        "mediaType": "image/png",
        "resourceVersion": "1.0",
        "checksum": "a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559",
        "created": "2021-09-01T12:00:00Z",
        "nextVersionId": "d4829ac7-4566-478c-a408-b44767eddadc",
        "previousVersionId": "ad7a8442-3531-46eb-a024-53953ec6e4ff"
      }
    ]
  }
}

Last updated

Was this helpful?