> For the complete documentation index, see [llms.txt](https://docs.startrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.startrail.io/startrail-sdk-js/startrail-api-methods/updatemetadata.md).

# Update Metadata

## `updateMetadata()`

Update the metadata in the SRR.

## Method parameters

| Variable                      | Type     | Description                                                                                                           |
| ----------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `startrailLUWContractAddress` | `string` | The address of LicensedUserWallet(LUW) contract.                                                                      |
| `contractAddress`             | `string` | The address of collection contract. Sets it when you want to associate collection contract address with the SRR.      |
| `tokenId`                     | `string` | Startrail Registry Record Token ID                                                                                    |
| `metadata`                    | `object` | Refer to the [Startrail Registry (SRR) data schema](/metadata-schema/startrail-registry-srr.md) for all possible data |

### Parameters Example

```
const res = await sdk.approveSRRByCommitment(
  {  
    startrailLUWContractAddress: '0x113c6880fc4a2664E125973BC0Dfd37d62Ec7c3f',
    tokenId: '212786904920',
    metadata: {
      "$schema": "https://api.startrail.io/api/v1/schema/registry-record-metadata.v2.0.schema.json",
      "$schemaIntegrity": "sha256-f63238ce3b8c4f8a99fb453d716d5451f75508c2e403a58af0412014187e7a61",
      "startbahnCertICTagUIDs": [
        "1234567890abcdef"
      ],
      "title": {
        "en": "A title",
        "ja": "タイトル",
        "zh": "一个标题"
      },
      "size": {
        "width": 200,
        "height": 400,
        "depth": 12.4,
        "unit": "pixel",
        "flexibleDescription": {
          "en": "flexibleDescription comes here",
          "ja": "自由だーーー"
        }
      },
      "medium": {
        "en": "Oil on canvas",
        "ja": "キャンバスに油彩",
        "zh": "布面油画"
      },
      "edition": {
        "uniqueness": "unique work",
        "proofType": "ED",
        "number": 1,
        "totalNumber": 3,
        "note": {
          "en": "some extra notes in 1 or more languages"
        }
      },
      "contractTerms": {
        "royaltyRate": 15.7,
        "fileURL": "https://startrail.io/whitepaper/startrail_wp_en_v1.1.pdf"
      },
      "note": {
        "en": "note",
        "zh": "注意"
      },
      "thumbnailURL": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
      "yearOfCreation": {
        "en": "around 2010-2020",
        "ja": "2010年から2020年頃"
      },
      "isDigital": true,
      "digitalDataHash": "sha256-247e4b904322a1dd0b148cd77e8627ec7d391251380880ab4621726ecb945ef5",
      "digitalComponents": [
        {
          "hash": "sha256-247e4b904322a1dd0b148cd77e8627ec7d391251380880ab4621726ecb945ef5",
          "category": "artwork"
        }
      ],
      "attachmentFiles": [
        {
          "hash": "sha256-247e4b904322a1dd0b148cd77e8627ec7d391251380880ab4621726ecb945ef5",
          "category": "artwork"
        }
      ],
      "name": "some nft name",
      "description": "some nft description",
      "image": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
      "external_url": "https://openseacreatures.io/3"
    }
  },
)

```

## Returns

`Promise` will be returned which resolves with a `Response` object upon a successful confirmation. `false` will be returned when user flow is cancelled in such a case that a user closes the popup modal.

If the confirmation fails, the `Promise` will resolve with an {error} object that describes the failure.

`Promise<Response | false>`

{% hint style="warning" %}
The use of "txReceiptId" will soon be deprecated and removed.
{% endhint %}

### Response

| Variable      | Type        | Description                                             |
| ------------- | ----------- | ------------------------------------------------------- |
| `txReceiptId` | `string`    | ID to identify transaction details in Startrail-API DB. |
| `tx`          | `TxDetails` | Transaction details                                     |

### TxDetails

| Variable          | Type     | Description                                              |
| ----------------- | -------- | -------------------------------------------------------- |
| `contractAddress` | `string` | The address of collection contract associated to the SRR |
| `metadataCID`     | `string` | A calculated metadataCID                                 |
| `tokenId`         | `string` | A calculated tokenId                                     |

### Error

Custom `Error` objects. Refer to the [Error Catalogue](/startrail-sdk-js/errors.md) for possible data.

### Response Example

```
{
  "txReceiptId": 0,
  "tx": {
      "contractAddress": "0x87Ef5da2c87e047E7F005Efb8b68a93Dc94D161c",
      "tokenId": "209850285627",
      "metadataCID": "bafkreibjdtcklpe5wjgh6qp2dqygaydm3d4xttfhaphgian73bpprkr7xu"
  }
}
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.startrail.io/startrail-sdk-js/startrail-api-methods/updatemetadata.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
