> For the complete documentation index, see [llms.txt](https://docs.cheqd.io/product/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cheqd.io/product/sdk/credo/did-linked-resources/create-dlr.md).

# Create a DID-Linked Resource

Create a DID-Linked Resource (DLR) on cheqd using the Credo Agent.

The `createResource` method from the **Credo cheqd module** allows you to create a **DID-Linked Resource** and publish it to the cheqd network under a `did:cheqd` identifier.

DID-Linked Resources are uniquely identified by a **UUIDv4 resource ID** and persistently attached to the DID on-chain. These resources can later be resolved by ID or query parameters (e.g., `resourceName`, `resourceType`).

#### Required Parameters

| Field          | Required | Description                                                          |
| -------------- | -------- | -------------------------------------------------------------------- |
| `did`          | ✅        | The `did:cheqd` identifier under which the resource is created       |
| `id`           | ✅        | A UUID string that acts as the permanent resource ID                 |
| `name`         | ✅        | A human-readable resource name                                       |
| `resourceType` | ✅        | A short type identifier (e.g. `TrustRegistry`, `Logo`, `StatusList`) |
| `data`         | ✅        | The content to store (object, Base64-encoded string, or plain text)  |
| `version`      | ❌        | Optional semantic version string (e.g. `"1.0"`)                      |
| `alsoKnownAs`  | ❌        | Optional array of aliases for the resource                           |

#### Example

```ts
await agent.modules.cheqd.createResource(
  'did:cheqd:testnet:92874297-d824-40ea-8ae5-364a1ec9237d',
  {
    id: '6de33634-6439-4e46-aa3f-bfe03606b000',
    name: 'exampleTrustRegistry',
    resourceType: 'TrustRegistry',
    version: '1.0',
    data: {
      name: 'Example Org',
      jurisdiction: 'EU',
    },
  }
)
```

> 💡 The `id` field must be a **UUIDv4**. You are responsible for generating and tracking this ID.

### Recommendations

* Ensure the `id` is a **UUIDv4**, generated using a reliable UUID library (e.g., `uuid` in Node.js)
* Keep `resourceName` and `resourceType` descriptive but concise — they are used for resolution
* If the resource data is sensitive or large, consider encoding as a base64 string
* Use `version` to manage changes to the resource over time


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cheqd.io/product/sdk/credo/did-linked-resources/create-dlr.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
