# Resolve a DID

**Resolving a DID** means retrieving the associated **DID Document**, which contains the public keys, service endpoints, and metadata that describe and verify the identity. In decentralized identity systems, DID resolution is the foundation for:

* Verifying the **authenticity** of a DID
* Retrieving **public keys** for signature validation
* Accessing **service endpoints** (e.g. credential issuance APIs)
* Dereferencing to **DID-Linked Resources (DLRs)**, such as status lists or trust registries.

A user is able to input a **DID (string)** as a request format and resolve the DID to fetch the associated **DID Document**, **DID Resolution Metadata** and **DID Document metadata**.

## Resolve a DID Document.

> Resolve a DID Document by DID identifier. Also supports DID Resolution Queries as defined in the \<a href="[https://w3c-ccg.github.io/did-resolution/">W3C](https://w3c-ccg.github.io/did-resolution/">W3C) DID Resolution specification\</a>.

```json
{"openapi":"3.0.0","info":{"title":"cheqd Studio API for cheqd network","version":"2.0.0"},"tags":[{"name":"Decentralized Identifiers (DIDs)"}],"servers":[{"url":"https://studio-api.cheqd.net","description":"Main (production) server"},{"url":"https://studio-api-staging.cheqd.net","description":"Staging server for testing"},{"url":"http://localhost:3000","description":"Local server for testing"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"x-api-key","in":"header"}},"schemas":{"DidResolution":{"type":"object","properties":{"@context":{"type":"string"},"didDidResolutionMetadata":{"$ref":"#/components/schemas/DidResolutionMetadata"},"didDocument":{"$ref":"#/components/schemas/DidDocument"},"didDocumentMetadata":{"$ref":"#/components/schemas/DidDocumentMetadata"}}},"DidResolutionMetadata":{"type":"object","properties":{"contentType":{"allOf":[{"$ref":"#/components/schemas/ContentType"}]},"retrieved":{"type":"string"},"did":{"$ref":"#/components/schemas/DidProperties"}}},"ContentType":{"type":"string","enum":["application/did+json","application/did+ld+json","application/ld+json","application/json"]},"DidProperties":{"type":"object","properties":{"didString":{"type":"string"},"method":{"type":"string"},"methodSpecificId":{"type":"string"}}},"DidDocument":{"description":"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>.","type":"object","properties":{"@context":{"type":"array","items":{"type":"string"}},"id":{"type":"string"},"controllers":{"type":"array","items":{"type":"string"}},"verificationMethod":{"type":"array","items":{"$ref":"#/components/schemas/VerificationMethod"}},"service":{"type":"array","items":{"$ref":"#/components/schemas/Service"}},"authentication":{"type":"array","items":{"type":"string"}},"assertionMethod":{"type":"array","items":{"type":"string"}},"capabilityInvocation":{"type":"array","items":{"type":"string"}},"capabilityDelegation":{"type":"array","items":{"type":"string"}},"keyAgreement":{"type":"array","items":{"type":"string"}}}},"VerificationMethod":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"controller":{"type":"string"},"publicKeyMultibase":{"type":"string"},"publicKeyJwk":{"type":"array","items":{"type":"string"}}}},"Service":{"description":"Communicating or interacting with the DID subject or associated entities via one or more service endpoints. See <a href=\"https://www.w3.org/TR/did-core/#services\">DID Core specification</a> for more details.","type":"object","properties":{"id":{"description":"DID appended with Service fragment ID (e.g., `#service-1` in `did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1`)","type":"string"},"type":{"description":"Service type as defined in <a href=\"https://www.w3.org/TR/did-spec-registries/#service-types\">DID Specification Registries</a>.","type":"string"},"serviceEndpoint":{"description":"Service endpoint as defined in <a href=\"https://www.w3.org/TR/did-core/#services\">DID Core Specification</a>.","type":"array","items":{"type":"string"}},"priority":{"description":"(Optional) Priority of the service endpoint, used for distinction when multiple did-communication service endpoints are present in a single DID document.","type":"integer"},"recipientKeys":{"description":"(Optional) List of recipient keys used to denote the default recipients of an endpoint.","type":"array","items":{"type":"string"}},"routingKeys":{"description":"(Optional) List of routing keys used to used to denote the individual routing hops in between the sender and recipients.","type":"array","items":{"type":"string"}},"accept":{"description":"(Optional) List of media types that the service endpoint accepts.","type":"array","items":{"type":"string"}}}},"DidDocumentMetadata":{"type":"object","properties":{"created":{"type":"string"},"deactivated":{"type":"boolean"},"updated":{"type":"string"},"versionId":{"type":"string"},"linkedResourceMetadata":{"type":"array","items":{"$ref":"#/components/schemas/ResourceMetadata"}}}},"ResourceMetadata":{"type":"object","properties":{"resourceURI":{"type":"string"},"resourceCollectionId":{"type":"string"},"resourceId":{"type":"string"},"resourceName":{"type":"string"},"resourceType":{"type":"string"},"mediaType":{"type":"string"},"resourceVersion":{"type":"string"},"checksum":{"type":"string"},"created":{"type":"string"},"nextVersionId":{"type":"string"},"previousVersionId":{"type":"string"}}},"InvalidRequest":{"description":"A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.","type":"object","properties":{"error":{"type":"string"}}},"UnauthorizedError":{"description":"Access token is missing or invalid","type":"object","properties":{"error":{"type":"string"}}},"InternalError":{"description":"An internal error has occurred. Additional state information plus metadata may be available in the response body.","type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/did/search/{did}":{"get":{"tags":["Decentralized Identifiers (DIDs)"],"summary":"Resolve a DID Document.","description":"Resolve a DID Document by DID identifier. Also supports DID Resolution Queries as defined in the <a href=\"https://w3c-ccg.github.io/did-resolution/\">W3C DID Resolution specification</a>.","parameters":[{"in":"path","name":"did","description":"DID identifier to resolve.","schema":{"type":"string"},"required":true},{"in":"query","name":"metadata","description":"Return only metadata of DID Document instead of actual DID Document.","schema":{"type":"boolean"}},{"in":"query","name":"versionId","description":"Unique UUID version identifier of DID Document. Allows for fetching a specific version of the DID Document. See <a href=\"https://docs.cheqd.io/identity/architecture/adr-list/adr-001-cheqd-did-method#did-document-metadata\">cheqd DID Method Specification</a> for more details.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"versionTime","description":"Returns the closest version of the DID Document *at* or *before* specified time. See <a href=\"https://docs.cheqd.io/identity/architecture/adr-list/adr-005-did-resolution-and-did-url-dereferencing\">DID Resolution handling for `did:cheqd`</a> for more details.","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"transformKeys","description":"This directive transforms the Verification Method key format from the version in the DID Document to the specified format chosen below.","schema":{"type":"string","enum":["Ed25519VerificationKey2018","Ed25519VerificationKey2020","JsonWebKey2020"]}},{"in":"query","name":"service","description":"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 <a href=\"https://w3c-ccg.github.io/did-resolution/#dereferencing\">DID Resolution specification</a> algorithm.","schema":{"type":"string"}},{"in":"query","name":"relativeRef","description":"Relative reference is a query fragment appended to the Service Endpoint URL. **Must** be used along with the `service` query property above. See <a href=\"https://w3c-ccg.github.io/did-resolution/#dereferencing\">DID Resolution specification</a> algorithm for more details.","schema":{"type":"string"}}],"responses":{"200":{"description":"The request was successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DidResolution"}}}},"400":{"$ref":"#/components/schemas/InvalidRequest"},"401":{"$ref":"#/components/schemas/UnauthorizedError"},"500":{"$ref":"#/components/schemas/InternalError"}}}}}}
```
