Decentralized Identifiers (DIDs)

Create a DID Document.

post

This endpoint creates a DID and associated DID Document. As input, it can take the DID Document parameters via a form, or the fully-assembled DID Document itself.

Authorizations
Body
networkstring · enumOptional

Network to create the DID on (testnet or mainnet)

Possible values:
identifierFormatTypestring · enumOptional

Algorithm to use for generating the method-specific ID. The two styles supported are UUIDs and Indy-style Base58. See cheqd DID method documentation for more details.

Possible values:
verificationMethodTypestring · enumOptional

Type of verification method to use for the DID. See DID Core specification for more details. Only the types listed below are supported.

Possible values:
keystringOptional

The unique identifier in hexadecimal public key format used in the verification method to create the DID.

@contextstring[]OptionalExample: ["https://www.w3.org/ns/did/v1"]
Responses
200

The request was successful.

application/json
post
POST /did/create HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 266

"network='testnet'&identifierFormatType='uuid'&verificationMethodType='Ed25519VerificationKey2018'&service=[{'idFragment':'service-1','type':'LinkedDomains','serviceEndpoint':['https://example.com']}]&key='text'&@context=['https://www.w3.org/ns/did/v1']"
{
  "did": "text",
  "controllerKeyId": "text",
  "keys": [
    {}
  ],
  "services": [
    {
      "id": "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1",
      "type": "LinkedDomains",
      "serviceEndpoint": [
        "https://example.com"
      ],
      "priority": 0,
      "recipientKeys": [
        "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1"
      ],
      "routingKeys": [
        "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-2"
      ],
      "accept": [
        "didcomm/aip2;env=rfc587"
      ]
    }
  ]
}

Update a DID Document.

post

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.

Authorizations
Body
didstringOptional

DID identifier to be updated.

Example: did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0
authenticationstring[]Optional

Authentication section of the DID Document.

publicKeyHexsstring[]Optional

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
200

The request was successful.

application/json
post
POST /did/update HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 1436

"did='did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0'&service=[{'id':'did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1','type':'LinkedDomains','serviceEndpoint':['https://example.com'],'priority':0,'recipientKeys':['did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1'],'routingKeys':['did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-2'],'accept':['didcomm/aip2;env=rfc587']}]&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=['text']&publicKeyHexs=['text']&didDocument={'@context':['https://www.w3.org/ns/did/v1'],'id':'did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0','controller':['did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0'],'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'}],'authentication':['did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1'],'service':[{'id':'did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1','type':'LinkedDomains','serviceEndpoint':['https://example.com']}]}"
{
  "did": "text",
  "controllerKeyId": "text",
  "keys": [
    {}
  ],
  "services": [
    {
      "id": "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1",
      "type": "LinkedDomains",
      "serviceEndpoint": [
        "https://example.com"
      ],
      "priority": 0,
      "recipientKeys": [
        "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1"
      ],
      "routingKeys": [
        "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-2"
      ],
      "accept": [
        "didcomm/aip2;env=rfc587"
      ]
    }
  ],
  "controllerKeyRefs": [
    "text"
  ],
  "controllerKeys": [
    "text"
  ]
}

Import a DID Document.

post

This endpoint imports a decentralized identifier associated with the user's account for custodian-mode clients.

Authorizations
Body
didstring · uriRequired

DID to be imported

Responses
200

The request was successful.

application/json
post
POST /did/import HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 95

"did='https://example.com'&keys=[{'alias':'text','type':'Ed25519','privateKeyHex':'text'}]"
{
  "did": "text",
  "controllerKeyId": "text",
  "keys": [
    {}
  ],
  "services": [
    {
      "id": "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1",
      "type": "LinkedDomains",
      "serviceEndpoint": [
        "https://example.com"
      ],
      "priority": 0,
      "recipientKeys": [
        "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1"
      ],
      "routingKeys": [
        "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-2"
      ],
      "accept": [
        "didcomm/aip2;env=rfc587"
      ]
    }
  ]
}

Deactivate a DID Document.

post

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

Authorizations
Path parameters
didstringRequired

DID identifier to deactivate.

Body
publicKeyHexsstring[]Optional

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
200

The request was successful.

application/json
post
POST /did/deactivate/{did} HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 26

"publicKeyHexs=['text']"
{
  "@context": "https://w3id.org/did-resolution/v1",
  "didDidResolutionMetadata": {
    "contentType": "application/did+ld+json",
    "retrieved": "2021-09-01T12:00:00Z",
    "did": {
      "didString": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47",
      "method": "cheqd",
      "methodSpecificId": "55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"
    }
  },
  "didDocument": {
    "@context": [
      "https://www.w3.org/ns/did/v1"
    ],
    "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0",
    "controller": [
      "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0"
    ],
    "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"
      }
    ],
    "authentication": [
      "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1"
    ],
    "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"
      }
    ]
  }
}

Fetch DIDs associated with an account.

get

This endpoint returns the list of DIDs controlled by the account.

Authorizations
Query parameters
networkstring · enumOptional

Filter DID by the network published.

Possible values:
createdAtstring · dateOptional

Filter resource by created date

pagenumberOptional

Page number.

limitnumberOptional

Number of items to be listed in a single page.

Responses
200

The request was successful.

application/json
get
GET /did/list HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Accept: */*
{
  "total": 1,
  "dids": [
    "text"
  ]
}

Resolve a DID Document.

get

Resolve a DID Document by DID identifier. Also supports DID Resolution Queries as defined in the W3C DID Resolution specification.

Authorizations
Path parameters
didstringRequired

DID identifier to resolve.

Example: did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0
Query parameters
metadatabooleanOptional

Return only metadata of DID Document instead of actual DID Document.

versionIdstring · uuidOptional

Unique UUID version identifier of DID Document. Allows for fetching a specific version of the DID Document. See cheqd DID Method Specification for more details.

Example: 3ccde6ba-6ba5-56f2-9f4f-8825561a9860
versionTimestring · date-timeOptional

Returns the closest version of the DID Document at or before specified time. See DID Resolution handling for did:cheqd for more details.

Example: 1970-01-01T00:00:00Z
transformKeysstring · enumOptional

This directive transforms the Verification Method key format from the version in the DID Document to the specified format chosen below.

Possible values:
servicestringOptional

Query DID Document for a specific Service Endpoint by Service ID (e.g., service-1 in did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1). This will typically redirect to the Service Endpoint based on DID Resolution specification algorithm.

Example: service-1
relativeRefstringOptional

Relative reference is a query fragment appended to the Service Endpoint URL. Must be used along with the service query property above. See DID Resolution specification algorithm for more details.

Example: /path/to/file
Responses
200

The request was successful.

application/json
get
GET /did/search/{did} HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Accept: */*
{
  "@context": "https://w3id.org/did-resolution/v1",
  "didDidResolutionMetadata": {
    "contentType": "application/did+ld+json",
    "retrieved": "2021-09-01T12:00:00Z",
    "did": {
      "didString": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47",
      "method": "cheqd",
      "methodSpecificId": "55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"
    }
  },
  "didDocument": {
    "@context": [
      "https://www.w3.org/ns/did/v1"
    ],
    "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0",
    "controller": [
      "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0"
    ],
    "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"
      }
    ],
    "authentication": [
      "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1"
    ],
    "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": false,
    "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"
      }
    ]
  }
}

Was this helpful?