# DID Linked Resources (DLRs)

## Create a DID-Linked Resource.

> This endpoint creates a DID-Linked Resource. As input, it can take the DID identifier and the resource parameters via a form, or the fully-assembled resource itself.

```json
{"openapi":"3.0.0","info":{"title":"cheqd Studio API for cheqd network","version":"2.0.0"},"tags":[{"name":"DID-Linked Resources (DLRs)"}],"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":{"CreateResourceRequest":{"description":"Input fields for DID-Linked Resource creation.","type":"object","additionalProperties":false,"required":["name","type","data","encoding"],"properties":{"data":{"description":"Encoded string containing the data to be stored in the DID-Linked Resource.","type":"string"},"encoding":{"description":"Encoding format used to encode the data.","type":"string","enum":["base64url","base64","hex"]},"name":{"description":"Name of DID-Linked Resource.","type":"string"},"type":{"description":"Type of DID-Linked Resource. This is NOT the same as the media type, which is calculated automatically ledger-side.","type":"string"},"alsoKnownAs":{"description":"Optional field to assign a set of alternative URIs where the DID-Linked Resource can be fetched from.","type":"array","items":{"type":"object","properties":{"uri":{"type":"string"},"description":{"type":"string"}}}},"version":{"description":"Optional field to assign a human-readable version in the DID-Linked Resource.","type":"string"},"publicKeyHexs":{"description":"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.","type":"array","items":{"type":"string"}}}},"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":{"/resource/create/{did}":{"post":{"tags":["DID-Linked Resources (DLRs)"],"summary":"Create a DID-Linked Resource.","description":"This endpoint creates a DID-Linked Resource. As input, it can take the DID identifier and the resource parameters via a form, or the fully-assembled resource itself.","parameters":[{"in":"path","name":"did","description":"DID identifier to link the resource to.","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CreateResourceRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceRequest"}}}},"responses":{"200":{"description":"The request was successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceMetadata"}}}},"400":{"$ref":"#/components/schemas/InvalidRequest"},"401":{"$ref":"#/components/schemas/UnauthorizedError"},"500":{"$ref":"#/components/schemas/InternalError"}}}}}}
```

## Get a DID-Linked Resource.

> This endpoint returns the DID-Linked Resource for a given DID identifier and resource identifier.

```json
{"openapi":"3.0.0","info":{"title":"cheqd Studio API for cheqd network","version":"2.0.0"},"tags":[{"name":"DID-Linked Resources (DLRs)"}],"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":{"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":{"/resource/search/{did}":{"get":{"tags":["DID-Linked Resources (DLRs)"],"summary":"Get a DID-Linked Resource.","description":"This endpoint returns the DID-Linked Resource for a given DID identifier and resource identifier.","parameters":[{"in":"path","name":"did","description":"DID identifier","schema":{"type":"string"},"required":true},{"in":"query","name":"resourceId","description":"Fetch a DID-Linked Resource by Resource ID unique identifier. Since this is a unique identifier, other Resource query parameters are not required. See <a href=\"https://docs.cheqd.io/identity/credential-service/did-linked-resources/understanding-dlrs/technical-composition\">DID-Linked Resources</a> for more details.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"resourceName","description":"Filter a DID-Linked Resource query by Resource Name. See <a href=\"https://docs.cheqd.io/identity/credential-service/did-linked-resources/understanding-dlrs/technical-composition\">DID-Linked Resources</a> for more details.","schema":{"type":"string"}},{"in":"query","name":"resourceType","description":"Filter a DID-Linked Resource query by Resource Type. See <a href=\"https://docs.cheqd.io/identity/credential-service/did-linked-resources/understanding-dlrs/technical-composition\">DID-Linked Resources</a> for more details.","schema":{"type":"string"}},{"in":"query","name":"resourceVersion","description":"Filter a DID-Linked Resource query by Resource Version, which is an optional free-text field used by issuers (e.g., \"v1\", \"Final Version\", \"1st January 1970\" etc). See <a href=\"https://docs.cheqd.io/identity/credential-service/did-linked-resources/understanding-dlrs/technical-composition\">DID-Linked Resources</a> for more details.","schema":{"type":"string"}},{"in":"query","name":"resourceVersionTime","description":"Filter a DID-Linked Resource query which returns the closest version of the Resource *at* or *before* specified time. See <a href=\"https://docs.cheqd.io/identity/credential-service/did-linked-resources/understanding-dlrs/technical-composition\">DID-Linked Resources</a> for more details.","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"checksum","description":"Request integrity check against a given DID-Linked Resource by providing a SHA-256 checksum hash. See <a href=\"https://docs.cheqd.io/identity/credential-service/did-linked-resources/understanding-dlrs/technical-composition\">DID-Linked Resources</a> for more details.","schema":{"type":"string"}},{"in":"query","name":"resourceMetadata","description":"Return only metadata of DID-Linked Resource instead of actual DID-Linked Resource. Mutually exclusive with some of the other parameters.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"The request was successful.","content":{"any":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/schemas/InvalidRequest"},"401":{"$ref":"#/components/schemas/UnauthorizedError"},"500":{"$ref":"#/components/schemas/InternalError"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cheqd.io/product/api-reference/combined/did-linked-resources-dlrs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
