> ## Documentation Index
> Fetch the complete documentation index at: https://docs.namespace.ninja/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or Update Subname

> Create new ENS subnames or update existing ones with records and metadata.

## Creating a Subname

Create a subname under an existing ENS name with text records, address records, and metadata.

<Note>
  <strong>Label:</strong> Follows ENS naming convention with UTS-51 encoding. Can include emojis. See <a href="https://docs.ens.domains/ensip/15/">ENSIP-15</a>.
</Note>

```typescript theme={null}
import { ChainName } from "@thenamespace/offchain-manager";

client.createSubname({
  label: "subname",
  parentName: "example.eth",
  texts: [
    { key: "avatar", value: "avatar url..." },
    { key: "name", value: "superman" },
  ],
  addresses: [
    { chain: ChainName.Ethereum, value: "0x123..." },
    { chain: ChainName.Bitcoin, value: "qgds..." },
  ],
  owner: "0x123...",
  metadata: [{ key: "sender", value: "0x123..." }],
});
```

**Parameters:**

* `label` - Subname label (e.g., "subname" for subname.example.eth)
* `parentName` - Parent ENS name
* `texts` - Text records (optional)
* `addresses` - Address records (optional)
* `metadata` - Key-value metadata for filtering (optional)
* `contenthash` - Content hash (optional)
* `owner` - Owner address (optional)
* `ttl` - Time-to-live (optional)

<Tip>
  Include the <code>owner</code> field when creating a subname. This allows you to later fetch all subnames owned by a specific address using the SDK or API.
</Tip>

## Updating a Subname

Modify text records, address records, content hash, or metadata for an existing subname.

```typescript theme={null}
client.updateSubname("superman.namespace.eth", {
  texts: [{ key: "avatar", value: "updated-avatar" }],
});
```

**Parameters:**

* `texts` - Text records to update (optional)
* `addresses` - Address records to update (optional)
* `metadata` - Metadata to update (optional)
* `contenthash` - New content hash (optional)
* `ttl` - Time-to-live (optional)

<Note>
  The `ChainName` enum maps blockchain networks to their [SLIP-0044](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) coin types. See [ChainName](/developer-guide/sdks/offchain-manager/chainname) for details.
</Note>
